Download presentation
Presentation is loading. Please wait.
Published byWarren Rogers Modified over 9 years ago
1
arb-glsl workgroup Update Bill Licea-Kane ATI Research, Inc.
2
arb-glsl workgroup OpenGL Shading Language OpenGL Shading Language OpenGL ES Shading Language –EVOLVING TOGETHER IN PARALLEL
3
arb-glsl workgroup OpenGL Shading Language #version 120 Can link shaders with mixed versions Special Variables Qualifiers Minor changes (some backward incompatible) –Names –Function Signatures –Arrays –Matrices ARB_texture_shader_lod
4
arb-glsl workgroup OpenGL Shading Language built-in fragment special variables –Based on OpenGL ES 2.0 –Values are undefined if GL_POINT_SPRITE disabled gl_PointCoord;
5
qualifier vec4 centroid varying Texcoord; arb-glsl workgroup OpenGL Shading Language
6
Names – slight changes from #version 110 –C++ like –Names hide names of all types Functions, Variables, Structures –Can declare names within a scope Exception – local functions declarations disallowed Exception – can not redeclare within a scope –Built-in functions in “outermost scope” A local name hides *ALL* outer names
7
arb-glsl workgroup OpenGL Shading Language Example #version 120 //... vec4 texture2D( sampler2D s, vec4 P ) { return vec4( 1.0, 0.0, 1.0, 1.0 ); } //... vec4 texture2D = texture2D( tex0, P.st );
8
arb-glsl workgroup OpenGL Shading Language Signature matching First try to find an exact match Else try limited implicit constructors: –int float –ivec2 vec2 –ivec3 vec3 –ivec4 vec4 If multiple implicit matches, error
9
arb-glsl workgroup OpenGL Shading Language Arrays –Now first class –==, !=, = (but must have explicit size) –Array constructors float[7]( 0.0,1.0,2.0,3.0,4.0,5.0,6.0 ) float[]( 0.0,1.0,2.0,3.0,4.0,5.0,6.0 ) float a[] = float[]( 0.0, 1.0, 2.0 );
10
arb-glsl workgroup OpenGL Shading Language Matrices –non-square permitted mat2x3 // 2 columns by 3 rows outerProduct() transpose() –Additional constructors
11
arb-glsl workgroup OpenGL Shading Language built-in functions –Based on ATI_shader_texture_lod texture2DLod( sampler2D s, vec2 P, float Lod ); texture2DGradARB( sampler2D s, vec2 P, vec2 dPdx, vec2 dPdy ); texture2DProjGradARB( sampler2D s, vec2 P, vec2 dPdx, vec2 dPdy );
14
arb-glsl workgroup Pixel grids and area operators
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.