21.06.2014 Views

GLSL Spec

GLSL Spec

GLSL Spec

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table of Contents<br />

1 Introduction.................................................................................................................................1<br />

1.1 Acknowledgments................................................................................................................2<br />

1.2 Changes................................................................................................................................2<br />

1.2.1 Summary of Changes from Version 4.10.....................................................................2<br />

1.3 Overview..............................................................................................................................4<br />

1.4 Error Handling......................................................................................................................5<br />

1.5 Typographical Conventions.................................................................................................5<br />

1.6 Deprecation..........................................................................................................................5<br />

2 Overview of OpenGL Shading....................................................................................................6<br />

2.1 Vertex Processor..................................................................................................................6<br />

2.2 Tessellation Control Processor.............................................................................................6<br />

2.3 Tessellation Evaluation Processor........................................................................................7<br />

2.4 Geometry Processor.............................................................................................................7<br />

2.5 Fragment Processor..............................................................................................................7<br />

3 Basics..........................................................................................................................................8<br />

3.1 Character Set........................................................................................................................8<br />

3.2 Source Strings......................................................................................................................8<br />

3.3 Preprocessor.........................................................................................................................9<br />

3.4 Comments..........................................................................................................................14<br />

3.5 Tokens................................................................................................................................15<br />

3.6 Keywords............................................................................................................................15<br />

3.7 Identifiers...........................................................................................................................17<br />

3.8 Definitions..........................................................................................................................17<br />

3.8.1 Static Use....................................................................................................................18<br />

3.8.2 Uniform and Non-Uniform Control Flow..................................................................18<br />

3.8.3 Dynamically Uniform Expressions.............................................................................18<br />

4 Variables and Types..................................................................................................................19<br />

4.1 Basic Types........................................................................................................................19<br />

4.1.1 Void............................................................................................................................23<br />

4.1.2 Booleans.....................................................................................................................23<br />

4.1.3 Integers.......................................................................................................................23<br />

4.1.4 Floats..........................................................................................................................25<br />

4.1.5 Vectors........................................................................................................................26<br />

4.1.6 Matrices......................................................................................................................26<br />

4.1.7 Opaque Types.............................................................................................................26<br />

4.1.7.1 Samplers.............................................................................................................27<br />

4.1.7.2 Images.................................................................................................................27<br />

4.1.7.3 Atomic Counters.................................................................................................27<br />

4.1.8 Structures....................................................................................................................27<br />

4.1.9 Arrays.........................................................................................................................28<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!