Engenharia Informática Computação Gráfica

Size: px
Start display at page:

Download "Engenharia Informática Computação Gráfica"

Transcription

1 Computação Gráfica Engenharia Informática OpenGL Shading Language - GLSL Computação Gráfica 1

2 OpenGL Shading Language! The 'Red Book' is known to be the gold standard for OpenGL;! The 'Orange Book' is considered to be the gold standard for the OpenGL Shading Language (GLSL)! This language has been made part of the OpenGL standard as of OpenGL 2.0. OpenGL Shading Language OpenGL Shading Language (GLSL) Reference Pages https://www.opengl.org/sdk/docs/man4/index.php OpenGL Shading Language! Known as GLSL! Part of core OpenGL 2.0 and higher! Uses a C-like language! Authoring of vertex and fragment shaders! Later added geometry shaders (OpenGL 3.0) and tessellation shaders (OpenGL 4.0) 2

3 Versions and Extensions in OpenGL! OpenGL is constantly evolving! New core version updates:! 2.0, 3.0, 4.5! OpenGL also supports extensions! Using new versions and extensions! Possible using GetProcAddress API to ask driver for entry-point for new commands! OpenGL Extension Wrangler Library (GLEW)! Regularly updated to support all available OpenGL extensions and versions! Linking with GLEW keeps you from dealing with GetProcAddress hassles! Details! Link with lglew! Call glewinit() right after creating an OpenGL context! Call OpenGL new version and extension routines Credits: Mark Kilgard (CS 354), University of Texas OpenGL! OpenGL tem já várias versões! OpenGL 1.0 (1992)!! OpenGL 2.0 (2004)! introdução do GLSL!! OpenGL 3.0 (2008)! Suporte para Geometry Shader!! OpenGL 4.3 (2012) Vertex shader and fragment shader! Suporte para Tesselation Shader e Compute Shader! Melhoramentos na transferência de dados entre shaders 3

4 GLSL - Shaders! The recent trend in graphics hardware has been to replace fixed functionality with programmability in areas that have grown exceedingly complex.! Two such areas are vertex processing and fragment processing.! OpenGL provides mechanisms for compiling shaders and linking them to form executable code called a PROGRAM. A program can run on the programmable processing units (GPU) Pipeline Gráfico GPU Créditos: A. Fernandes, Univ. Minho 4

5 GLSL! The OpenGL Shading Language is a high-level procedural language.! It is part of standard OpenGL (i.e., OpenGL 2.0), the leading crossplatform, operating environment-independent API for 3D graphics.! The same language, with a small set of differences, is used for both vertex and fragment shaders.! It is based on C and C++ syntax and flow control.! It natively supports vector and matrix operations since these are inherent to many graphics algorithms.! It is stricter with types than C and C++, and functions are called by value-return.! It uses type qualifiers rather than reads and writes to manage input and output.! It imposes no practical limits to a shader's length, nor does the shader length need to be queried. Shaders! With each new generation of graphics hardware, more complex rendering techniques can be implemented as OpenGL shaders and can be used in real-time rendering applications.! OpenGL Shaders are programs that run on the GPU.! The fact that these techniques can now be implemented with hardware acceleration means that rendering performance can be increased dramatically and at the same time the CPU can be off-loaded so that it can perform other tasks. 5

6 Shaders! Here's a brief list of what s possible with OpenGL shaders:! Increasingly realistic materials metals, stone, wood, paints, and so on! Increasingly realistic lighting effects area lights, soft shadows, and so on! Natural phenomena fire, smoke, water, clouds, and so on! Advanced rendering effects global illumination, ray-tracing, and so on! Non-photorealistic materials painterly effects, pen-and-ink drawings, simulation of illustration techniques, and so on! New uses for texture memory storage of normals, gloss values, polynomial coefficients, and so on! Procedural textures dynamically generated 2D and 3D textures, not static texture images! Image processing convolution, unsharp masking, complex blending, and so on! Animation effects key frame interpolation, particle systems, procedurally defined motion! User programmable antialiasing methods! General computation sorting, mathematical modeling, fluid dynamics, and so on Vertex processor! The VERTEX PROCESSOR is a programmable unit that operates on incoming vertex values and their associated data.! The vertex processor usually performs traditional graphics operations such as the following:! Vertex transformation! Normal transformation and normalization! Texture coordinate generation! Texture coordinate transformation! Lighting! Color material application 6

7 Fragment processor! The FRAGMENT PROCESSOR is a programmable unit that operates on fragment values and their associated data.! The fragment processor usually performs traditional graphics operations such as the following:! Operations on interpolated values! Texture access! Texture application! Fog! Color sum GLSL - Language Overview! GLSL is based on the syntax of the ANSI C programming language. Programs written in this language look very much like C programs (to make the language easier to use).! The basic structure of programs written in the GLSL is the same as it is for programs written in C. The entry point of a set of shaders is the function void main();.! Constants, identifiers, operators, expressions, and statements are basically the same for the GLSL as they are for C.! Control flow for looping, if-then-else, and function calls are virtually identical to C. 7

8 GLSL - Language Overview! Addiction to C! Vector types are supported for floating-point, integer, and Boolean values.! For floating-point values, these vector types are referred to as vec2 (two floats), vec3 (three floats), and vec4 (four floats)! Floating-point matrix types are also supported as basic types.! The data type mat2 refers to a 2x2 matrix of floating-point values, mat3 refers to a 3x3 matrix, and mat4 refers to a 4x4matrix.! Columns of a matrix can be selected with array syntax.! Non-square matrices.! Samplers are a special type of opaque variable that access a particular texture map.! A variable of type sampler1d can be used to access a 1D texture map, a variable of type sampler2d can be used to access a 2D texture map, and so on. GLSL - Language Overview! Addiction to C! Qualifiers have been added to manage the input and output of shaders. The attribute, uniform, and varying qualifiers specify what type of input or output a variable serves.! Attribute variables communicate frequently changing values from the application to a vertex shader;! uniform variables communicate infrequently changing values from the application to any shader;! varying variables communicate interpolated values from a vertex shader to a fragment shader. 8

9 GLSL - Language Overview! Shaders written in the GLSL can use built-in variables that begin with the reserved prefix "gl_" in order to access existing OpenGL state and to communicate with the fixed functionality of OpenGL.! The vertex shader must write the special variable gl_position in order to provide necessary information to the fixed functionality stages between vertex processing and fragment processing.! A fragment shader typically writes into one or both of the special variables gl_fragcolor or gl_fragdepth. GLSL - Language Overview! A variety of built-in functions is also provided in the OpenGL Shading Language. The language defines built-in functions for a variety of operations:! Trigonometric operations sine, cosine, tangent, and so on! Exponential operations power, exponential, logarithm, square root, and inverse square root! Common math operations absolute value, floor, ceiling, fractional part, modulus, and so on! Geometric operations length, distance, dot product, cross product, normalization, and so on! Relational operations based on vectors component-wise operations such as greater than, less than, equal to, and so on! Specialized fragment shader functions for computing derivatives and estimating filter widths for antialiasing! Functions for accessing values in texture memory! Functions that return noise values for procedural texturing effects 9

10 GLSL - Language Overview! Addiction from C++! it supports function overloading to make it easy to define functions that differ only in the type or number of arguments being passed.! For instance, the dot product function is overloaded to deal with arguments that are types float, vec2, vec3, and vec4.! The concept of constructors also comes from C++. Initializers are done only with constructors in the GLSL.! Variables can be declared when they are needed;! The basic type bool is supported as in C++.! Functions must be declared before being used. GLSL - Language Overview! C Features not supported (not suited for GPUs)! Unlike ANSI C, the GLSL does not support automatic promotion of data types. Compiler errors are generated if variables used in an expression are of different types.! For instance, an error is generated for the statement float f = 0; but not for the statement float f = 0.0;! GLSL does not support pointers, strings, or characters.! It not support also unions, enumerated types, bit fields in structures, and bitwise operators.! It is not file based, so you won't see any #include directives or other references to file names.! goto, standard C library stuff like printf and malloc 10

11 GLSL - Language Overview! Some concepts:! The vertex shader is executed once for every vertex provided to OpenGL.! The fragment shader is executed once for every fragment (i.e., every pixel) that is produced by rasterization.! When vertex or fragment shaders are used, the corresponding fixed functionality is disabled. Shaders must implement such functionality themselves if it is desired.! Varying variables defined in a vertex shader are per-vertex values that are output from the vertex processor.! An application can communicate directly with a vertex shader in two ways:! by using attribute variables and! by using uniform variables GLSL - Language Overview! Some concepts:! Attribute variables are expected to change frequently and may be supplied by the application as often as every vertex.! Applications can pass arbitrary vertex data to a vertex shader with user-defined attribute variables. Applications can pass standard vertex attributes (color, normal, texture coordinates, position, etc.) to a vertex shader with built-in attribute variables.! An application communicates directly with a fragment shader with uniform variables.! Uniform variables are expected to change relatively infrequently (at a minimum, they are constant for an entire graphics primitive). 11

12 GLSL - Language Overview! SUMMARY! The language is based on the syntax of C; Basic structure and many keywords are the same as in C.! Vectors and matrices are included in the language as basic types.! Type qualifiers attribute, uniform, and varying are added to describe variables that manage shader I/O.! Variables of type attribute allow the communication of frequently changing values from the application to the vertex shader.! Variables of type varying are the output from a vertex shader and the input to a fragment shader.! Variables of type uniform allow the application to provide relatively infrequently changing values to both vertex shaders and fragment shaders.! The data type sampler is added for accessing textures. GLSL - Language Overview! To install and use OpenGL shaders 1. Create one or more shader objects by calling glcreateshader. 2. Provide source code for these shaders by calling glshadersource. 3. Compile each of the shaders by calling glcompileshader. 4. Create a program object by calling glcreateprogram. 5. Attach all the shader objects to the program object by calling glattachshader. 6. Link the program object by calling gllinkprogram. 7. Install the executable program as part of OpenGL's current state by calling gluseprogram. 12

13 GLSL - Implementation! GLSL is built into OpenGL drivers! The graphics driver contains an optimizing compiler for a highlevel language! Targeting a complex, dedicate processor! What could possibly go wrong?! Test your shaders on hardware from different vendors!! GLSL shaders compiled to hardware-dependent! All details are hidden from the OpenGL application programmer! Provides very little visibility into compiled result! NVIDIA s Cg Toolkit contains compiler (cgc) for Cg and GLSL code GLSL Data Types! Scalars! float a single single-precision floating-point scalar! int declares a single integer number! uint an unsigned integer! bool declares a single Boolean number! double a single double-precision floating point scalar! These declare variables, as is familiar from C/C++.! float f;! float g, h = 2.4;! int NumTextures = 4;! bool skipprocessing; 13

14 GLSL Data Types! Vectors! Vector data types built into language! Supports swizzling, masking, and operators! Swizzling/mask example: foo.zyx = foo.xxy! Operators like +, -, *, and / do component-wise operations! Also supports vector-with-scalar operations! Type names! Floating-point vectors: vec2, vec3, vec4! Integer vectors: ivec2, ivec3, ivec4! Boolean vectors: bvec2, bvec3, bvec4! Double-precision vectors: dvec2, dvec3, dvec4! Standard library support! dot, length, normalize, reflect, etc.! sin, cos, etc. GLSL Data Types! Vectors details! Special features of vectors include component access that can be done either through field selection (as with structures) or as array accesses.! vec3 position = position (1.0, 2.0, 3.0)! it can be considered as the vector (x, y, z);! position.x will select the first component of the vector.! Aggregate initializiers aren t allowed vec3 position = { 1.0, 2.0, 3.0 } 14

15 GLSL Data Types! Vectors (or Arrays)! Arrays of any type can be created.! For example, vec4 points[]; // points is an array of unknown size vec4 points[10]; // points is now an array of size vec4 points[]; // points is an array of unknown size points[2] = vec4(1.0); // points is now an array of size 2 points[7] = vec4(2.0); // points is now an array of size 7 GLSL Data Types! Vectors details! The following names are available for selecting components of vectors:! x, y, z, w Treat a vector as a position or direction! r, g, b, a Treat a vector as a color! s, t, p, q Treat a vector as a texture coordinate! vec3 position = position (1.0, 2.0, 3.0) position.z! vec3 color= color(1.0, 0.0, 0.0) color.r! vec4 texture= texture(1.0, 0.0, 0.0, 1.0) texture.t 15

16 GLSL Data Types! Vectors details vec4 v4; v4.rgba; // is a vec4 -> v4, v4.rgb; // is a vec3, v4.b; // is a float, v4.xy; // is a vec2, v4.xgba; // is illegal vec4 pos = vec4(1.0, 2.0, 3.0, 4.0); vec4 swiz = pos.wzyx; // swiz = (4.0, 3.0, 2.0, 1.0) vec4 dup = pos.xxyy; // dup = (1.0, 1.0, 2.0, 2.0) pos.xw = vec2(5.0, 6.0); // pos = (5.0, 2.0, 3.0, 6.0) pos.wx = vec2(7.0, 8.0); // pos = (8.0, 2.0, 3.0, 7.0) vec3 v, u; float f; v = u + f; v.x = u.x + f; v.y = u.y + f; v.z = u.z + f; is equivalent to vec3 v, u, w; w = v + u; is equivalent to w.x = v.x + u.x; w.y = v.y + u.y; w.z = v.z + u.z; GLSL Data Types! Vectors details! To compare two vectors! The functions: equal, notequal, lessthan,! a vector can be turned into a scalar Boolean with:! The functions: any or all.! Example: vec4 u, v;!...! if (any(lessthan(u, v)))!...! 16

17 GLSL Data Types! Matrices! Built-in types are available for matrices of floating-point numbers.! There are 2x2, 3x3, and 4x4 sizes. Non-square matrices: mat4x2, etc.! Operator * does matrix-by-vector and matrix-by-matrix multiplication! You may access a matrix as an array of column vectors! If transform is a mat4, transform[2] is the third column of transform.! The resulting type of transform[2] is vec4.! Column 0 is the first column.! transform[3][1] is the second component of the vector forming the fourth column of transform.! Just remember that the first index selects the column, not the row, and the second index selects the row. mat4 m = mat4(3.0); // initializes the diagonal to all 3.0! vec4 v;! v = m[1]; // places the vector (0.0, 3.0, 0.0, 0.0) into v! GLSL Data Types! Samplers! GLSL provides a simple opaque handle to encapsulate lookup of textures. These handles are called SAMPLERS.! The sampler types available are:! sampler1d Accesses a one-dimensional texture! sampler2d Accesses a two-dimensional texture! sampler3d Accesses a three-dimensional texture! samplercube Accesses a cube-map texture! sampler1dshadow Accesses a one-dimensional depth texture with comparison! sampler2dshadow Accesses a two-dimensional depth texture with comparison 17

18 GLSL Data Types! Samplers! For example, a sampler could be declared as uniform sampler2d Grass;! This variable can then be passed into a corresponding texture lookup function to access a texture: vec4 color = texture2d(grass, coord); where coord is a vec2 holding the two-dimensional position used to index the grass texture, and color is the result of doing the texture lookup. GLSL Data Types! Structures! GLSL provides user-defined structures similar to C.! For example, struct light { vec3 position; vec3 color; }; light ceilinglight; 18

19 GLSL Data Types! Initializers and Constructors! A shader variable may be initialized when it is declared. For example: float a, b = 3.0, c;! Constant qualified variables must be initialized. const int Size = 4; // initializer is required! Attribute, uniform, and varying variables cannot be initialized when declared. attribute float Temperature; // no initializer allowed, // the vertex API sets this uniform int Size; // no initializer allowed, // the uniform setting API sets this varying float density; // no initializer allowed, the vertex // shader must programmatically set this GLSL Data Types! Initializers and Constructors! There are constructors for all the built-in types (except samplers) as well as for structures. Some examples: vec4 v = vec4(1.0, 2.0, 3.0, 4.0); ivec2 c = ivec2(3, 4); vec3 color = vec3(0.2, 0.5, 0.8); vec4 color4 = vec4(color, 1.0) struct light { vec4 position; struct tlightcolor { vec3 color; float intensity; } lightcolor; } light1 = light(v, tlightcolor(color, 0.9)); 19

20 GLSL Data Types! Initializers and Constructors! For matrices, the components are written in column major order. For example, mat2 m = mat2(1.0, 2.0, 3.0, 4.0); vec3 v = vec3(0.6); is equivalent to vec3 v = vec3(0.6, 0.6, 0.6); //makes a 2x2 identity matrix mat2 m = mat2(1.0); is equivalent to // makes a 2 x 2 identity matrix mat2 m = mat2(1.0, 0.0, 0.0, 1.0); vec4 v = vec4(1.0); vec2 u = vec2(v); //the first two components of v initialize u GLSL Data Types! Qualifiers and Interface to a Shader! The following is the list of qualifiers:! attribute - For frequently changing information, from the application to a vertex shader;! uniform - For infrequently changing information, from the application to either a vertex shader or a fragment shader;! varying - For interpolated information passed from a vertex shader to a fragment shader;! const - For declaring nonwritable, compile-time constant variables, as in C; If no qualifier is specified when a variable (not a function parameter) is declared, the variable can be both read and written by the shader. 20

21 GLSL Data Types! Flow Control! Looping can be done with for, while, and do-while, just as in C++.! Variables can be declared in for and while statements, and their scope lasts until the end of their substatements.! The keywords break and continue also exist and behave as in C.! Selection can be done with if and if-else, just as in C++, with the exception that a variable cannot be declared in the if statement.! Selection by means of the selection operator (?:) is also available, with the extra constraint that the second and third operands must have exactly the same type.! As in C, the right-hand operand to logical and (&&) is not evaluated if the left-hand operand evaluates to false, and the right-hand operand to logical or ( ) is not evaluated if the left-hand operand evaluates to true. GLSL Data Types! Functions - Calling Conventions! To specify which parameters are copied when, prefix them with the qualifier keywords in, out, or inout.! For something that is just copied into the function but not returned, use in.! The in qualifier is also implied when no qualifiers are specified.! To say a parameter is not to be copied in but is to be set and copied back on return, use the qualifier out.! To say a parameter is copied both in and out, use the qualifier inout.! in Copy in but don't copy back out; still writable within the function! out Only copy out; readable, but undefined at entry to function! inout Copy in and copy out! The const qualifier can also be applied to function parameter (i.e. only for in). 21

22 GLSL Data Types! Qualifiers! Shaders are excepted to process inputs and write outputs! Type qualifiers identify these special variables! Vertex input qualifier: attribute! Vertex-fragment interface qualifier: varying! Shader parameters initialized by driver: uniform! out for vertex shader varying;! in for fragment shader varying One problem with GLSL is deprecation! GLSL - Other Details! C preprocessor functionality available! Has its own extension and version mechanism! Entry function must be named main()! See GLSL manual for more details. 22

23 GLSL Summary! Applications can provide data to shaders with userdefined attribute variables and user-defined uniform variables.! Standard OpenGL attributes can be accessed from within a vertex shader by means of built-in attribute variable names;! A variety of OpenGL state is accessible from either vertex shaders or fragment shaders by: uniform variables;! Vertex shaders communicate results: output variables and built-in varying variables;! Fragment shaders obtain the results from: fragment shader input variables and built-in varying variables;! Fragment shaders communicate results: output variables;! Built-in constants are accessible from within both types of shaders. Vertex Shader Inputs & Outputs Credits: Mark Kilgard (CS 354), University of Texas 23

24 Fragment Shader Ins & Outs Credits: Mark Kilgard (CS 354), University of Texas API Process for Creating GLSL Programs! Create & compile vertex & fragment shader! Attach shaders & link program Vertex Shader Program glcreateprogram glattachshader glattachshader gllinkprogram gluseprogram Credits: Mark Kilgard (CS 354), University of Texas glcreateshader glshadersource glcompileshader Fragment Shader glcreateshader glshadersource glcompileshader 24

25 Consider a Light Map Shader x = Precomputed light Surface color lit surface! Multiple two textures component-wise Credits: Mark Kilgard (CS 354), University of Texas Images from: Light Map with Fixed Function OpenGL API GLuint lightmap; GLuint surfacemap; glactivetexture(gl_texture0); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, lightmap); gltexenvi(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); glactivetexture(gl_texture1); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, surfacemap); gltexenvf(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); gldrawarrays(...); Credits: Mark Kilgard (CS 354), University of Texas 25

26 Light Map with Fixed Function OpenGL API GLuint lightmap; GLuint surfacemap; glactivetexture(gl_texture0); glenable(gl_texture_2d); Tell fixed function we are using texture mapping glbindtexture(gl_texture_2d, lightmap); gltexenvi(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); glactivetexture(gl_texture1); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, surfacemap); gltexenvf(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); gldrawarrays(...); Tell fixed function how to combine textures Credits: Mark Kilgard (CS 354), University of Texas Light Map Shader Example in GLSL! Write a fragment shader in GLSL #version 330 uniform sampler2d lightmap; uniform sampler2d surfacemap; in vec2 fs_txcoord; out vec3 out_color; void main(void) { } float intensity = texture2d(lightmap, fs_txcoord).r; vec3 color = texture2d(surfacemap, fs_txcoord).rgb; out_color = intensity * color; Credits: Mark Kilgard (CS 354), University of Texas 26

27 Light Map Shader Example in GLSL! Write a fragment shader in GLSL #version 330 uniform sampler2d lightmap; uniform sampler2d surfacemap; GLSL version 3.3 Textures (input) in vec2 fs_txcoord; out vec3 out_color; void main(void) { } Per-fragment input shader output one channel intensity float intensity = texture2d(lightmap, fs_txcoord).r; vec3 color = texture2d(surfacemap, fs_txcoord).rgb; out_color = intensity * color; three channel color modulate Credits: Mark Kilgard (CS 354), University of Texas Switching the Application to use GLSL Shaders! Recall the fixed function light map in C/C++! What code can be eliminated? GLuint lightmap; GLuint surfacemap; glactivetexture(gl_texture0); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, lightmap); gltexenvi(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); glactivetexture(gl_texture1); glenable(gl_texture_2d); glbindtexture(gl_texture_2d, surfacemap); gltexenvf(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_MODULATE); Credits: Mark Kilgard (CS 354), University of Texas 27

28 Switching the Application to use GLSL Shaders " Added code to use GLSL shaders GLuint lightmap; GLuint surfacemap; GLuint program; glactivetexture(gl_texture0); glbindtexture(gl_texture_2d, lightmap); glactivetexture(gl_texture1); glbindtexture(gl_texture_2d, surfacemap); gluseprogram(program); gldrawarray(...); Credits: Mark Kilgard (CS 354), University of Texas Careful: What s not shown! This example cuts a number of corners! The example leaves out code for! Initializing and loading the image data for the two textures! The vertex shader that outputs the varying fs_txcoord texture coordinate set! GLSL shader compilation and linking code to create the program object! Setting the sampler units of lightmap and surfacemap to point at texture units 1 and 2! Use gluniform1i for this Credits: Mark Kilgard (CS 354), University of Texas 28

Agenda. Rendering pipeline Boilerplate for minimal application Obtaining rendering context Uploading data to GPU Transformations Shaders Textures

Agenda. Rendering pipeline Boilerplate for minimal application Obtaining rendering context Uploading data to GPU Transformations Shaders Textures WebGL Agenda Rendering pipeline Boilerplate for minimal application Obtaining rendering context Uploading data to GPU Transformations Shaders Textures A bit of background! WebGL is a low-level, rendering

More information

Introduction to Computer Graphics with WebGL

Introduction to Computer Graphics with WebGL Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico 1 Programming

More information

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University GPU Generations CSE 564: Visualization GPU Programming (First Steps) Klaus Mueller Computer Science Department Stony Brook University For the labs, 4th generation is desirable Graphics Hardware Pipeline

More information

CS418 GLSL Shader Programming Tutorial (I) Shader Introduction. Presented by : Wei-Wen Feng 3/12/2008

CS418 GLSL Shader Programming Tutorial (I) Shader Introduction. Presented by : Wei-Wen Feng 3/12/2008 CS418 GLSL Shader Programming Tutorial (I) Shader Introduction Presented by : Wei-Wen Feng 3/12/2008 MP3 MP3 will be available around Spring Break Don t worry, you got two more weeks after break. Use shader

More information

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg Image Processing and Computer Graphics Rendering Pipeline Matthias Teschner Computer Science Department University of Freiburg Outline introduction rendering pipeline vertex processing primitive processing

More information

Topic 4 OpenGL 1: Background. CITS3003 Graphics & Animation. Slides: E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012

Topic 4 OpenGL 1: Background. CITS3003 Graphics & Animation. Slides: E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Programming with OpenGL Part 1: Background CITS3003 Graphics & Animation Slides: E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 1 Objectives Development of the OpenGL API

More information

Programming with OpenGL Part 1: Background. Ed Angel Professor Emeritus of Computer Science University of New Mexico

Programming with OpenGL Part 1: Background. Ed Angel Professor Emeritus of Computer Science University of New Mexico Programming with OpenGL Part 1: Background Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 Objectives Development of the OpenGL API OpenGL Architecture - OpenGL as a state machine

More information

THE OPENGL SHADING LANGUAGE 1

THE OPENGL SHADING LANGUAGE 1 THE OPENGL SHADING LANGUAGE 1 John Kessenich Dave Baldwin Randi Rost Language Version 1.10 Document Revision 59 30-April-2004 i The OpenGL Shading Language Copyright 2002-2004 3Dlabs, Inc. Ltd. This document

More information

Introduction to GPGPU. Tiziano Diamanti t.diamanti@cineca.it

Introduction to GPGPU. Tiziano Diamanti t.diamanti@cineca.it t.diamanti@cineca.it Agenda From GPUs to GPGPUs GPGPU architecture CUDA programming model Perspective projection Vectors that connect the vanishing point to every point of the 3D model will intersecate

More information

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group Shader Model 3.0 Ashu Rege NVIDIA Developer Technology Group Talk Outline Quick Intro GeForce 6 Series (NV4X family) New Vertex Shader Features Vertex Texture Fetch Longer Programs and Dynamic Flow Control

More information

OpenGL pipeline Evolution and OpenGL Shading Language (GLSL)

OpenGL pipeline Evolution and OpenGL Shading Language (GLSL) OpenGL pipeline Evolution and OpenGL Shading Language (GLSL) Part 1/3 Prateek Shrivastava CS12S008 shrvstv@cse.iitm.ac.in 1 INTRODUCTION OpenGL Shading Language (GLSL) "mini-programs" written in GLSL are

More information

OpenGL Performance Tuning

OpenGL Performance Tuning OpenGL Performance Tuning Evan Hart ATI Pipeline slides courtesy John Spitzer - NVIDIA Overview What to look for in tuning How it relates to the graphics pipeline Modern areas of interest Vertex Buffer

More information

Programming for MSc Part I

Programming for MSc Part I Herbert Martin Dietze University of Buckingham herbert@the-little-red-haired-girl.org July 24, 2001 Abstract The course introduces the C programming language and fundamental software development techniques.

More information

BHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE

BHARATHIAR UNIVERSITY: COIMBATORE CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++ LANGUAGE Certificate in Advanced Programming - C++ Language Page 1 of 7 BHARATHIAR UNIVERSITY: COIMBATORE 641046 CENTRE FOR COLLABORATION OF INDUSTRY AND INSTITUTIONS(CCII) CERTIFICATE IN ADVANCED PROGRAMMING C++

More information

OpenGL ES 2.0 Lighting 2 Per-fragment Lighting. CS421 Advanced Computer Graphics Jay Urbain, Ph.D.

OpenGL ES 2.0 Lighting 2 Per-fragment Lighting. CS421 Advanced Computer Graphics Jay Urbain, Ph.D. OpenGL ES 2.0 Lighting 2 Per-fragment Lighting CS421 Advanced Computer Graphics Jay Urbain, Ph.D. 1 Objectives Per-fragment lighting Foundation for Phong Model, textures, etc. Shader implementation in

More information

The OpenGL Shading Language

The OpenGL Shading Language The OpenGL Shading Language Language Version: 1.20 Document Revision: 8 07-Sept-2006 John Kessenich Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright 2002-2006 3Dlabs, Inc. Ltd. This

More information

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit

More information

Vertex and fragment programs

Vertex and fragment programs Vertex and fragment programs Jon Hjelmervik email: jonmi@ifi.uio.no 1 Fixed function transform and lighting Each vertex is treated separately Affine transformation transforms the vertex by matrix multiplication

More information

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm

More information

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) What is Computer Graphics (CG)? Computer

More information

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA The Evolution of Computer Graphics Tony Tamasi SVP, Content & Technology, NVIDIA Graphics Make great images intricate shapes complex optical effects seamless motion Make them fast invent clever techniques

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Chapter 2. Values, Variables, and Types. 2.1 Java Values in DrJava s Interaction Pane

Chapter 2. Values, Variables, and Types. 2.1 Java Values in DrJava s Interaction Pane 14 Chapter 2 Values, Variables, and Types In this chapter we explore the primitive building blocks that are used to develop Java programs. We experiment with the following concepts within DrJava s interactive

More information

Impact of Modern OpenGL on FPS

Impact of Modern OpenGL on FPS Impact of Modern OpenGL on FPS Jan Čejka Supervised by: Jiří Sochor Faculty of Informatics Masaryk University Brno/ Czech Republic Abstract In our work we choose several old and modern features of OpenGL

More information

The OpenGL ES Shading Language

The OpenGL ES Shading Language The OpenGL ES Shading Language Language Version: 1.00 Document Revision: 17 12 May, 2009 Editor: Robert J. Simpson (Editor, version 1.00, revisions 1-11: John Kessenich) ii Copyright (c) 2006-2009 The

More information

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007 Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Questions 2007 INSTRUCTIONS: Answer all questions. Spend approximately 1 minute per mark. Question 1 30 Marks Total

More information

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1 Welcome to GUI! Mechanics 26/02/2014 1 Requirements Info If you don t know C++, you CAN take this class additional time investment required early on GUI Java to C++ transition tutorial on course website

More information

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005 Recent Advances and Future Trends in Graphics Hardware Michael Doggett Architect November 23, 2005 Overview XBOX360 GPU : Xenos Rendering performance GPU architecture Unified shader Memory Export Texture/Vertex

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming

INDEX. C programming Page 1 of 10. 5) Function. 1) Introduction to C Programming INDEX 1) Introduction to C Programming a. What is C? b. Getting started with C 2) Data Types, Variables, Constants a. Constants, Variables and Keywords b. Types of Variables c. C Keyword d. Types of C

More information

Writing Applications for the GPU Using the RapidMind Development Platform

Writing Applications for the GPU Using the RapidMind Development Platform Writing Applications for the GPU Using the RapidMind Development Platform Contents Introduction... 1 Graphics Processing Units... 1 RapidMind Development Platform... 2 Writing RapidMind Enabled Applications...

More information

NVIDIA Corporation 2701 San Tomas Expressway Santa Clara, CA 95050 www.nvidia.com

NVIDIA Corporation 2701 San Tomas Expressway Santa Clara, CA 95050 www.nvidia.com Release 1.1 February 2003 Cg Language Toolkit ALL DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, "MATERIALS") ARE BEING PROVIDED

More information

From the Dark Side of the Moon. GPU Programming with BGFX and Eclipse. Tony McCrary, l33t labs

From the Dark Side of the Moon. GPU Programming with BGFX and Eclipse. Tony McCrary, l33t labs From the Dark Side of the Moon GPU Programming with BGFX and Eclipse Tony McCrary, l33t labs What is BGFX? Open source C/C++ GPU rendering library Developed by Branimir Karadzic Provides a way to render

More information

OpenGL ES 2.0 Lighting. CS421 Advanced Computer Graphics Jay Urbain, Ph.D.

OpenGL ES 2.0 Lighting. CS421 Advanced Computer Graphics Jay Urbain, Ph.D. OpenGL ES 2.0 Lighting CS421 Advanced Computer Graphics Jay Urbain, Ph.D. 1 Lighting effects concepts Objectives Modeling ambient and diffuse light Light sources Use lighting effects in OpenGL ES 2.0 References:

More information

GPU Shading and Rendering: Introduction & Graphics Hardware

GPU Shading and Rendering: Introduction & Graphics Hardware GPU Shading and Rendering: Introduction & Graphics Hardware Marc Olano Computer Science and Electrical Engineering University of Maryland, Baltimore County SIGGRAPH 2005 Schedule Shading Technolgy 8:30

More information

GPUs Under the Hood. Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology

GPUs Under the Hood. Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology GPUs Under the Hood Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology Bandwidth Gravity of modern computer systems The bandwidth between key components

More information

GPU Architecture Overview. John Owens UC Davis

GPU Architecture Overview. John Owens UC Davis GPU Architecture Overview John Owens UC Davis The Right-Hand Turn [H&P Figure 1.1] Why? [Architecture Reasons] ILP increasingly difficult to extract from instruction stream Control hardware dominates µprocessors

More information

6.Simple Shading Example

6.Simple Shading Example Rost.book Page 149 Tuesday, December 20, 2005 3:06 PM Chapter 6 6.Simple Shading Example Now that we ve described the OpenGL Shading Language, let s look at a simple example. In this example, we apply

More information

Tutorial 9: Skeletal Animation

Tutorial 9: Skeletal Animation Tutorial 9: Skeletal Animation Summary In the last couple of tutorials, you ve seen how to create a scene graph, and implemented a simple animating cube robot using them. You re probably wondering how

More information

SL-110: Fundamentals of Java Revision 15 October Sun Educational Services Instructor-Led Course Description

SL-110: Fundamentals of Java Revision 15 October Sun Educational Services Instructor-Led Course Description Sun Educational Services Instructor-Led Course Description Fundamentals of Java SL-110 The Fundamentals of the Java course provides students, with little or no programming experience, with the basics of

More information

Computer Graphics Hardware An Overview

Computer Graphics Hardware An Overview Computer Graphics Hardware An Overview Graphics System Monitor Input devices CPU/Memory GPU Raster Graphics System Raster: An array of picture elements Based on raster-scan TV technology The screen (and

More information

Optimizing AAA Games for Mobile Platforms

Optimizing AAA Games for Mobile Platforms Optimizing AAA Games for Mobile Platforms Niklas Smedberg Senior Engine Programmer, Epic Games Who Am I A.k.a. Smedis Epic Games, Unreal Engine 15 years in the industry 30 years of programming C64 demo

More information

#820 Computer Programming 1A

#820 Computer Programming 1A Computer Programming I Levels: 10-12 Units of Credit: 1.0 CIP Code: 11.0201 Core Code: 35-02-00-00-030 Prerequisites: Secondary Math I, Keyboarding Proficiency, Computer Literacy requirement Semester 1

More information

Shader Model 3.0, Best Practices. Phil Scott Technical Developer Relations, EMEA

Shader Model 3.0, Best Practices. Phil Scott Technical Developer Relations, EMEA Shader Model 3.0, Best Practices Phil Scott Technical Developer Relations, EMEA Overview Short Pipeline Overview CPU Bound new optimization opportunities Obscure bits of the pipeline that can trip you

More information

Introduction to Computer Graphics

Introduction to Computer Graphics Introduction to Computer Graphics Torsten Möller TASC 8021 778-782-2215 torsten@sfu.ca www.cs.sfu.ca/~torsten Today What is computer graphics? Contents of this course Syllabus Overview of course topics

More information

CS312. OpenGL basics

CS312. OpenGL basics CS312 OpenGL basics What is opengl? A low-level graphics library specification. A small set of geometric primitives: Points Lines Polygons Images Bitmaps Geometric primitives Image primitives OpenGL Libraries

More information

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith

GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series. By: Binesh Tuladhar Clay Smith GPU(Graphics Processing Unit) with a Focus on Nvidia GeForce 6 Series By: Binesh Tuladhar Clay Smith Overview History of GPU s GPU Definition Classical Graphics Pipeline Geforce 6 Series Architecture Vertex

More information

GLSL Tutorial. Introduction. OpenGL VRML W3D. Bugs. GLSL Tutorial. Home Tutorials Books Applications Tools Docs Models Textures.

GLSL Tutorial. Introduction. OpenGL VRML W3D. Bugs. GLSL Tutorial. Home Tutorials Books Applications Tools Docs Models Textures. OpenGL Shading Language @ Lighthouse 3D - http://www.lighthouse3d.com/opengl/glsl/index.php?intro 1 sur 2 25/01/2009 13:56 OpenGL VRML W3D Home Tutorials Books Applications Tools Docs Models Textures [Previous]

More information

The OpenGL R Graphics System: A Specification (Version October 22, 2004)

The OpenGL R Graphics System: A Specification (Version October 22, 2004) The OpenGL R Graphics System: A Specification () Mark Segal Kurt Akeley Editor (version 1.1): Chris Frazier Editor (versions 1.2-1.5): Jon Leech Editors (version 2.0): Jon Leech and Pat Brown Copyright

More information

The OpenGL ES Shading Language

The OpenGL ES Shading Language The OpenGL ES Shading Language Language Version: 3.10 Document Revision: 4 29 April 2015 Editor: Robert J. Simpson, Qualcomm OpenGL GLSL editor: John Kessenich, LunarG GLSL version 1.1 Authors: John Kessenich,

More information

Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

More information

OpenGL "Hello, world!"

OpenGL Hello, world! OpenGL "Hello, world!" by Ian Romanick This work is licensed under the Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) License. To view a copy of this license, (a) visit http://creativecommons.org/licenses/by-nc-sa/3.0/;

More information

14 Introduction to C++ and OpenGL

14 Introduction to C++ and OpenGL 14 14.1 Some C++ Basics Here are a few tips for programming in C++, assuming you re already familiar with Java. C++ and Java have similar syntax, but there are several significant differences in how they

More information

Programming Graphics Hardware. Randy Fernando, Cyril Zeller

Programming Graphics Hardware. Randy Fernando, Cyril Zeller Randy Fernando, Cyril Zeller Overview of the Tutorial 10:45 Introduction to the Hardware Graphics Pipeline Cyril Zeller 12:00 Lunch 14:00 High-Level Shading Languages Randy Fernando 15:15 break 15:45 GPU

More information

OpenGL R ES Common Profile Specification Version (Full Specification) (November 2, 2010) Editors (version 2.0): Aaftab Munshi, Jon Leech

OpenGL R ES Common Profile Specification Version (Full Specification) (November 2, 2010) Editors (version 2.0): Aaftab Munshi, Jon Leech OpenGL R ES Common Profile Specification Version 2.0.25 (Full Specification) (November 2, 2010) Editors (version 2.0): Aaftab Munshi, Jon Leech Copyright c 2002-2010 The Khronos Group Inc. All Rights Reserved.

More information

SYSTEMS PROGRAMMING C++ INTRODUCTION

SYSTEMS PROGRAMMING C++ INTRODUCTION Faculty of Computer Science / Institute of Systems Architecture / Operating Systems SYSTEMS PROGRAMMING C++ INTRODUCTION Alexander Warg WHY C++? C++ is the language that allows to express ideas from the

More information

Realtime 3D Computer Graphics Virtual Reality. Graphics

Realtime 3D Computer Graphics Virtual Reality. Graphics Realtime 3D Computer Graphics Virtual Reality Graphics Computer graphics 3D-Computer graphics (3D-CG) currently used for Simulators, VR, Games (real-time) Design (CAD) Entertainment (Movies), Art Education

More information

Java (12 Weeks) Introduction to Java Programming Language

Java (12 Weeks) Introduction to Java Programming Language Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short

More information

El Dorado Union High School District Educational Services

El Dorado Union High School District Educational Services El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.

More information

1 GOALS AND PROCESS FOR DESIGNING A LANGUAGE

1 GOALS AND PROCESS FOR DESIGNING A LANGUAGE CS 342 Lecture 2 Designing a Programming Language By: Hridesh Rajan 1 GOALS AND PROCESS FOR DESIGNING A LANGUAGE 1.1 Simplicity Useful especially eases parsing the input and the language implementation.

More information

The GPU as a high performance computational resource

The GPU as a high performance computational resource The GPU as a high performance computational resource Tor Dokken SINTEF ICT, Applied Mathematics P.O. Box 124 Blindern 0314 Oslo, Norway Phone: +47 22 06 73 00 tor.dokken@sintef.no Trond R. Hagen SINTEF

More information

Lecture Notes, CEng 477

Lecture Notes, CEng 477 Computer Graphics Hardware and Software Lecture Notes, CEng 477 What is Computer Graphics? Different things in different contexts: pictures, scenes that are generated by a computer. tools used to make

More information

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

More information

Soft Edges and Burning Things: Enhanced Real-Time Rendering of Particle Systems

Soft Edges and Burning Things: Enhanced Real-Time Rendering of Particle Systems Soft Edges and Burning Things: Enhanced Real-Time Rendering of Particle Systems Tommi Ilmonen Tapio Takala Juha Laitinen Helsinki Univ. of Technology Helsinki Univ. of Technology Helsinki Univ. of Technology

More information

THE OPENGL SHADING LANGUAGE 1

THE OPENGL SHADING LANGUAGE 1 THE OPENGL SHADING LANGUAGE 1 John Kessenich Dave Baldwin Randi Rost Language Version 1.10 Document Revision 59 30-April-2004 i The OpenGL Shading Language Copyright 2002-2004 3Dlabs, Inc. Ltd. This document

More information

Introduction to. the open graphics library for embedded systems

Introduction to. the open graphics library for embedded systems Introduction to the open graphics library for embedded systems PRESENTATION TOPICS Introduction to OpenGL ES Spaces and Transformations Drawing Geometry Colors Textures Android Fragmentation OpenGL ES

More information

Programmable graphics pipeline. Adapted from Suresh Venkatasubramanian UPenn

Programmable graphics pipeline. Adapted from Suresh Venkatasubramanian UPenn Programmable graphics pipeline Adapted from Suresh Venkatasubramanian UPenn Lecture Outline A historical perspective on the graphics pipeline Dimensions of innovation. Where we are today Fixed-function

More information

Last week. Angel/Shreiner/Möller 1

Last week. Angel/Shreiner/Möller 1 Last week 1 Overview of a graphics system Output device Input devices Image formed and stored in frame buffer Machiraju/Zhang/Möller 2 Cmpt 361 Torsten Möller Ray tracing: the algorithm for each pixel

More information

We have learnt that the order of how we draw objects in 3D can have an influence on how the final image looks

We have learnt that the order of how we draw objects in 3D can have an influence on how the final image looks Review: Last Week We have learnt that the order of how we draw objects in 3D can have an influence on how the final image looks Depth-sort Z-buffer Transparency Orientation of triangle (order of vertices)

More information

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA GFLOPS 3500 3000 NVPRO-PIPELINE Peak Double Precision FLOPS GPU perf improved

More information

Lecture 6: Polygon rendering and OpenGL

Lecture 6: Polygon rendering and OpenGL Lecture 6: Polygon rendering and OpenGL 3-Dimensional Objects Bounded by Planar Surfaces (Facets) Y 4 8 Z 5 6 1 2 3 7 X NUMERICAL TOPOLOGICAL DATA DATA Points Lines Faces 1. [0,0,0] 1. 1>>2 1,2,4,4 2.

More information

Developer Tools. Tim Purcell NVIDIA

Developer Tools. Tim Purcell NVIDIA Developer Tools Tim Purcell NVIDIA Programming Soap Box Successful programming systems require at least three tools High level language compiler Cg, HLSL, GLSL, RTSL, Brook Debugger Profiler Debugging

More information

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER RAMA HOETZLEIN, DEVELOPER TECHNOLOGY, NVIDIA Data Visualizations assist humans with data analysis by representing information

More information

C++ Keywords. If/else Selection Structure. Looping Control Structures. Switch Statements. Example Program

C++ Keywords. If/else Selection Structure. Looping Control Structures. Switch Statements. Example Program C++ Keywords There are many keywords in C++ that are not used in other languages. bool, const_cast, delete, dynamic_cast, const, enum, extern, register, sizeof, typedef, explicit, friend, inline, mutable,

More information

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries First Semester Development 1A On completion of this subject students will be able to apply basic programming and problem solving skills in a 3 rd generation object-oriented programming language (such as

More information

Chapter 2 GRAPHICAL PROCESSING UNITS. 2.1 Overview

Chapter 2 GRAPHICAL PROCESSING UNITS. 2.1 Overview Chapter 2 GRAPHICAL PROCESSING UNITS 2.1 Overview Knowledge of the operations supported by GPUs and how data is processed in GPUs is necessary in order to understand how GPUs can be leveraged for cryptographic

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement? 1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

More information

INTRODUCTION TO RENDERING TECHNIQUES

INTRODUCTION TO RENDERING TECHNIQUES INTRODUCTION TO RENDERING TECHNIQUES 22 Mar. 212 Yanir Kleiman What is 3D Graphics? Why 3D? Draw one frame at a time Model only once X 24 frames per second Color / texture only once 15, frames for a feature

More information

JAVA PRIMITIVE DATA TYPE

JAVA PRIMITIVE DATA TYPE JAVA PRIMITIVE DATA TYPE Description Not everything in Java is an object. There is a special group of data types (also known as primitive types) that will be used quite often in programming. For performance

More information

QCD as a Video Game?

QCD as a Video Game? QCD as a Video Game? Sándor D. Katz Eötvös University Budapest in collaboration with Győző Egri, Zoltán Fodor, Christian Hoelbling Dániel Nógrádi, Kálmán Szabó Outline 1. Introduction 2. GPU architecture

More information

PIC Microcontrollers The basics of C programming language

PIC Microcontrollers The basics of C programming language Page 1 / 28 Page 2 / 28 Table of contents PROGRAMMING LANGUAGES...3 ADVANTAGES OF HIGHER PROGRAMMING LANGUAGES...6 PREPROCESSOR... 6 PREPROCESSOR DIRECTIVE # include... 7 PREPROCESSOR DIRECTIVE # define...7

More information

Computer Graphics (CS 543) Lecture 1 (Part 2): Introduction to OpenGL/GLUT (Part 1)

Computer Graphics (CS 543) Lecture 1 (Part 2): Introduction to OpenGL/GLUT (Part 1) Computer Graphics (CS 543) Lecture 1 (Part 2): Introduction to OpenGL/GLUT (Part 1) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: OpenGL/GLUT Basics OpenGL s function

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

ENGINEERING PROBLEM SOLVING WITH C++

ENGINEERING PROBLEM SOLVING WITH C++ ENGINEERING PROBLEM SOLVING WITH C++ Third Edition Delores M. Etter Electrical Engineering Department Southern Methodist University, Dallas, TX Jeanine A. Ingber Accurate Solutions in Applied Physics,

More information

OpenGL Shading Language Course. Chapter 5 Appendix. By Jacobo Rodriguez Villar jacobo.rodriguez@typhoonlabs.com

OpenGL Shading Language Course. Chapter 5 Appendix. By Jacobo Rodriguez Villar jacobo.rodriguez@typhoonlabs.com OpenGL Shading Language Course Chapter 5 Appendix By Jacobo Rodriguez Villar jacobo.rodriguez@typhoonlabs.com TyphoonLabs GLSL Course 1/1 APPENDIX INDEX Using GLSL Shaders Within OpenGL Applications 2

More information

Vector Math Computer Graphics Scott D. Anderson

Vector Math Computer Graphics Scott D. Anderson Vector Math Computer Graphics Scott D. Anderson 1 Dot Product The notation v w means the dot product or scalar product or inner product of two vectors, v and w. In abstract mathematics, we can talk about

More information

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS ICCVG 2002 Zakopane, 25-29 Sept. 2002 Rafal Mantiuk (1,2), Sumanta Pattanaik (1), Karol Myszkowski (3) (1) University of Central Florida, USA, (2) Technical University of Szczecin, Poland, (3) Max- Planck-Institut

More information

3D Augmented Reality Mobile Application Prototype for Visual Planning Support

3D Augmented Reality Mobile Application Prototype for Visual Planning Support 3D Augmented Reality Mobile Application Prototype for Visual Planning Support Arnau Fombuena Valero Master s of Science Thesis in Geoinformatics TRITA-GIT EX 11-010 School of Architecture and the Built

More information

UTILIZING GPUS ON CLUSTER COMPUTERS

UTILIZING GPUS ON CLUSTER COMPUTERS UTILIZING GPUS ON CLUSTER COMPUTERS PROJECT WORK IN TDT4715 ALGORITHM CONSTRUCTION AND VISUALIZATION, DEPTH STUDY FALL 2006 LEIF CHRISTIAN LARSEN MAIN SUPERVISOR: DR. ANNE CATHRINE ELSTER CO-SUPERVISOR:

More information

Rendering Pipeline, Shaders, and Effects

Rendering Pipeline, Shaders, and Effects CHAPTER 9 Rendering Pipeline, Shaders, and Effects In this chapter, you ll learn some of the concepts related to the rendering pipeline, shaders, and effects. The rendering pipeline is responsible for

More information

Image Synthesis. Transparency. computer graphics & visualization

Image Synthesis. Transparency. computer graphics & visualization Image Synthesis Transparency Inter-Object realism Covers different kinds of interactions between objects Increasing realism in the scene Relationships between objects easier to understand Shadows, Reflections,

More information

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch. CSCI 480 Computer Graphics Lecture 1 Course Overview January 14, 2013 Jernej Barbic University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s13/ Administrative Issues Modeling Animation

More information

White Paper. Cloth Simulation. February 2007 WP-03018-001_v01

White Paper. Cloth Simulation. February 2007 WP-03018-001_v01 White Paper Cloth Simulation February 2007 WP-03018-001_v01 White Paper Document Change History Version Date Responsible Reason for Change _v01 CZ, TS Initial release Go to sdkfeedback@nvidia.com to provide

More information

C Programming Language CIS 218

C Programming Language CIS 218 C Programming Language CIS 218 Description C is a procedural languages designed to provide lowlevel access to computer system resources, provide language constructs that map efficiently to machine instructions,

More information

The Future Of Animation Is Games

The Future Of Animation Is Games The Future Of Animation Is Games 王 銓 彰 Next Media Animation, Media Lab, Director cwang@1-apple.com.tw The Graphics Hardware Revolution ( 繪 圖 硬 體 革 命 ) : GPU-based Graphics Hardware Multi-core (20 Cores

More information

The OpenGL Shading Language

The OpenGL Shading Language The OpenGL Shading Language Language Version: 4.10 Document Revision: 6 24-Jul-2010 Editor: John Kessenich, Intel Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2010 The

More information

Shader Programming: What s Next? Tim Foley

Shader Programming: What s Next? Tim Foley Shader Programming: What s Next? Tim Foley An interesting time in graphics programming Many platforms, and even more APIs Vulkan 1.0 released just weeks ago Still programming shaders like it s 2002 Author

More information

Shading with Shaders. Computer Graphics, VT 2015 Lecture 6

Shading with Shaders. Computer Graphics, VT 2015 Lecture 6 Shading with Shaders Computer Graphics, VT 2015 Lecture 6 Johan Nysjö Centre for Image analysis Swedish University of Agricultural Sciences Uppsala University Today's topics Shading in modern OpenGL Per-vertex

More information