1 #define _OCC_MAX_LIGHTS_ 8
3 #define _OCC_MAX_CLIP_PLANES_ 8
6 //! OCCT ambient light source.
7 const int occAmbientLight = 0;
9 //! OCCT directional light source.
10 const int occDirectLight = 1;
12 //! OCCT isotropic point light source.
13 const int occPointLight = 2;
15 //! OCCT spot light source.
16 const int occSpotLight = 3;
19 //! Parameters of OCCT light source.
22 //! Type of light source.
25 //! Is light a headlight?
28 //! Ambient intensity.
31 //! Diffuse intensity.
34 //! Specular intensity.
37 //! Position of light source.
40 //! Direction of the spot light.
43 //! Maximum spread angle of the spot light (in radians).
46 //! Attenuation of the spot light intensity (from 0 to 1).
49 //! Const attenuation factor of positional light source.
50 float ConstAttenuation;
52 //! Linear attenuation factor of positional light source.
53 float LinearAttenuation;
56 //! Parameters of OCCT material.
57 struct occMaterialParams
62 //! Ambient reflection.
65 //! Diffuse reflection.
68 //! Specular reflection.
71 //! Specular exponent.
74 //! Transparency coefficient.
78 //! OCCT view-space clipping plane.
79 const int occEquationCoordsView = 0;
81 //! OCCT world-space clipping plane.
82 const int occEquationCoordsWorld = 1;
84 //! Parameters of OCCT clipping plane.
96 /////////////////////////////////////////////////////////////////////
97 // OCCT vertex attributes
99 // Note: At the moment, we just 'rename' the default OpenGL
100 // vertex attributes from compatibility profile. In the next
101 // release old functionality will be removed from shader API.
104 #define occColor gl_Color
106 //! Normal coordinates.
107 #define occNormal gl_Normal
109 //! Vertex coordinates.
110 #define occVertex gl_Vertex
112 //! Texture coordinates.
113 #define occTexCoord gl_MultiTexCoord0
117 /////////////////////////////////////////////////////////////////////
120 //! World-view matrix.
121 uniform mat4 occWorldViewMatrix;
123 //! Projection matrix.
124 uniform mat4 occProjectionMatrix;
126 //! Model-world matrix.
127 uniform mat4 occModelWorldMatrix;
129 //-------------------------------------------------------
131 //! Inverse of the world-view matrix.
132 uniform mat4 occWorldViewMatrixInverse;
134 //! Inverse of the projection matrix.
135 uniform mat4 occProjectionMatrixInverse;
137 //! Inverse of the model-world matrix.
138 uniform mat4 occModelWorldMatrixInverse;
140 //-------------------------------------------------------
142 //! Transpose of the world-view matrix.
143 uniform mat4 occWorldViewMatrixTranspose;
145 //! Transpose of the projection matrix.
146 uniform mat4 occProjectionMatrixTranspose;
148 //! Transpose of the model-world matrix.
149 uniform mat4 occModelWorldMatrixTranspose;
151 //-------------------------------------------------------
153 //! Transpose of the inverse of the world-view matrix.
154 uniform mat4 occWorldViewMatrixInverseTranspose;
156 //! Transpose of the inverse of the projection matrix.
157 uniform mat4 occProjectionMatrixInverseTranspose;
159 //! Transpose of the inverse of the model-world matrix.
160 uniform mat4 occModelWorldMatrixInverseTranspose;
162 /////////////////////////////////////////////////////////////////////
163 // OCCT light source state
165 //! Array of OCCT light sources.
166 uniform occLightSource occLightSources[_OCC_MAX_LIGHTS_];
168 //! Total number of OCCT light sources.
169 uniform int occLightSourcesCount;
171 /////////////////////////////////////////////////////////////////////
172 // OCCT material state
174 //! Parameters of OCCT back material.
175 uniform occMaterialParams occBackMaterial;
177 //! Parameters of OCCT front material.
178 uniform occMaterialParams occFrontMaterial;
180 //! Are front and back faces distinguished?
181 uniform int occDistinguishingMode;
183 //! Is texture enabled?
184 uniform int occTextureEnable;
186 //! Current active sampler.
187 uniform sampler2D occActiveSampler;
189 /////////////////////////////////////////////////////////////////////
190 // OCCT clipping planes state
192 uniform occClipPlane occClipPlanes[_OCC_MAX_CLIP_PLANES_];