SlideShare ist ein Scribd-Unternehmen logo
1 von 21
 Introduction: History and Physiology
 Construction Glasses-free 3D Displays
 Multi-view Rendering using OpenGL
 Multi-view Interlacing using GLSL
 Designing Content for Glasses-free 3D Displays
 Emerging Technology
 Q & A and Demonstrations
Course Outline
Overview:
A Real-Time Lenticular 3D Display
Goal: Run rendering pipeline at > 10fps
Generate Views
Offline Real-Time C/C++
Interlace Views
Overview:
Multi-View Rendering in OpenGL
OpenGL
Draw Calls
Render
Standard Pipeline
Output
Multi-View Pipeline
Loop Over
Views
Backbuffer
Framebuffer
Object Array
Render View
Change
Camera
Screen:Memory:
Overview:
GLSL: Programmable Pipeline
Fixed Function Pipeline
Drawing API
Process Vertices
Process Pixels
Framebuffer
Programmable Pipeline
Vertex Program
Fragment Program
Overview:
Multi-View Interlacing using GLSL Shaders
Framebuffer
Object Array
Mask
1
Mask
2
Mask
3
View 1
View 2
View 3
GLSL Program
Translate views
appropriately for
output device
Backbuffer
Anaglyph
Glasses
Lenticular
Shown in this course…
The model can apply to
many others
Equivalents in optics/photography
•Perspective Control Lens
•Lens Shift Projector
Photos: wikipedia
Multi-View Rendering in OpenGL:
Off-Axis Perspective Projection with glFrustum()
GLFRUSTUM(3G)
GLFRUSTUM(3G)
NAME
glFrustum - multiply the current matrix by a perspective
matrix
C SPECIFICATION
void glFrustum( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble near_val,
GLdouble far_val )
PARAMETERS
left, right Specify the coordinates for the left
and right vertical
clipping planes.
bottom, top Specify the coordinates for the bottom and
top
horizontal clipping planes.
near_val, far_val
Specify the distances to the near and
far depth clipping
planes. Both distances must be positive.
Screen (0,0,0)
far_val
near_val
far_val
near_val
right
right
left
left
3D
2D
Multi-View Rendering in OpenGL:
Off-Axis Perspective Projection with glFrustum()
Output
Multi-View Rendering in OpenGL:
Off-Axis Perspective Projection with glFrustum()
// Set view for multi-view (multiscopic) rendering.
void setViewMultiscopicLenticular(LenticularInterlacer* interlacer, int viewIndex){
float x = interlacer->camera.x+viewIndex*interlacer-
>camera.separation-
((interlacer->camera.numViews-1)*interlacer-
>camera.separation/2);
float depthRatio = interlacer->camera.near/interlacer->camera.z;
float halfWidth = interlacer->screen.width*interlacer-
>screen.pitch/2;
float halfHeight = interlacer->screen.height*interlacer-
>screen.pitch/2;
float left = -depthRatio*(x+halfWidth);
float right = -depthRatio*(x-halfWidth);
float bottom = -depthRatio*(interlacer->camera.y+halfHeight);
float top = -depthRatio*(interlacer->camera.y-halfHeight);
glViewport(0, 0, interlacer->camera.width, interlacer->camera.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(left, right, bottom, top, interlacer->camera.near, interlacer-
>camera.far);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(x, interlacer->camera.y, interlacer->camera.z,
x, interlacer->camera.y, 0.0, 0.0, 1.0, 0.0);
}
lenticular.h
Interlacer.frag
lenticular.cpp
interlacer.vert
mosaic.vert
mosaic.frag
Lenticular Interlacer Library
Lenticular Model Viewer
glinfo.h
glinfo.cpp
OpenGL State Information Library
glm.h
glm.cpp
GLM OBJ Model Library
glf.h
glf.cpp
OpenGL Function Library
glinclude.h
OpenGL Include Files
Multi-View Rendering in OpenGL:
Off-Screen Rendering using a Frame Buffer Object (FBO)
Resource: www.songho.ca/opengl/gl_fbo.html
GL Functions
glGenFramebuffers()
glBindFramebuffer()
glGenTextures()
glBindTexture()
glGenRenderbuffers()
glBindRenderbuffer()
glTexImage3D()
glRenderbufferStorage()
glFramebufferTextureLayer()
glFramebufferTexture2D()
glFramebufferRenderbuffer()
Example
Code
Multi-View Rendering in OpenGL:
Off-Screen Rendering using a Frame Buffer Object (FBO)
GL Functions
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FBO_ID)
OpenGL
Draw Calls
Backbuffer
FBO
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0)
glBindTexture(GL_TEXTURE_2D, fbotexture);
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glOrtho(0.f,width,0.f,height);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glBegin(GL_QUADS);
glTexCoord2f(0.f,0.f); glVertex3f(0.f, 0.f, 0.f);
glTexCoord2f(1.f,0.f); glVertex3f(width, 0.f, 0.f);
glTexCoord2f(1.f,1.f);
glVertex3f(width,height,0.f);
glTexCoord2f(0.f,1.f); glVertex3f(0.f,height,0.f);
glEnd();
Render FBO texture directly to screen
Anaglyphic Model Viewer:
Demonstration
• Some graphics cards have support for stereo 3D
• Double buffered stereo = Quad buffered
void
display(void)
{
glDrawBuffer(GL_BACK_LEFT);
<Draw left eye here>
glDrawBuffer(GL_BACK_RIGHT);
<Draw right eye here>
glutSwapBuffers();
}
int
main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(
GLUT_DOUBLE | GLUT_RGB | GLUT_STEREO);
glutCreateWindow("stereo example");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
Anaglyphic Model Viewer:
Stereo 3D in OpenGL
• Only professional cards (e.g. Nvidia Quadro line) support Quad Buffered
rendering
• If supported, rendering output is hardware and driver specific
• Range of options is overwhelming
• Does not extend to more than two views
– This is a course on multi-view rendering!
Anaglyphic Model Viewer:
GLSL over Quad Buffered Stereo
• Modes supported on Quadro cards:
http://us.download.nvidia.com/XFree86/Linux-x86/275.21/README/xconfigoptions.html
DDC
Glasses
Shutter glasses synced using
monitor communication bus
Blueline
GlassesLength of blue
line at the bottom of the frame
sends image to correct LCD
DIN Connector
Shutter glasses synced using
special video card connector
Clone Mode
Right and left images are shown
on identically configured displays
Interlaced
Separate the
right and left
channels into even
and odd scanlines
Color
Interleaved
Separate views in color
channels
e.g. Sharp 3D
Checkerboard
Views separated
in checkerboard
pattern for 3D
DLP Projectors
NVIDIA 3D Vision
NVIDIA’s own
system; DIN
connector with
polarity sent over
IR via USB tower
Anaglyphic Model Viewer:
Example: NVIDIA Quad Buffer Support
Anaglyphic Model Viewer:
Application Overview
Main Application
main.h
main.cpp
config.txt
help.txt
/models/*.obj
anaglyph.h
anaglyphfrag
anaglyph.cpp
anaglyphvert
Anaglyph Interlacer Library
Anaglyph Model Viewer
glinfo.h
glinfo.cpp
OpenGL State Information Library
glm.h
glm.cpp
GLM OBJ Model Library
glf.h
glf.cpp
OpenGL Function Library
glinclude.h
OpenGL Include Files
Full Color Anaglyph Mode
Optimized Anaglyph Mode
Anaglyphic Model Viewer:
Examining the GLUT Display Callback
main.h
main.cpp
config.txt
help.txt
/models/*.obj
Anaglyph Model Viewer
Main Application
// Define the display function.
void display(void){
. . .
// Render each view.
for(int i=0; i<2; i++){
// Enable FBO rendering mode.
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, anaglyph.FBO[i]);
// Enable depth testing and lighting.
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
// Clear the color and depth buffers.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Set the projection and modelview transformations.
setViewStereoscopicAnaglyph(&anaglyph, window_width,
window_height, i);
// Display the model.
displayModel();
}
// Display the stereoscopic image using the anaglyph compositor.
displayAnaglyph(&anaglyph, window_width, window_height);
. . .
glutSwapBuffers();
}
anaglyph.h
Anaglyph.frag
anaglyph.cpp
Anaglyph.vert
Anaglyph Interlacer Library
Anaglyph Model Viewer
glinfo.h
glinfo.cpp
OpenGL State Information Library
glm.h
glm.cpp
GLM OBJ Model Library
glf.h
glf.cpp
OpenGL Function Library
glinclude.h
OpenGL Include Files
Anaglyphic Model Viewer:
Examining displayAnaglyph()
// Define the display function for the anaglyph compositor.
void displayAnaglyph(AnaglyphCompositor* anaglyph, int window_width, int window_height){
. . .
// Disable FBO rendering mode.
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
. . .
// Clear the color buffer.
glClear(GL_COLOR_BUFFER_BIT);
// Enable the anaglyph compositor shader program.
glUseProgram(anaglyph->anaglyphShader.program);
// Bind FBO textures to anaglyph shader program samplers.
glUniform1i(glGetUniformLocation(anaglyph->anaglyphShader.program, "leftTexture"), 0);
glUniform1i(glGetUniformLocation(anaglyph->anaglyphShader.program, "rightTexture"), 1);
for(int i=0; i<2; i++){
glActiveTexture(GL_TEXTURE0+i);
glBindTexture(GL_TEXTURE_2D, anaglyph->viewTexture[i]);
}
glActiveTexture(GL_TEXTURE0);
// Set the anaglyph rendering mode.
glUniform1i(glGetUniformLocation(
anaglyph->anaglyphShader.program, "anaglyphMode"),
anaglyph->mode
);
// Display the anaglyph by rendering contents of FBO to screen quad.
. . .
// Disable the shader program.
glUseProgram(0);
}
Anaglyphic Model Viewer:
Anaglyph Compositing Algorithms
L R
3x3 Color Transform Matrix Pair
Full Color
Half Color
Optimized
L= R=
1 0 0
0 0 0
0 0 0
0 0 0
0 1 0
0 0 1
L= R=
0.299 0 0
0.587 0 0
0.114 0 0
0 0 0
0 1 0
0 0 1
L= R=
0 0 0
0.7 0 0
0.3 0 0
0 0 0
0 1 0
0 0 1
=
Source: http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
Anaglyphic Model Viewer:
GLSL Shaders for Anaglyph Compositing
anaglyph.h
anaglyph.frag
anaglyph.cpp
anaglyph.vert
Anaglyph Interlacer Library
Anaglyph Model Viewer
Anaglyph Interlacer Library
glinfo.h
glinfo.cpp
OpenGL State Information Library
glm.h
glm.cpp
GLM OBJ Model Library
glf.h
glf.cpp
OpenGL Function Library
glinclude.h
OpenGL Include Files
/*
* anaglyph.frag
* Anaglyph Compositor Fragment Shader
* Created by Douglas Lanman and Matthew Hirsch.
* Copyright 2011.
*/
// Define samplers corresponding to left and right
images.
uniform sampler2D leftTexture;
uniform sampler2D rightTexture;
// Define anaglyph mode index.
uniform int anaglyphMode;
// Define fragment shader.
void main() {
// Evaluate the left and right
fragment colors.
vec3 leftFragColor = texture2D(
leftTexture,
gl_TexCoord[0].st
).rgb;
vec3 rightFragColor = texture2D(
rightTexture,
gl_TexCoord[0].st
).rgb;
// Assign the output fragment color
using the
// user-selected anaglyph rendering
mode.
mat3 L, R;
R = mat3( 0.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0);
if(anaglyphMode == 2){
// Half-color anaglyph.
L = mat3( 0.299, 0.0,
0.0,
0.587, 0.0,
0.0,
0.114, 0.0,
0.0);
}else if(anaglyphMode == 3){
// Optimized anaglyph.
L = mat3( 0.0, 0.0, 0.0,
0.7, 0.0, 0.0,
0.3, 0.0, 0.0);
}else{
// Full-color anaglyph.
L = mat3( 1.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0);
}
gl_FragColor = vec4(
L*leftFragColor+R*rightFragColor,
1.0
);
}
Anaglyphic Model Viewer:
Possible Extensions: Adding Eye-Tracking
main.h
main.cpp
config.txt
help.txt
/models/*.obj
Anaglyph Model Viewer
Main Application
[screen]
width = 1920
height = 1080
pitch = 0.025800
[camera]
x = 0.000000
y = 0.000000
z = 100.000000
near = 10.000000
far = 300.000000
separation = 6.500000
[viewer]
anaglyph_mode = 1
display_help = 1
display_timer = 1
…
•Camera X and Y control viewer position
•Wiimote and OpenCV headtracking
examples are available online
Johnny Lee
 Introduction: History and Physiology
 Construction Glasses-free 3D Displays
 Multi-view Rendering using OpenGL
 Multi-view Interlacing using GLSL
 Designing Content for Glasses-free 3D Displays
 Emerging Technology
 Q & A and Demonstrations
Course Outline

Weitere ähnliche Inhalte

Was ist angesagt?

OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL IntroductionYi-Lung Tsai
 
PVS-Studio for Linux Went on a Tour Around Disney
PVS-Studio for Linux Went on a Tour Around DisneyPVS-Studio for Linux Went on a Tour Around Disney
PVS-Studio for Linux Went on a Tour Around DisneyPVS-Studio
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glutsimpleok
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture MappingMark Kilgard
 
Open cv tutorial
Open cv tutorialOpen cv tutorial
Open cv tutorialEric Larson
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1qpqpqp
 

Was ist angesagt? (10)

OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
Open gl
Open glOpen gl
Open gl
 
PVS-Studio for Linux Went on a Tour Around Disney
PVS-Studio for Linux Went on a Tour Around DisneyPVS-Studio for Linux Went on a Tour Around Disney
PVS-Studio for Linux Went on a Tour Around Disney
 
Lecture 6 introduction to open gl and glut
Lecture 6   introduction to open gl and glutLecture 6   introduction to open gl and glut
Lecture 6 introduction to open gl and glut
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
OpenGL 4.4 Reference Card
OpenGL 4.4 Reference CardOpenGL 4.4 Reference Card
OpenGL 4.4 Reference Card
 
WebGL 2.0 Reference Guide
WebGL 2.0 Reference GuideWebGL 2.0 Reference Guide
WebGL 2.0 Reference Guide
 
Open cv tutorial
Open cv tutorialOpen cv tutorial
Open cv tutorial
 
OpenVG 1.1 Reference Card
OpenVG 1.1 Reference Card OpenVG 1.1 Reference Card
OpenVG 1.1 Reference Card
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
 

Andere mochten auch

>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...
>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...
>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...Matt Hirsch - MIT Media Lab
 
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...Matt Hirsch - MIT Media Lab
 
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...Matt Hirsch - MIT Media Lab
 
Decoupled Drupal Showcase: Using Drupal to Power Digital Signage
Decoupled Drupal Showcase: Using Drupal to Power Digital SignageDecoupled Drupal Showcase: Using Drupal to Power Digital Signage
Decoupled Drupal Showcase: Using Drupal to Power Digital SignageAcquia
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesDouglas Lanman
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...SlideShare
 

Andere mochten auch (18)

BYO3D 2011: Construction
BYO3D 2011: ConstructionBYO3D 2011: Construction
BYO3D 2011: Construction
 
BYO3D 2011: Emerging Technology
BYO3D 2011: Emerging TechnologyBYO3D 2011: Emerging Technology
BYO3D 2011: Emerging Technology
 
BYO3D 2011: History
BYO3D 2011: HistoryBYO3D 2011: History
BYO3D 2011: History
 
BYO3D 2011: Welcome
BYO3D 2011: WelcomeBYO3D 2011: Welcome
BYO3D 2011: Welcome
 
Capture and Rendering
Capture and RenderingCapture and Rendering
Capture and Rendering
 
HR3D: Content Adaptive Parallax Barriers
HR3D: Content Adaptive Parallax BarriersHR3D: Content Adaptive Parallax Barriers
HR3D: Content Adaptive Parallax Barriers
 
BYO3D 2011: Content
BYO3D 2011: ContentBYO3D 2011: Content
BYO3D 2011: Content
 
Unencumbered 3D Displays
Unencumbered 3D DisplaysUnencumbered 3D Displays
Unencumbered 3D Displays
 
>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...
>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...
>A Switchable Light Field Camera Architecture with Angle SEnsitive Pixels and...
 
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...
SIGGRAPH 2012 Computational Display Course - 3 Computational Light Field Disp...
 
Introduction and History
Introduction and HistoryIntroduction and History
Introduction and History
 
Emerging 3D Display Technologies
Emerging 3D Display TechnologiesEmerging 3D Display Technologies
Emerging 3D Display Technologies
 
Glasses Based 3D Displays
Glasses Based 3D DisplaysGlasses Based 3D Displays
Glasses Based 3D Displays
 
Representation
RepresentationRepresentation
Representation
 
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...
SIGGRAPH 2012 Computational Display Course - 4 Perceptually Driven Computatio...
 
Decoupled Drupal Showcase: Using Drupal to Power Digital Signage
Decoupled Drupal Showcase: Using Drupal to Power Digital SignageDecoupled Drupal Showcase: Using Drupal to Power Digital Signage
Decoupled Drupal Showcase: Using Drupal to Power Digital Signage
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 

Ähnlich wie BYO3D 2011: Rendering

openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleAxway Appcelerator
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180Mahmoud Samir Fayed
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.pptEngrZamaan
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing StuffMark Kilgard
 
Getting Started with WebGL
Getting Started with WebGLGetting Started with WebGL
Getting Started with WebGLChihoon Byun
 
The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181Mahmoud Samir Fayed
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and QtICS
 

Ähnlich wie BYO3D 2011: Rendering (20)

Opengl (1)
Opengl (1)Opengl (1)
Opengl (1)
 
Open gles
Open glesOpen gles
Open gles
 
Open gl
Open glOpen gl
Open gl
 
Bai 1
Bai 1Bai 1
Bai 1
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Richard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL ModuleRichard Salter: Using the Titanium OpenGL Module
Richard Salter: Using the Titanium OpenGL Module
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt01.Opengl_intro-2.ppt
01.Opengl_intro-2.ppt
 
Development with OpenGL and Qt
Development with OpenGL and QtDevelopment with OpenGL and Qt
Development with OpenGL and Qt
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
Getting Started with WebGL
Getting Started with WebGLGetting Started with WebGL
Getting Started with WebGL
 
OpenGL L03-Utilities
OpenGL L03-UtilitiesOpenGL L03-Utilities
OpenGL L03-Utilities
 
The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and Qt
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 

Kürzlich hochgeladen

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 

Kürzlich hochgeladen (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 

BYO3D 2011: Rendering

  • 1.  Introduction: History and Physiology  Construction Glasses-free 3D Displays  Multi-view Rendering using OpenGL  Multi-view Interlacing using GLSL  Designing Content for Glasses-free 3D Displays  Emerging Technology  Q & A and Demonstrations Course Outline
  • 2. Overview: A Real-Time Lenticular 3D Display Goal: Run rendering pipeline at > 10fps Generate Views Offline Real-Time C/C++ Interlace Views
  • 3. Overview: Multi-View Rendering in OpenGL OpenGL Draw Calls Render Standard Pipeline Output Multi-View Pipeline Loop Over Views Backbuffer Framebuffer Object Array Render View Change Camera Screen:Memory:
  • 4. Overview: GLSL: Programmable Pipeline Fixed Function Pipeline Drawing API Process Vertices Process Pixels Framebuffer Programmable Pipeline Vertex Program Fragment Program
  • 5. Overview: Multi-View Interlacing using GLSL Shaders Framebuffer Object Array Mask 1 Mask 2 Mask 3 View 1 View 2 View 3 GLSL Program Translate views appropriately for output device Backbuffer Anaglyph Glasses Lenticular Shown in this course… The model can apply to many others
  • 6. Equivalents in optics/photography •Perspective Control Lens •Lens Shift Projector Photos: wikipedia Multi-View Rendering in OpenGL: Off-Axis Perspective Projection with glFrustum() GLFRUSTUM(3G) GLFRUSTUM(3G) NAME glFrustum - multiply the current matrix by a perspective matrix C SPECIFICATION void glFrustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val ) PARAMETERS left, right Specify the coordinates for the left and right vertical clipping planes. bottom, top Specify the coordinates for the bottom and top horizontal clipping planes. near_val, far_val Specify the distances to the near and far depth clipping planes. Both distances must be positive. Screen (0,0,0) far_val near_val far_val near_val right right left left 3D 2D
  • 7. Multi-View Rendering in OpenGL: Off-Axis Perspective Projection with glFrustum() Output
  • 8. Multi-View Rendering in OpenGL: Off-Axis Perspective Projection with glFrustum() // Set view for multi-view (multiscopic) rendering. void setViewMultiscopicLenticular(LenticularInterlacer* interlacer, int viewIndex){ float x = interlacer->camera.x+viewIndex*interlacer- >camera.separation- ((interlacer->camera.numViews-1)*interlacer- >camera.separation/2); float depthRatio = interlacer->camera.near/interlacer->camera.z; float halfWidth = interlacer->screen.width*interlacer- >screen.pitch/2; float halfHeight = interlacer->screen.height*interlacer- >screen.pitch/2; float left = -depthRatio*(x+halfWidth); float right = -depthRatio*(x-halfWidth); float bottom = -depthRatio*(interlacer->camera.y+halfHeight); float top = -depthRatio*(interlacer->camera.y-halfHeight); glViewport(0, 0, interlacer->camera.width, interlacer->camera.height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(left, right, bottom, top, interlacer->camera.near, interlacer- >camera.far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(x, interlacer->camera.y, interlacer->camera.z, x, interlacer->camera.y, 0.0, 0.0, 1.0, 0.0); } lenticular.h Interlacer.frag lenticular.cpp interlacer.vert mosaic.vert mosaic.frag Lenticular Interlacer Library Lenticular Model Viewer glinfo.h glinfo.cpp OpenGL State Information Library glm.h glm.cpp GLM OBJ Model Library glf.h glf.cpp OpenGL Function Library glinclude.h OpenGL Include Files
  • 9. Multi-View Rendering in OpenGL: Off-Screen Rendering using a Frame Buffer Object (FBO) Resource: www.songho.ca/opengl/gl_fbo.html GL Functions glGenFramebuffers() glBindFramebuffer() glGenTextures() glBindTexture() glGenRenderbuffers() glBindRenderbuffer() glTexImage3D() glRenderbufferStorage() glFramebufferTextureLayer() glFramebufferTexture2D() glFramebufferRenderbuffer()
  • 10. Example Code Multi-View Rendering in OpenGL: Off-Screen Rendering using a Frame Buffer Object (FBO) GL Functions glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FBO_ID) OpenGL Draw Calls Backbuffer FBO glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0) glBindTexture(GL_TEXTURE_2D, fbotexture); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.f,width,0.f,height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glBegin(GL_QUADS); glTexCoord2f(0.f,0.f); glVertex3f(0.f, 0.f, 0.f); glTexCoord2f(1.f,0.f); glVertex3f(width, 0.f, 0.f); glTexCoord2f(1.f,1.f); glVertex3f(width,height,0.f); glTexCoord2f(0.f,1.f); glVertex3f(0.f,height,0.f); glEnd(); Render FBO texture directly to screen
  • 12. • Some graphics cards have support for stereo 3D • Double buffered stereo = Quad buffered void display(void) { glDrawBuffer(GL_BACK_LEFT); <Draw left eye here> glDrawBuffer(GL_BACK_RIGHT); <Draw right eye here> glutSwapBuffers(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB | GLUT_STEREO); glutCreateWindow("stereo example"); glutDisplayFunc(display); glutMainLoop(); return 0; } Anaglyphic Model Viewer: Stereo 3D in OpenGL
  • 13. • Only professional cards (e.g. Nvidia Quadro line) support Quad Buffered rendering • If supported, rendering output is hardware and driver specific • Range of options is overwhelming • Does not extend to more than two views – This is a course on multi-view rendering! Anaglyphic Model Viewer: GLSL over Quad Buffered Stereo
  • 14. • Modes supported on Quadro cards: http://us.download.nvidia.com/XFree86/Linux-x86/275.21/README/xconfigoptions.html DDC Glasses Shutter glasses synced using monitor communication bus Blueline GlassesLength of blue line at the bottom of the frame sends image to correct LCD DIN Connector Shutter glasses synced using special video card connector Clone Mode Right and left images are shown on identically configured displays Interlaced Separate the right and left channels into even and odd scanlines Color Interleaved Separate views in color channels e.g. Sharp 3D Checkerboard Views separated in checkerboard pattern for 3D DLP Projectors NVIDIA 3D Vision NVIDIA’s own system; DIN connector with polarity sent over IR via USB tower Anaglyphic Model Viewer: Example: NVIDIA Quad Buffer Support
  • 15. Anaglyphic Model Viewer: Application Overview Main Application main.h main.cpp config.txt help.txt /models/*.obj anaglyph.h anaglyphfrag anaglyph.cpp anaglyphvert Anaglyph Interlacer Library Anaglyph Model Viewer glinfo.h glinfo.cpp OpenGL State Information Library glm.h glm.cpp GLM OBJ Model Library glf.h glf.cpp OpenGL Function Library glinclude.h OpenGL Include Files Full Color Anaglyph Mode Optimized Anaglyph Mode
  • 16. Anaglyphic Model Viewer: Examining the GLUT Display Callback main.h main.cpp config.txt help.txt /models/*.obj Anaglyph Model Viewer Main Application // Define the display function. void display(void){ . . . // Render each view. for(int i=0; i<2; i++){ // Enable FBO rendering mode. glBindFramebuffer(GL_DRAW_FRAMEBUFFER, anaglyph.FBO[i]); // Enable depth testing and lighting. glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); // Clear the color and depth buffers. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Set the projection and modelview transformations. setViewStereoscopicAnaglyph(&anaglyph, window_width, window_height, i); // Display the model. displayModel(); } // Display the stereoscopic image using the anaglyph compositor. displayAnaglyph(&anaglyph, window_width, window_height); . . . glutSwapBuffers(); }
  • 17. anaglyph.h Anaglyph.frag anaglyph.cpp Anaglyph.vert Anaglyph Interlacer Library Anaglyph Model Viewer glinfo.h glinfo.cpp OpenGL State Information Library glm.h glm.cpp GLM OBJ Model Library glf.h glf.cpp OpenGL Function Library glinclude.h OpenGL Include Files Anaglyphic Model Viewer: Examining displayAnaglyph() // Define the display function for the anaglyph compositor. void displayAnaglyph(AnaglyphCompositor* anaglyph, int window_width, int window_height){ . . . // Disable FBO rendering mode. glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); . . . // Clear the color buffer. glClear(GL_COLOR_BUFFER_BIT); // Enable the anaglyph compositor shader program. glUseProgram(anaglyph->anaglyphShader.program); // Bind FBO textures to anaglyph shader program samplers. glUniform1i(glGetUniformLocation(anaglyph->anaglyphShader.program, "leftTexture"), 0); glUniform1i(glGetUniformLocation(anaglyph->anaglyphShader.program, "rightTexture"), 1); for(int i=0; i<2; i++){ glActiveTexture(GL_TEXTURE0+i); glBindTexture(GL_TEXTURE_2D, anaglyph->viewTexture[i]); } glActiveTexture(GL_TEXTURE0); // Set the anaglyph rendering mode. glUniform1i(glGetUniformLocation( anaglyph->anaglyphShader.program, "anaglyphMode"), anaglyph->mode ); // Display the anaglyph by rendering contents of FBO to screen quad. . . . // Disable the shader program. glUseProgram(0); }
  • 18. Anaglyphic Model Viewer: Anaglyph Compositing Algorithms L R 3x3 Color Transform Matrix Pair Full Color Half Color Optimized L= R= 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 L= R= 0.299 0 0 0.587 0 0 0.114 0 0 0 0 0 0 1 0 0 0 1 L= R= 0 0 0 0.7 0 0 0.3 0 0 0 0 0 0 1 0 0 0 1 = Source: http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx
  • 19. Anaglyphic Model Viewer: GLSL Shaders for Anaglyph Compositing anaglyph.h anaglyph.frag anaglyph.cpp anaglyph.vert Anaglyph Interlacer Library Anaglyph Model Viewer Anaglyph Interlacer Library glinfo.h glinfo.cpp OpenGL State Information Library glm.h glm.cpp GLM OBJ Model Library glf.h glf.cpp OpenGL Function Library glinclude.h OpenGL Include Files /* * anaglyph.frag * Anaglyph Compositor Fragment Shader * Created by Douglas Lanman and Matthew Hirsch. * Copyright 2011. */ // Define samplers corresponding to left and right images. uniform sampler2D leftTexture; uniform sampler2D rightTexture; // Define anaglyph mode index. uniform int anaglyphMode; // Define fragment shader. void main() { // Evaluate the left and right fragment colors. vec3 leftFragColor = texture2D( leftTexture, gl_TexCoord[0].st ).rgb; vec3 rightFragColor = texture2D( rightTexture, gl_TexCoord[0].st ).rgb; // Assign the output fragment color using the // user-selected anaglyph rendering mode. mat3 L, R; R = mat3( 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); if(anaglyphMode == 2){ // Half-color anaglyph. L = mat3( 0.299, 0.0, 0.0, 0.587, 0.0, 0.0, 0.114, 0.0, 0.0); }else if(anaglyphMode == 3){ // Optimized anaglyph. L = mat3( 0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.3, 0.0, 0.0); }else{ // Full-color anaglyph. L = mat3( 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } gl_FragColor = vec4( L*leftFragColor+R*rightFragColor, 1.0 ); }
  • 20. Anaglyphic Model Viewer: Possible Extensions: Adding Eye-Tracking main.h main.cpp config.txt help.txt /models/*.obj Anaglyph Model Viewer Main Application [screen] width = 1920 height = 1080 pitch = 0.025800 [camera] x = 0.000000 y = 0.000000 z = 100.000000 near = 10.000000 far = 300.000000 separation = 6.500000 [viewer] anaglyph_mode = 1 display_help = 1 display_timer = 1 … •Camera X and Y control viewer position •Wiimote and OpenCV headtracking examples are available online Johnny Lee
  • 21.  Introduction: History and Physiology  Construction Glasses-free 3D Displays  Multi-view Rendering using OpenGL  Multi-view Interlacing using GLSL  Designing Content for Glasses-free 3D Displays  Emerging Technology  Q & A and Demonstrations Course Outline

Hinweis der Redaktion

  1. Lots of special case methods for special case hardware. The support matrix between GPU version, driver version, OS, and display hardware, is confusing.