The OpenRT Application Programming Interface - Towards a Common API for Interactive Ray Tracing – OpenSG 2003 Darmstadt, Germany Andreas Dietrich Ingo.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

VRML Scene Graphs on an Interactive Ray Tracing Engine IEEE Virtual Reality 2004 Conference Chicago, IL USA March 30 th, 2004 Andreas Dietrich Ingo Wald.
COMPUTER GRAPHICS SOFTWARE.
Sven Woop Computer Graphics Lab Saarland University
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Graphics Pipeline.
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
1Notes  Assignment 1 is out, due October 12  Inverse Kinematics  Evaluating Catmull-Rom splines for motion curves  Wednesday: may be late (will get.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
Real-Time Ray Tracing 3D Modeling of the Future Marissa Hollingsworth Spring 2009.
1cs426-winter-2008 Notes  RenderMan resources up on the website  We will be using Pixie this term Check on the website soon (installed on CS linux.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen’s slides) Instructor: Rick Parent Credit: 4 Class: MWF 10:30.
Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
ISC/GAM 4322 ISC 6310 Multimedia Development and Programming Unit 1 Graphics Systems and Models.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
3D Visualisation of Simulation Data. Informal Seminar 08/03/2004. By Chris Sweet.
Invitation to Computer Science 5th Edition
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Computer Graphics I, Fall 2008 Introduction to Computer Graphics.
CSE 581: Interactive Computer Graphics Spring 2012, UG 4 Tuesday, Thursday – 9:00AM – 10:18AM DL 0317 Raghu Machiraju Slides: Courtesy - Prof. Huamin Wang,
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
Interactive Visualization of Exceptionally Complex Industrial CAD Datasets Andreas Dietrich Ingo Wald Philipp Slusallek Computer Graphics Group Saarland.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
A SEMINAR ON 1 CONTENT 2  The Stream Programming Model  The Stream Programming Model-II  Advantage of Stream Processor  Imagine’s.
1 Saarland University, Germany 2 DFKI Saarbrücken, Germany.
From Turing Machine to Global Illumination Chun-Fa Chang National Taiwan Normal University.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
1cs426-winter-2008 Notes. 2 Atop operation  Image 1 “atop” image 2  Assume independence of sub-pixel structure So for each final pixel, a fraction alpha.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
Photorealistic Rendering vs. Interactive 3D Graphics
Graphics Processing Unit
From Turing Machine to Global Illumination
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
Interactive Computer Graphics
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Graphics Processing Unit
Introduction to Computer Graphics
Models and Architectures
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Introduction to OpenGL
Presentation transcript:

The OpenRT Application Programming Interface - Towards a Common API for Interactive Ray Tracing – OpenSG 2003 Darmstadt, Germany Andreas Dietrich Ingo Wald Carsten Benthin Philipp Slusallek Computer Graphics Lab Saarland University

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface2 Introduction Interactive rendering performance available even on standard PCsInteractive rendering performance available even on standard PCs –Interactive systems typically limited to simple illumination models –High-quality image generation still dominated by offline rendering systems High-quality interactive rendering now possibleHigh-quality interactive rendering now possible –Ray Tracing will play a larger role in future applications –Current application programming interfaces not well suited Need for an API, which combines best of both worlds Need for an API, which combines best of both worlds

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface3 Rasterization Most of todays interactive rendering systems build on rasterization techniquesMost of todays interactive rendering systems build on rasterization techniques –Projection of polygons onto the image plane –Each polygon is processed locally without relation to any other Rasterization pipeline Rasterization pipeline Efficient hardware implementations Efficient hardware implementations Absence of global information has certain drawbacksAbsence of global information has certain drawbacks –Linear in the number of triangles –Limited to local illumination High-quality images require multiple rendering passes (e.g. to produce shadows) High-quality images require multiple rendering passes (e.g. to produce shadows) Extensive manual tuning Extensive manual tuning –Physically-accurate lighting effects are beyond the capabilities of rendering tricks even with programmable GPUs

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface4 Ray Tracing Most architectures incorporating sophisticated illumination perform ray tracingMost architectures incorporating sophisticated illumination perform ray tracing –Close modeling of physical light propagation –Shooting of imaginary rays into the scene Advantages over rasterizationAdvantages over rasterization –Physical correctness -Shooting of arbitrary rays -Accurate computation of global and advanced lighting effects (e.g. shadows, reflections, refractions on arbitrary surfaces) –Plug and play shading -Combination of different shading effects in correct order -Independent building of individual shaders –Complex scenes -Logarithmic in the number of triangles -Handling of scenes with billions of triangles -Inherent occlusion-culling, demand driven and output-sensitive

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface5 An Interactive Ray Tracing API Available rendering APIsAvailable rendering APIs –Pixars RenderMan -Oriented towards high-quality rendering, especially ray tracing -Missing support for interactive applications –OpenGL Performer, OpenInventor, OpenSG -No single candidate -Mostly used for a specific application domain –OpenGL -Flexible and popular -Too tightly coupled to the rasterization pipeline APIs for interactive ray tracing simply not yet available APIs for interactive ray tracing simply not yet available Introduction of a new API called OpenRT

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface6 OpenRT Low-level graphics interface in the spirit of OpenGLLow-level graphics interface in the spirit of OpenGL –Syntactically similar to OpenGL -Easy-to-use -Aids the porting of applications –Allows to layer scene graph APIs on top –But: Neither simple extension nor subset of OpenGL -Fundamental differences between rasterization and ray tracing Supports high-quality image generationSupports high-quality image generation –Physically-correct lighting simulations –Arbitrary programmable shading –Highly complex scenes possible Development not finalized but already used in practiceDevelopment not finalized but already used in practice –Saarland Universitys Real-Time Ray Tracing system [Wald 01] –SaarCOR hardware ray tracing architecture [Schmittler 02]

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface7 OpenRT API Structure OpenRT API actually comprises three sub-interfacesOpenRT API actually comprises three sub-interfaces –OpenRT application interface -Specify geometry objects, transformations, textures, … -Similar to OpenGL –OpenSRT programmable shader interface -Specify and load shader programs -Communication with shaders via shader parameters –OpenRTS shading language -Shader plug-in programming interface -Not used by front-end applications -Could be replaced by other shading languages (e.g. RenderMan) For many calls simply replace OpenGL´s gl with rt

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface8 OpenRT and OpenGL OpenRT and OpenGL differ in four main areas 1. Rendering semantics –Unlike OpenGLs drawing approach OpenRT uses objects –Shader objects are bound to geometry objects 2. Objects and instantiation –Geometric objects serve as simple containers –Efficient reuse of objects 3. Multi-pass rendering vs. programmable shading –Possible but not necessary due to programmable shader objects 4. Fragment and 2D operations –OpenRT serves as a pure 3D graphics library –Mix of OpenRT and OpenGL under evaluation

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface9 Application Example Framework #include #include RTint objId; void Display() { rtutSwapBuffers(); } void Idle() { static int rot = 0; rot++; static int rot = 0; rot++; rtDeleteAllInstances(); rtDeleteAllInstances(); for (int i=0; i<8; i++) { for (int i=0; i<8; i++) { int dx = (i&1)?-1:1; int dx = (i&1)?-1:1; int dy = (i&2)?-1:1; int dy = (i&2)?-1:1; int dz = (i&4)?-1:1; int dz = (i&4)?-1:1; // position individual objects // position individual objects rtTranslatef(dx,dy,dz); rtTranslatef(dx,dy,dz); rtRotatef(4*rot*dx,dz,dy,dx); rtRotatef(4*rot*dx,dz,dy,dx); rtScalef(.5,.5,.5); rtScalef(.5,.5,.5); rtInstantiateObject(objId); rtInstantiateObject(objId); } rtutPostRedisplay(); rtutPostRedisplay();} int main(int argc, char *argv[]) { rtutInit(&argc, argv); rtutInit(&argc, argv); rtutInitWindowSize(640, 480); rtutInitWindowSize(640, 480); rtutCreateWindow("Eight Cubes"); rtutCreateWindow("Eight Cubes"); rtutIdleFunc(Idle); rtutIdleFunc(Idle); rtutDisplayFunc(Display); rtutDisplayFunc(Display); objId = createColorCubeObject(); objId = createColorCubeObject(); rtPerspective(65, 1, 1, ); rtPerspective(65, 1, 1, ); rtLookAt(2,4,3, 0,0,0, 0,0,1); rtLookAt(2,4,3, 0,0,0, 0,0,1); rtutMainLoop(); rtutMainLoop(); return 0; return 0;} rtutInit(&argc, argv); rtutInitWindowSize(640, 480); rtutCreateWindow("Eight Cubes"); rtutIdleFunc(Idle);rtutDisplayFunc(Display); …rtutMainLoop(); Applications can make use of the OpenRT Utility Toolkit, RTUT Handling of windows, events, devices, … Virtually operated like OpenGLs GLUT Virtually operated like OpenGLs GLUT

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface10 Application Example Instantiation #include #include RTint objId; void Display() { rtutSwapBuffers(); } void Idle() { static int rot = 0; rot++; static int rot = 0; rot++; rtDeleteAllInstances(); rtDeleteAllInstances(); for (int i=0; i<8; i++) { for (int i=0; i<8; i++) { int dx = (i&1)?-1:1; int dx = (i&1)?-1:1; int dy = (i&2)?-1:1; int dy = (i&2)?-1:1; int dz = (i&4)?-1:1; int dz = (i&4)?-1:1; // position individual objects // position individual objects rtTranslatef(dx,dy,dz); rtTranslatef(dx,dy,dz); rtRotatef(4*rot*dx,dz,dy,dx); rtRotatef(4*rot*dx,dz,dy,dx); rtScalef(.5,.5,.5); rtScalef(.5,.5,.5); rtInstantiateObject(objId); rtInstantiateObject(objId); } rtutPostRedisplay(); rtutPostRedisplay();} int main(int argc, char *argv[]) { rtutInit(&argc, argv); rtutInit(&argc, argv); rtutInitWindowSize(640, 480); rtutInitWindowSize(640, 480); rtutCreateWindow("Eight Cubes"); rtutCreateWindow("Eight Cubes"); rtutIdleFunc(Idle); rtutIdleFunc(Idle); rtutDisplayFunc(Display); rtutDisplayFunc(Display); objId = createColorCubeObject(); objId = createColorCubeObject(); rtPerspective(65, 1, 1, ); rtPerspective(65, 1, 1, ); rtLookAt(2,4,3, 0,0,0, 0,0,1); rtLookAt(2,4,3, 0,0,0, 0,0,1); rtutMainLoop(); rtutMainLoop(); return 0; return 0;}rtDeleteAllInstances(); for (int i=0; i<8; i++) { int dx = (i&1)?-1:1; int dx = (i&1)?-1:1; int dy = (i&2)?-1:1; int dy = (i&2)?-1:1; int dz = (i&4)?-1:1; int dz = (i&4)?-1:1; // position individual objects // position individual objects rtTranslatef(dx,dy,dz); rtTranslatef(dx,dy,dz); rtRotatef(4*rot*dx,dz,dy,dx); rtRotatef(4*rot*dx,dz,dy,dx); rtScalef(.5,.5,.5); rtScalef(.5,.5,.5); rtInstantiateObject(objId); rtInstantiateObject(objId);} Objects have to be instantiated rtInstantiatedObject() rtInstantiatedObject() Instance = geometry + transformation rtTranslatef(), rtRotatef(), … rtTranslatef(), rtRotatef(), … Remove current instances using rtDeleteAllInstances() rtDeleteAllInstances()

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface11 Application Example Geometry Objects #include #include #define VERTEX_COLOR_SHADER_ID 0 #define VERTEX_COLOR_SHADERFILE_ID 1 RTint createColorCubeObject() { srtShaderFile(VERTEX_COLOR_SHADERFILE_ID, srtShaderFile(VERTEX_COLOR_SHADERFILE_ID, "VertexColor", "VertexColor", "libVertexColor.so"); "libVertexColor.so"); srtCreateShader(VERTEX_COLOR_SHADER_ID); srtCreateShader(VERTEX_COLOR_SHADER_ID); RTint objId = rtGenObjects(1); RTint objId = rtGenObjects(1); rtNewObject(objId, RT_COMPILE); rtNewObject(objId, RT_COMPILE); rtMatrixMode(RT_MODELVIEW); rtMatrixMode(RT_MODELVIEW); rtPushMatrix(); rtPushMatrix(); rtTranslatef(-1, -1, -1); rtTranslatef(-1, -1, -1); rtScalef(2, 2, 2); rtScalef(2, 2, 2); // first cube side // first cube side rtBegin(RT_POLYGON); rtBegin(RT_POLYGON); rtColor3f(0, 0, 0); rtColor3f(0, 0, 0); rtVertex3f(0, 0, 0); rtVertex3f(0, 0, 0); rtColor3f(0, 1, 0); rtColor3f(0, 1, 0); rtVertex3f(0, 1, 0); rtVertex3f(0, 1, 0); rtColor3f(1, 1, 0); rtColor3f(1, 1, 0); rtVertex3f(1, 1, 0); rtVertex3f(1, 1, 0); rtColor3f(1, 0, 0); rtColor3f(1, 0, 0); rtVertex3f(1, 0, 0); rtVertex3f(1, 0, 0); rtEnd(); rtEnd(); // other cube sides // other cube sides rtPopMatrix(); rtPopMatrix(); rtEndObject(); rtEndObject(); return objId; return objId;} RTint objId = rtGenObjects(1); rtNewObject(objId, RT_COMPILE); … rtEndObject(); Geometry objects are allocated using rtGenObjects() rtGenObjects() New object encapsulated between rtNewObject()/rtEndObject() rtNewObject()/rtEndObject() Just like OpenGLs Just like OpenGLsglGenLists()glNewList()/glEndList()

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface12 Application Example Primitives #include #include #define VERTEX_COLOR_SHADER_ID 0 #define VERTEX_COLOR_SHADERFILE_ID 1 RTint createColorCubeObject() { srtShaderFile(VERTEX_COLOR_SHADERFILE_ID, srtShaderFile(VERTEX_COLOR_SHADERFILE_ID, "VertexColor", "VertexColor", "libVertexColor.so"); "libVertexColor.so"); srtCreateShader(VERTEX_COLOR_SHADER_ID); srtCreateShader(VERTEX_COLOR_SHADER_ID); RTint objId = rtGenObjects(1); RTint objId = rtGenObjects(1); rtNewObject(objId, RT_COMPILE); rtNewObject(objId, RT_COMPILE); rtMatrixMode(RT_MODELVIEW); rtMatrixMode(RT_MODELVIEW); rtPushMatrix(); rtPushMatrix(); rtTranslatef(-1, -1, -1); rtTranslatef(-1, -1, -1); rtScalef(2, 2, 2); rtScalef(2, 2, 2); // first cube side // first cube side rtBegin(RT_POLYGON); rtBegin(RT_POLYGON); rtColor3f(0, 0, 0); rtColor3f(0, 0, 0); rtVertex3f(0, 0, 0); rtVertex3f(0, 0, 0); rtColor3f(0, 1, 0); rtColor3f(0, 1, 0); rtVertex3f(0, 1, 0); rtVertex3f(0, 1, 0); rtColor3f(1, 1, 0); rtColor3f(1, 1, 0); rtVertex3f(1, 1, 0); rtVertex3f(1, 1, 0); rtColor3f(1, 0, 0); rtColor3f(1, 0, 0); rtVertex3f(1, 0, 0); rtVertex3f(1, 0, 0); rtEnd(); rtEnd(); // other cube sides // other cube sides rtPopMatrix(); rtPopMatrix(); rtEndObject(); rtEndObject(); return objId; return objId;}rtBegin(RT_POLYGON); rtColor3f(0, 0, 0); rtColor3f(0, 0, 0); rtVertex3f(0, 0, 0); rtVertex3f(0, 0, 0); rtColor3f(0, 1, 0); rtColor3f(0, 1, 0); rtVertex3f(0, 1, 0); rtVertex3f(0, 1, 0); rtColor3f(1, 1, 0); rtColor3f(1, 1, 0); rtVertex3f(1, 1, 0); rtVertex3f(1, 1, 0); rtColor3f(1, 0, 0); rtColor3f(1, 0, 0); rtVertex3f(1, 0, 0); rtVertex3f(1, 0, 0);rtEnd(); Primitives are defined using rtBegin( primType )/rtEnd() rtBegin( primType )/rtEnd() With standard types RT_TRIANGLE, RT_POLYGON, … RT_TRIANGLE, RT_POLYGON, … Vertex data supplied by rtVertex3f(), rtColor3f(), … rtVertex3f(), rtColor3f(), …

OpenRT Video

COMPUTER GRAPHIK – UNIVERSITÄT DES SAARLANDES OpenSG 2003 The OpenRT Application Programming Interface14 Summary Ray tracing is much more powerful then rasterizationRay tracing is much more powerful then rasterization –More accurate, fully automatic, more efficient Interactive ray tracing now possibleInteractive ray tracing now possible –Need for an API that combines interactivity and high-quality image generation OpenRT can serve as such an APIOpenRT can serve as such an API –Low-level graphics interface –As easy to use as OpenGL –Supports all the advantages of interactive ray tracing –Successfully applied in practice

Questions ? For more information see