~thumper/nux/next-changes

« back to all changes in this revision

Viewing changes to NuxGraphics/Readme.txt

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 21:15:42 UTC
  • Revision ID: neil.patel@canonical.com-20100901211542-cw2ce3ak28unouwb
Add NuxGraphics with licensing

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
Using GLSL texture:
 
3
-------------------
 
4
        // Get the sampler uniform location.
 
5
        GLint BumpMapLoc = glGetUniformLocationARB(prog, "BumpTex"); 
 
6
 
 
7
        // Bind the texture to texture unit i.
 
8
        glActiveTexture(GL_TEXTURE0 + i);
 
9
        glBindTexture(GL_TEXTURE_2D, texture_gl_object_id);
 
10
 
 
11
        // Pass i as an integer by glUniform. 
 
12
        glUniform1iARB(BumpMapLoc, i);
 
13
 
 
14
 
 
15
GLSL Built-in vertex attribute (Deprecated in GLSL 1.30)
 
16
-------------------------------
 
17
    Built-in vertex attribute name      Incompatible aliased vertex attribute index
 
18
    gl_Vertex                           0
 
19
    gl_Normal                           2
 
20
    gl_Color                            3
 
21
    gl_SecondaryColor                   4
 
22
    gl_FogCoord                         5
 
23
    gl_MultiTexCoord0                   8
 
24
    gl_MultiTexCoord1                   9
 
25
    gl_MultiTexCoord2                   10
 
26
    gl_MultiTexCoord3                   11
 
27
    gl_MultiTexCoord4                   12
 
28
    gl_MultiTexCoord5                   13
 
29
    gl_MultiTexCoord6                   14
 
30
    gl_MultiTexCoord7                   15
 
31
 
 
32
 
 
33
    gl_Vertex:
 
34
        - glVertex{234sifd}
 
35
        - glEnableClientState/glDisableClientState(GL_VERTEX_ARRAY); glVertexPointer(...);
 
36
    gl_Normal:
 
37
        - glNormal{3sifd}
 
38
        - glEnableClientState/glDisableClientState(GL_NORMAL_ARRAY); glNormalPointer(...);
 
39
    gl_Color:
 
40
        - glColor{34sifd}
 
41
        - glEnableClientState/glDisableClientState(GL_COLOR_ARRAY); glColorPointer(...);
 
42
    gl_SecondaryColor (requires GL_EXT_secondary_color)
 
43
        - glSecondaryColor3{bsifd};
 
44
        - glEnableClientState/glDisableClientState(SECONDARY_COLOR_ARRAY_EXT); glSecondaryColorPointerEXT(...);
 
45
    gl_FogCoord (requires GL_EXT_fog_coord)
 
46
        - glFogCoord{fd};
 
47
        - glEnableClientState/glDisableClientState(FOG_COORDINATE_ARRAY_EXT); glFogCoordPointerEXT(...);
 
48
    gl_MultiTexCoordXXX
 
49
        - glMultiTexCoord{234fd}
 
50
        - glClientActiveTextureARB(GL_TEXTUREXXX_ARB); glEnableClientState/glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(...);
 
51
 
 
52
GLSL Vertex Shader Special output variables (write)
 
53
----------------------------------------------------
 
54
    gl_Position     (must be written to)
 
55
    gl_PointSize    (may be written to)
 
56
    gl_ClipVertex   (may be written to)
 
57
 
 
58
GLSL Vertex Shader Built-in varying (write)                     GLSL Fragment Shader Built-in varying (read)
 
59
-------------------------------------------                     -------------------------------------------
 
60
    varying vec4    gl_FrontColor;                     ---->    gl_Color
 
61
    varying vec4    gl_BackColor;                      ---->    gl_Color
 
62
    varying vec4    gl_FrontSecondaryColor;            ---->    gl_SecondaryColor
 
63
    varying vec4    gl_BackSecondaryColor;             ---->    gl_SecondaryColor
 
64
    varying vec4    gl_TexCoord[];                     ---->    gl_TexCoord[]
 
65
    varying float   gl_FogFragCoord;                   ---->    gl_FogFragCoord
 
66
 
 
67
GLSL Fragment Built-in variables
 
68
--------------------------------
 
69
    vec4    gl_FragCoord    (read only)
 
70
    bool    gl_FrontFacing  (read only)
 
71
    vec2    gl_PointCoord   (read only)
 
72
 
 
73
GLSL Fragment Shader Special output variables
 
74
---------------------------------------------
 
75
    vec4    gl_FragColor    (may be written to)
 
76
    vec4    gl_FragData[gl_MaxDrawBuffers]  (may be written to)
 
77
    float   gl_FragDepth    (may be written to)
 
78
    vec2    gl_PointCoord   (read only)
 
79
 
 
80
 
 
81
 
 
82
Binding Semantics for Cg programs
 
83
Binding Semantics for Varying Input/Output Data
 
84
-----------------------------------------------
 
85
    Table 23 summarizes the valid binding semantics for varying input parameters
 
86
    in the vp30 profile.
 
87
        One can also use TANGENT and BINORMAL instead of TEXCOORD6 and
 
88
        TEXCOORD7. These binding semantics map to NV_vertex_program2 input
 
89
        attribute parameters. The two sets act as aliases to each other.
 
90
    
 
91
    Table 23 vp30 Varying Input Binding Semantics
 
92
                Binding Semantics                           Name Corresponding Data
 
93
                POSITION, ATTR0                             Input Vertex, Generic Attribute 0
 
94
                BLENDWEIGHT, ATTR1                          Input vertex weight, Generic Attribute 1
 
95
                NORMAL, ATTR2                               Input normal, Generic Attribute 2
 
96
                COLOR0, DIFFUSE, ATTR3                      Input primary color, Generic Attribute 3
 
97
                COLOR1, SPECULAR, ATTR4                     Input secondary color, Generic Attribute 4
 
98
                TESSFACTOR, FOGCOORD, ATTR5                 Input fog coordinate, Generic Attribute 5
 
99
                PSIZE, ATTR6                                Input point size, Generic Attribute 6
 
100
                BLENDINDICES, ATTR7                         Generic Attribute 7
 
101
                TEXCOORD0-TEXCOORD7, ATTR8-ATTR15           Input texture coordinates (texcoord0-texcoord7), Generic Attributes 8�15
 
102
                TANGENT, ATTR14                             Generic Attribute 14
 
103
                BINORMAL, ATTR15                            Generic Attribute 15
 
104
 
 
105
    Table 24 summarizes the valid binding semantics for varying output parameters
 
106
    in the vp30 profile. These binding semantics map to NV_vertex_program2 output registers. The
 
107
    two sets act as aliases to each other.
 
108
        
 
109
 
 
110
    Table 24 vp30 Varying Output Binding Semantics
 
111
                Binding Semantics                           Name Corresponding Data
 
112
                POSITION, HPOS                              Output position
 
113
                PSIZE, PSIZ                                 Output point size
 
114
                FOG, FOGC                                   Output fog coordinate
 
115
                COLOR0, COL0                                Output primary color
 
116
                COLOR1, COL1                                Output secondary color
 
117
                BCOL0                                       Output backface primary color
 
118
                BCOL1                                       Output backface secondary color
 
119
                TEXCOORD0-TEXCOORD7, TEX0-TEX7              Output texture coordinates
 
120
                CLP0-CL5                                    Output Clip distances
 
121
 
 
122
 
 
123
Using NVidia CG texture:
 
124
------------------------
 
125
    CGparameter BumpMapParam = cgGetNamedParameter(cgprog, "BumpTexture");
 
126
        cgGLSetTextureParameter(BumpMapParam, texture_gl_object_id);
 
127
    cgGLEnableTextureParameter(BumpMapParam);
 
 
b'\\ No newline at end of file'