The OpenGL® Shading Language
178 pages
English

The OpenGL® Shading Language

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
178 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

®The OpenGL Shading LanguageLanguage Version: 4.20Document Revision: 82-Sept-2011Editor: John KessenichVersion 1.1 Authors: John Kessenich, Dave Baldwin, Randi RostCopyright (c) 2008-2011 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 K hronosGroup. You may use this specification for implementing the functionality therein, without a ltering orremoving any trademark, copyright or other notice from the specification, but the receipt or pos session ofthis specification does not convey any rights to reproduce, disclose, or distribute its conte nts, or tomanufacture, use, or sell anything that it may describe, in whole or in part.Khronos Group grants express permission to any current Promoter, Contributor or Adopter me mber ofKhronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, prov ided thatNO CHARGE is made for the specification and the latest available update of the specification for anyversion of the API is used whenever possible. Such distributed specification may be re-form atted ASLONG AS the contents of the specification are not changed in any way. The specificatio n may beincorporated into a product that is sold as long ...

Informations

Publié par
Publié le 21 novembre 2011
Nombre de lectures 42
Langue English

Extrait

®The OpenGL Shading Language Language Version: 4.20 Document Revision: 8 2-Sept-2011 Editor: John Kessenich Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2011 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 K hronos Group. You may use this specification for implementing the functionality therein, without a ltering or removing any trademark, copyright or other notice from the specification, but the receipt or pos session of this specification does not convey any rights to reproduce, disclose, or distribute its conte nts, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter me mber of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, prov ided 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-form atted AS LONG AS the contents of the specification are not changed in any way. The specificatio n may be incorporated into a product that is sold as long as such product includes significant independ ent work developed by the seller. A link to the current version of this specification on the Khronos Grou p web-site should be included whenever possible with specification distributions. Khronos Group makes no, and expressly disclaims any, representations or warranties, e xpress or implied, regarding this specification, including, without limitation, any implied warranties of merc hantability or fitness for a particular purpose or non-infringement of any intellectual property. Khronos Grou p 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 conne ction with these materials. Khronos, OpenKODE, OpenKOGS, OpenVG, OpenMAX, OpenSL ES and OpenWF are trad emarks 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 Introduction....................................................................................................................... 1 .......... 1.1 Acknowledgments..................................................................................................... 2 ........... 1.2 Changes ............................................................................................................... 2 ................. 1.2.1 Summary of Changes from Version 4.10................................................ 2 ..................... 1.3 Overview............................................................................................................. 4 ................. 1.4 Error Handling .................................................................................................................... 5 .. 1.5 Typographical Conventions ..................................................................... 5 ............................ 1.6 Deprecation .................................................................................................. 5 ........................ 2 Overview of OpenGL Shading .................................................................................................... 6 2.1 Vertex Processor....................................................................................... 6 ........................... 2.2 Tessellation Control Processor 6 ...... 2.3 Tessellation Evaluation Processor.................................................................................... 7 .... 2.4 Geometry Processor................................................................................. 7 ............................ 2.5 Fragment Processor.............................................................................................. 7 ................ 3 Basics ........................................................................................................................ 8 .................. 3.1 Character Set ................................................................................................... 8 ..................... 3.2 Source Strings........................................................................................... 8 ........................... 3.3 Preprocessor 9 ..................... 3.4 Comments 14 ............................ 3.5 Tokens................................................................................................................ 15 ................ 3.6 Keywords ............................................................................................................................ 15 3.7 Identifiers 17 ............................. 3.8 Definitions ................................................................................................................. 17 ......... 3.8.1 Static Us............................................................................................................e 18 ........ 3.8.2 Uniform and Non-Uniform Control Flow .............................................. 18 .................... 3.8.3 Dynamically Uniform Expressions........................................................................... 18 .. 4 Variables and Types ........................................................................................................ 19 .......... 4.1 Basic Types................................................................................................ 19 ........................ 4.1.1 Void........................................................................................................... 23 ................. 4.1.2 Booleans ............................................................................................... 23 ...................... 4.1.3 Integers............................................................................................. 23 .......................... 4.1.4 Floats.................................................................................................. 25 ........................ 4.1.5 Vectors................................................................................................................... 26 ..... 4.1.6 Matrices .................................................................................................... 26 .................. 4.1.7 Opaque Types 26 ................ 4.1.7.1 Samplers................................................................................ 27 ............................. 4.1.7.2 Images................................................................................................... 27 .............. 4.1.7.3 Atomic Counters .................................................................................... 27 ............. 4.1.8 Structures......................................................................................................... 27 ........... 4.1.9 Arrays............................................................................................... 28 .......................... 3 4.1.10 Implicit Conversions ................................................................... 31 ............................. 4.1.11 Initializers................................................................................................. 32 ................ 4.2 Scoping......................................................................................................................... 34 ...... 4.3 Storage Qualifiers.......................................................................................................... 36 ..... 4.3.1 Default Storage Qualifie..........................................................................................r 37 .. 4.3.2 Constant Qualifier .......................................................................... 37 ............................ 4.3.3 Constant Expressions .................................................................... 37 ............................. 4.3.4 Input Variable...............................................................................s 38 ............................ 4.3.5 Uniform.............................................................................................. 40 ........................ 4.3.6 Output Variables.................................................................................................... 41 ..... 4.3.7 Interface Blocks............................................................................................ 43 .............. 4.4 Layout Qualifiers 46 ...... 4.4.1 Input Layout Qualifie...........................................................................................rs 46 .... 4.4.1.1 Tessellation Evaluation Input...................................................................s 48 ......... 4.4.1.2 Geometry Shader Input.....................................................................................s 49 . 4.4.
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents