Changes between Initial Version and Version 1 of dev/gfx/shader/patching


Ignore:
Timestamp:
Jun 13, 2011, 7:15:29 PM (8 years ago)
Author:
sam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • dev/gfx/shader/patching

    v1 v1  
     1= Shader Patching =
     2
     3GLSL 1.30 shaders need to be tweaked in order to work with a 1.20-only driver.
     4
     5== Version string ==
     6
     7GLSL 1.30:
     8
     9{{{
     10#!cpp
     11#version 130
     12}}}
     13
     14GLSL 1.20 or 1.10:
     15
     16{{{
     17#!cpp
     18#version 120
     19}}}
     20
     21{{{
     22#!cpp
     23#version 110
     24}}}
     25
     26== Vertex shader input values ==
     27
     28GLSL 1.30:
     29
     30{{{
     31#!cpp
     32in vec3 in_Vertex;
     33in vec2 in_MultiTexCoord0;
     34in vec4 in_Color;
     35}}}
     36
     37GLSL 1.10 or 1.20:
     38
     39 * `gl_Vertex` (implicit)
     40 * `gl_MultiTexCoord0`, `gl_MultiTexCoord1`... (implicit)
     41 * `gl_Color` (implicit)
     42
     43Solution: replace
     44
     45{{{
     46#!cpp
     47in vec3 in_Vertex;
     48}}}
     49
     50with
     51
     52{{{
     53#!cpp
     54main() {
     55    /* ... */
     56    vec3 in_Vertex = gl_Vertex;
     57}}}