Example: marketing

The OpenGL Shading Language - Khronos Group

The OpenGL Shading Language Language Version: Document Revision: 10. 22-Nov-2009. John Kessenich Version Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group , Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group . You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part.

Changes from revisions 6 and 7 of version 1.30 of the OpenGL Shading Language • Fix all references to the OpenGL Graphics System specification, including matching notation for texturing parameters. Changes from revision 5 of version 1.30 of the OpenGL Shading Language • Reserved superp.

Tags:

  Language, Shading, Opengl, Opengl shading language

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of The OpenGL Shading Language - Khronos Group

1 The OpenGL Shading Language Language Version: Document Revision: 10. 22-Nov-2009. John Kessenich Version Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group , Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group . You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part.

2 Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be re-formatted AS. LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group web-site should be included whenever possible with specification distributions. Khronos Group makes no, and expressly disclaims any, representations or warranties, express or implied, regarding this specification, including, without limitation, any implied warranties of merchantability or fitness for a particular purpose or non-infringement of any intellectual property.

3 Khronos Group makes no, and expressly disclaims any, warranties, express or implied, regarding the correctness, accuracy, completeness, timeliness, and reliability of the specification. Under no circumstances will the Khronos Group , or any of its Promoters, Contributors or Members or their respective partners, officers, directors, employees, agents or representatives be liable for any damages, whether direct, indirect, special or consequential damages for lost revenues, lost profits, or otherwise, arising from or in connection with these materials. Khronos , OpenKODE, OpenKOGS, OpenVG, OpenMAX, OpenSL ES and OpenWF are trademarks of the Khronos Group Inc. COLLADA is a trademark of Sony Computer Entertainment Inc. used by permission by Khronos . OpenGL and OpenML are registered trademarks and the OpenGL ES logo is a trademark of Silicon Graphics Inc. used by permission by Khronos .

4 All other product names, trademarks, and/or company names are used solely for identification and belong to their respective owners. 2. Table of Contents 1 Changes .. 1. Summary of Functionality differences from version 1. Change history of this 3. 6. Error Typographical 6. 6. 2 Overview of OpenGL Vertex 7. Fragment 7. 3 8. Character 8. Source 8. 9. 13. 13. 15. Static 16. 4 Variables and Basic 17. 19. 19. 20. 21. 22. 22. 24. Implicit 25. Storage Default Storage Constant 28. 29. 30. 3. 30. Parameter Precision and Precision 33. Range and 33. Precision 33. Default Precision 34. Available Precision Variance and the Invariant 35. The Invariant 35. Invariance of Constant 36. Order of 36. 5 Operators and 37. Array 38. Function 38. 38. Conversion and Scalar 38. Vector and Matrix 39. Structure 41. Array 42. Vector Matrix Structure and Array 44. 45. Vector and Matrix 6 Statements and Function Function Calling 55.

5 55. 7 Built-in Vertex Shader Special Fragment Shader Special 59. Vertex Shader Built-In 60. Built-In 61. Built-In Uniform 62. Built-In Vertex Output and Fragment Input 8 Built-in 67. Angle and Trigonometry 4. Exponential Common 70. Geometric 73. Matrix 75. Vector Relational Texture Lookup 77. Fragment Processing Noise 9 Shading Language 10 5. 1 Introduction This document specifies only version of the OpenGL Shading Language . It requires __VERSION__. to substitute 130, and requires #version to accept only 130. If #version is declared with 110 or 120, the Language accepted is a previous version of the Shading Language , which will be supported depending on the version and type of context in the OpenGL API. See the OpenGL Graphics System Specification, Version , for details on what Language versions are supported. Acknowledgments This specification is based on the work of those who contributed to version of the OpenGL Language Specification, the OpenGL ES Language Specification, version , and the following contributors to this version: Rob Barris Pierre Boudier Pat Brown Nick Burns Chris Dodd Michael Gold Nick Haemel James Helferty Brent Insko Jeff Juliano Jon Leech Bill Licea-Kane Barthold Lichtenbelt Daniel Koch Marc Olano Ian Romanick John Rosasco Dave Shreiner Jeremy Sandmel Robert Simpson Eskil Steenberg Changes Summary of Functionality differences from version The following is a summary of features added in version : Integer support: 1.

6 1 Introduction native signed and unsigned integers, integer vectors, and operations bitwise shifts and masking texture indices texture return values integer uniforms, vertex inputs, vertex outputs, fragment inputs, and fragment outputs built-in function support: abs, sign, min, max, clamp, .. Other texture support: Size queries. Texture arrays. Offsetting. Explicit LOD and derivative controls switch/case/default statements. New built-ins: trunc(), round(), roundEven(), isnan(), isinf(), modf(). hyperbolic trigonometric functions Preprocessor token pasting (##). User-defined fragment output variables. Shader input and output declarations via in and out. Improved compatibility with OpenGL ES. non-perspective (linear) interpolation (nosperspective). new vertex input gl_VertexID. New vertex output and fragment shader input gl_ClipDistance[]. The following is a summary of features deprecated in version : Use of the keywords attribute and varying (use in and out).

7 Use of gl_ClipVertex (use gl_ClipDistance). Use of gl_FragData and gl_FragColor (use user-defined out instead). Built-in attributes. Use user-defined vertex inputs instead. Fixed function vertex or fragment stages mixed with shader programs. Provide shaders for all active programmable pipeline stages. All built-in texture function names. See new names. Use of the built-in varyings gl_FogFragCoord and gl_TexCoord. Use user-defined variable instead. The built in function ftransform. Use the invariant qualifier on a vertex output instead. Most built-in state. 2. 1 Introduction gl_MaxVaryingFloats (use gl_MaxVaryingComponents instead). Built-in coloring: gl_FrontColor, gl_FrontSecondaryColor, gl_Color, gl_SecondaryColor, gl_BackColor and gl_BackSecondaryColor. The following is a summary of features that have been removed in version : None, only deprecations occurred in this release.

8 Change history of this revision Changes from revision and 9 of version of the OpenGL Shading Language Clarify that discard control flow exits the shader. Added the inclusion of gl_ClipDistance[] in the differences from 1,2 section. Remove accidental inclusion of textureGradOffset on samplerCubeShadow. Clarify it is generally an error to redeclare variables, including built-ins. Changes from revision and 8 of version of the OpenGL Shading Language Fix release omission: Deprecate all built-in coloring to match API deprecation and for consistency. Fix release omission: Allow precision qualifiers in structures and function declarations. Changes from revisions 6 and 7 of version of the OpenGL Shading Language Fix all references to the OpenGL Graphics System specification, including matching notation for texturing parameters. Changes from revision 5 of version of the OpenGL Shading Language Reserved superp.

9 Made it an error to specify integer literals too big for an integer variable. Increased gl_MaxVaryingComponents to 64. gl_MaxDrawBuffers to 8. gl_MaxTextureCoords to 8. Fixed some typos. Changes from revision 4 of version of the OpenGL Shading Language Updated acknowledgments; let me know if anyone is missing. Added summary lists of what's deprecated, removed, and added Deprecated fixed functionality control of a programmable stage flat is for both user and predeclared built-in in/out variables only statically used built-ins have to be redeclared as flat 3. 1 Introduction Made more clear that and shaders work, depending on state of the API. Made clear ## does macro expansion after pasting not before ftransform() is deprecated instead of removed built-in state is deprecated instead of removed highp is always present in the fragment Language , the default is highp order of qualification is either (invariant-qualifier interpolation-qualifier storage-qualifier precision-qualifier) or (storage-qualifier parameter-qualifier precision-qualifier).

10 Uint and int can be mixed for <<, >> but not for other operators combined descriptions of << and >>, and also of &, +, and ^. switch statements can be empty, must have a statement between a label and the end of the switch, allows flow control to fall through updated the minimum maximums and added gl_MaxVaryingComponents and deprecated gl_MaxVaryingFloats added gl_ClipDistance[] to the fragment side Removed #include support Removed row_major Removed common blocks OpenGL ES synchronization (a = b) is an r-value and never an l-value Updated the grammar with I have added these to the grammar switch statement case/default labels, which are mixed with other statements (needs semantic check for in switch). uint, unsigned literals, unsigned vectors 17 new sampler types new storage qualifiers in, out, centroid in, centroid out (untangled from parameter in/out/inout). interpolation qualifiers noperspective, flat, smooth precision qualifiers allowed bitwise and shift operators Changes from revision 3 of version of the OpenGL Shading Language Added deprecation section Added user-defined fragment shader outputs.


Related search queries