2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
23
#include "GLResource.h"
24
#include "GpuDevice.h"
25
#include "GLDeviceObjects.h"
26
#include "GLResourceManager.h"
28
#include "GLTextureResourceManager.h"
29
#include "GLVertexResourceManager.h"
30
#include "GLDeviceFrameBufferObject.h"
31
#include "GLTemplatePrimitiveBuffer.h"
32
#include "GraphicsEngine.h"
37
extern PixelFormatInfo GPixelFormats[];
38
//NObjectType IOpenGLResource::StaticObjectType(TEXT("IOpenGLResource"), 0);
39
NUX_IMPLEMENT_OBJECT_TYPE (IOpenGLResource);
42
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
44
GLSL Built-in vertex attribute (Deprecated in GLSL 1.30)
45
-------------------------------
46
Built-in vertex attribute name Incompatible aliased vertex attribute index
64
- glEnableClientState/glDisableClientState(GL_VERTEX_ARRAY); glVertexPointer(...);
67
- glEnableClientState/glDisableClientState(GL_NORMAL_ARRAY); glNormalPointer(...);
70
- glEnableClientState/glDisableClientState(GL_COLOR_ARRAY); glColorPointer(...);
71
gl_SecondaryColor (requires GL_EXT_secondary_color)
72
- glSecondaryColor3{bsifd};
73
- glEnableClientState/glDisableClientState(SECONDARY_COLOR_ARRAY_EXT); glSecondaryColorPointerEXT(...);
74
gl_FogCoord (requires GL_EXT_fog_coord)
76
- glEnableClientState/glDisableClientState(FOG_COORDINATE_ARRAY_EXT); glFogCoordPointerEXT(...);
78
- glMultiTexCoord{234fd}
79
- glClientActiveTextureARB(GL_TEXTUREXXX_ARB); glEnableClientState/glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(...);
81
GLSL Vertex Shader Special output variables (write)
82
----------------------------------------------------
83
gl_Position (must be written to)
84
gl_PointSize (may be written to)
85
gl_ClipVertex (may be written to)
87
GLSL Vertex Shader Built-in varying (write) GLSL Fragment Shader Built-in varying (read)
88
------------------------------------------- -------------------------------------------
89
varying vec4 gl_FrontColor; ----> gl_Color
90
varying vec4 gl_BackColor; ----> gl_Color
91
varying vec4 gl_FrontSecondaryColor; ----> gl_SecondaryColor
92
varying vec4 gl_BackSecondaryColor; ----> gl_SecondaryColor
93
varying vec4 gl_TexCoord[]; ----> gl_TexCoord[]
94
varying float gl_FogFragCoord; ----> gl_FogFragCoord
96
GLSL Fragment Built-in variables
97
--------------------------------
98
vec4 gl_FragCoord (read only)
99
bool gl_FrontFacing (read only)
100
vec2 gl_PointCoord (read only)
102
GLSL Fragment Shader Special output variables
103
---------------------------------------------
104
vec4 gl_FragColor (may be written to)
105
vec4 gl_FragData[gl_MaxDrawBuffers] (may be written to)
106
float gl_FragDepth (may be written to)
107
vec2 gl_PointCoord (read only)
111
Binding Semantics for Cg programs
112
Binding Semantics for Varying Input/Output Data
113
-----------------------------------------------
114
Table 23 summarizes the valid binding semantics for varying input parameters
116
One can also use TANGENT and BINORMAL instead of TEXCOORD6 and
117
TEXCOORD7. These binding semantics map to NV_vertex_program2 input
118
attribute parameters. The two sets act as aliases to each other.
120
Table 23 vp30 Varying Input Binding Semantics
121
Binding Semantics Name Corresponding Data
122
POSITION, ATTR0 Input Vertex, Generic Attribute 0
123
BLENDWEIGHT, ATTR1 Input vertex weight, Generic Attribute 1
124
NORMAL, ATTR2 Input normal, Generic Attribute 2
125
COLOR0, DIFFUSE, ATTR3 Input primary color, Generic Attribute 3
126
COLOR1, SPECULAR, ATTR4 Input secondary color, Generic Attribute 4
127
TESSFACTOR, FOGCOORD, ATTR5 Input fog coordinate, Generic Attribute 5
128
PSIZE, ATTR6 Input point size, Generic Attribute 6
129
BLENDINDICES, ATTR7 Generic Attribute 7
130
TEXCOORD0-TEXCOORD7, ATTR8-ATTR15 Input texture coordinates (texcoord0-texcoord7), Generic Attributes 8�15
131
TANGENT, ATTR14 Generic Attribute 14
132
BINORMAL, ATTR15 Generic Attribute 15
134
Table 24 summarizes the valid binding semantics for varying output parameters
135
in the vp30 profile. These binding semantics map to NV_vertex_program2 output registers. The
136
two sets act as aliases to each other.
139
Table 24 vp30 Varying Output Binding Semantics
140
Binding Semantics Name Corresponding Data
141
POSITION, HPOS Output position
142
PSIZE, PSIZ Output point size
143
FOG, FOGC Output fog coordinate
144
COLOR0, COL0 Output primary color
145
COLOR1, COL1 Output secondary color
146
BCOL0 Output backface primary color
147
BCOL1 Output backface secondary color
148
TEXCOORD0-TEXCOORD7, TEX0-TEX7 Output texture coordinates
149
CLP0-CL5 Output Clip distances