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 "GLDeviceFactory.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 "OpenGLEngine.h"
36
extern PixelFormatInfo GPixelFormats[];
37
//NObjectType IOpenGLResource::StaticObjectType(TEXT("IOpenGLResource"), 0);
38
IMPLEMENT_ROOT_OBJECT_TYPE(IOpenGLResource);
41
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
43
GLSL Built-in vertex attribute (Deprecated in GLSL 1.30)
44
-------------------------------
45
Built-in vertex attribute name Incompatible aliased vertex attribute index
63
- glEnableClientState/glDisableClientState(GL_VERTEX_ARRAY); glVertexPointer(...);
66
- glEnableClientState/glDisableClientState(GL_NORMAL_ARRAY); glNormalPointer(...);
69
- glEnableClientState/glDisableClientState(GL_COLOR_ARRAY); glColorPointer(...);
70
gl_SecondaryColor (requires GL_EXT_secondary_color)
71
- glSecondaryColor3{bsifd};
72
- glEnableClientState/glDisableClientState(SECONDARY_COLOR_ARRAY_EXT); glSecondaryColorPointerEXT(...);
73
gl_FogCoord (requires GL_EXT_fog_coord)
75
- glEnableClientState/glDisableClientState(FOG_COORDINATE_ARRAY_EXT); glFogCoordPointerEXT(...);
77
- glMultiTexCoord{234fd}
78
- glClientActiveTextureARB(GL_TEXTUREXXX_ARB); glEnableClientState/glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(...);
80
GLSL Vertex Shader Special output variables (write)
81
----------------------------------------------------
82
gl_Position (must be written to)
83
gl_PointSize (may be written to)
84
gl_ClipVertex (may be written to)
86
GLSL Vertex Shader Built-in varying (write) GLSL Fragment Shader Built-in varying (read)
87
------------------------------------------- -------------------------------------------
88
varying vec4 gl_FrontColor; ----> gl_Color
89
varying vec4 gl_BackColor; ----> gl_Color
90
varying vec4 gl_FrontSecondaryColor; ----> gl_SecondaryColor
91
varying vec4 gl_BackSecondaryColor; ----> gl_SecondaryColor
92
varying vec4 gl_TexCoord[]; ----> gl_TexCoord[]
93
varying float gl_FogFragCoord; ----> gl_FogFragCoord
95
GLSL Fragment Built-in variables
96
--------------------------------
97
vec4 gl_FragCoord (read only)
98
bool gl_FrontFacing (read only)
99
vec2 gl_PointCoord (read only)
101
GLSL Fragment Shader Special output variables
102
---------------------------------------------
103
vec4 gl_FragColor (may be written to)
104
vec4 gl_FragData[gl_MaxDrawBuffers] (may be written to)
105
float gl_FragDepth (may be written to)
106
vec2 gl_PointCoord (read only)
110
Binding Semantics for Cg programs
111
Binding Semantics for Varying Input/Output Data
112
-----------------------------------------------
113
Table 23 summarizes the valid binding semantics for varying input parameters
115
One can also use TANGENT and BINORMAL instead of TEXCOORD6 and
116
TEXCOORD7. These binding semantics map to NV_vertex_program2 input
117
attribute parameters. The two sets act as aliases to each other.
119
Table 23 vp30 Varying Input Binding Semantics
120
Binding Semantics Name Corresponding Data
121
POSITION, ATTR0 Input Vertex, Generic Attribute 0
122
BLENDWEIGHT, ATTR1 Input vertex weight, Generic Attribute 1
123
NORMAL, ATTR2 Input normal, Generic Attribute 2
124
COLOR0, DIFFUSE, ATTR3 Input primary color, Generic Attribute 3
125
COLOR1, SPECULAR, ATTR4 Input secondary color, Generic Attribute 4
126
TESSFACTOR, FOGCOORD, ATTR5 Input fog coordinate, Generic Attribute 5
127
PSIZE, ATTR6 Input point size, Generic Attribute 6
128
BLENDINDICES, ATTR7 Generic Attribute 7
129
TEXCOORD0-TEXCOORD7, ATTR8-ATTR15 Input texture coordinates (texcoord0-texcoord7), Generic Attributes 8�15
130
TANGENT, ATTR14 Generic Attribute 14
131
BINORMAL, ATTR15 Generic Attribute 15
133
Table 24 summarizes the valid binding semantics for varying output parameters
134
in the vp30 profile. These binding semantics map to NV_vertex_program2 output registers. The
135
two sets act as aliases to each other.
138
Table 24 vp30 Varying Output Binding Semantics
139
Binding Semantics Name Corresponding Data
140
POSITION, HPOS Output position
141
PSIZE, PSIZ Output point size
142
FOG, FOGC Output fog coordinate
143
COLOR0, COL0 Output primary color
144
COLOR1, COL1 Output secondary color
145
BCOL0 Output backface primary color
146
BCOL1 Output backface secondary color
147
TEXCOORD0-TEXCOORD7, TEX0-TEX7 Output texture coordinates
148
CLP0-CL5 Output Clip distances