Example: biology

The OpenGL Shading Language - Khronos Group

The OpenGL Shading Language Language Version: Document Revision: 6. 11-Mar-2010. Editor: John Kessenich, Intel Version Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2010 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.

grammar in section 9 “Shading Language Grammar” uses all capitals for terminals and lower case for non-terminals. 1.6 Deprecation Previous versions of the OpenGL Shading Language deprecated some features. These are clearly called out in this specification as “deprecated”. They are still present in this version of the language, but are

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: 6. 11-Mar-2010. Editor: John Kessenich, Intel Version Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2010 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.

3 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. 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.

4 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 . 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 Changes from Version 1. 2. Error Typographical 2. 2. 2 Overview of OpenGL Vertex 3. Geometry 3. Fragment 3. 3 5. Character 5. Source 5. 6. 11. 12. 14. Static 14. 4 Variables and Basic 15. 18. 18. 18. 20. 21. 21. 23. Implicit 25. Storage Default Storage Constant 28.

5 Constant 28. 29. 30. 3. 31. Interface 32. Layout 35. Input Layout 35. Output Layout 38. Uniform Block Layout 39. Redeclaring Built-in Interpolation Variables in the Compatibility Parameter Precision and Precision 43. Range and 43. Precision 43. Default Precision 43. Available Precision Variance and the Invariant 44. The Invariant 45. Invariance of Constant 46. Order of 46. 5 Operators and 47. Array 48. Function 48. 48. Conversion and Scalar 48. Vector and Matrix 49. Structure 51. Array 52. Vector Matrix Structure and Array 55. 56. Vector and Matrix 6 Statements and Function Function Calling 65. 66. 7 Built-in Vertex and Geometry Shader Special 68. Compatibility Profile Vertex and Geometry Shader Special 70. 4. Fragment Shader Special 71.

6 Compatibility Profile Vertex Shader Built-In 73. Built-In 73. Compatibility Profile Built-In Built-In Uniform 74. Compatibility Profile 74. Compatibility Profile Vertex and Fragment 8 Built-in 80. Angle and Trigonometry Exponential Common 83. Geometric 86. Matrix 88. Vector Relational Texture Lookup 90. Fragment Processing Noise Geometry Shader 103. 9 Shading Language 5. 1 Introduction This document specifies only version of the OpenGL Shading Language . It requires __VERSION__. to substitute 330, and requires #version to accept only 330. If #version is declared with a smaller number, 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.

7 See the OpenGL Graphics System Specification, Version , for details on what Language versions are supported. All OpenGL Graphics System Specification references in this specification are to version Acknowledgments This specification is based on the work of those who contributed to past versions of the OpenGL . Language Specification, the OpenGL ES Language Specification, and the following contributors to this version: Pat Brown, Nvidia Jeff Boltz, Nvidia Piers Daniell, Nvidia Chris Dodd, Nvidia Nick Haemel, AMD. Jon Leech Bill Licea-Kane, AMD. Barthold Lichtenbelt, Nvidia Bruce Merry, ARM. Daniel Koch, Transgaming Ian Romanick, Intel Greg Roth, Nvidia Graham Sellers, AMD. Dave Shreiner, ARM. Jeremy Sandmel, Apple Robert Simpson, Qualcomm Changes Summary of Changes from Version Note: No features were removed or deprecated between versions and Added Appendix A to describe include tree and path semantics/syntax for both the Language and the API specifications.

8 Add ARB_explicit_attrib_location extension: Layout qualifiers can declare the location of vertex shader inputs. 1. 1 Introduction Layout qualifiers can declare the location of fragment shader outputs. Add ARB_shader_bit_encoding extension: Floating-point variables within a shader are encoded according to IEEE 754. Add built-in functions converting floating-point values to and from signed or unsigned integers representing their encoding. Change #line behavior: The number provided is the number of the next line of code, not the current line. This makes it match C++ semantics. Clarify that the second component of P is unused for 1D shadow lookups. Overview This document describes The OpenGL Shading Language , version Independent compilation units written in this Language are called shaders.

9 A program is a complete set of shaders that are compiled and linked together. The aim of this document is to thoroughly specify the programming Language . The OpenGL Graphics System Specification will specify the OpenGL entry points used to manipulate and communicate with programs and shaders. Error Handling Compilers, in general, accept programs that are ill-formed, due to the impossibility of detecting all ill- formed programs. Portability is only ensured for well-formed programs, which this specification describes. Compilers are encouraged to detect ill-formed programs and issue diagnostic messages, but are not required to do so for all cases. Compilers are required to return messages regarding lexically, grammatically, or semantically incorrect shaders.

10 Typographical Conventions Italic, bold, and font choices have been used in this specification primarily to improve readability. Code fragments use a fixed width font. Identifiers embedded in text are italicized. Keywords embedded in text are bold. Operators are called by their name, followed by their symbol in bold in parentheses. The clarifying grammar fragments in the text use bold for literals and italics for non-terminals. The official grammar in section 9 Shading Language Grammar uses all capitals for terminals and lower case for non-terminals. Deprecation Previous versions of the OpenGL Shading Language deprecated some features. These are clearly called out in this specification as deprecated . They are still present in this version of the Language , but are targeted for potential removal in a future version of the Shading Language .


Related search queries