ruby-ogre 0.0.3-x86-linux → 0.0.4-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +7 -8
- data/bindings/ogre/interface/ogre_all.i +1 -0
- data/bindings/ogre/interface/ogre_wrap.cpp +591 -46
- data/bindings/ogre/interface/ogre_wrap.o +0 -0
- data/bindings/ogrebites/interface/ogrebites_wrap.o +0 -0
- data/bindings/procedural/interface/procedural_wrap.o +0 -0
- data/deps/include/OGRE/OgreAny.h +23 -1
- data/deps/include/OGRE/OgreBillboardChain.h +5 -1
- data/deps/include/OGRE/OgreBillboardParticleRenderer.h +2 -0
- data/deps/include/OGRE/OgreConfigDialog.h +0 -2
- data/deps/include/OGRE/OgreDynLib.h +1 -7
- data/deps/include/OGRE/OgreErrorDialog.h +0 -2
- data/deps/include/OGRE/OgreHeaderSuffix.h +3 -3
- data/deps/include/OGRE/OgreInstanceBatch.h +4 -0
- data/deps/include/OGRE/OgreInstanceManager.h +5 -0
- data/deps/include/OGRE/OgreIteratorRange.h +13 -2
- data/deps/include/OGRE/OgreParticleSystem.h +2 -0
- data/deps/include/OGRE/OgreParticleSystemRenderer.h +4 -0
- data/deps/include/OGRE/OgrePlatform.h +5 -28
- data/deps/include/OGRE/OgrePrerequisites.h +1 -1
- data/deps/include/OGRE/OgreProfiler.h +102 -59
- data/deps/include/OGRE/OgreProgressiveMesh.h +2 -2
- data/deps/include/OGRE/OgreRenderSystem.h +18 -1
- data/deps/include/OGRE/OgreRoot.h +1 -1
- data/deps/include/OGRE/OgreSearchOps.h +0 -5
- data/deps/include/OGRE/OgreSimpleRenderable.h +1 -1
- data/deps/include/OGRE/OgreStdHeaders.h +2 -2
- data/deps/include/OGRE/OgreStringConverter.h +5 -0
- data/deps/include/OGRE/OgreTimer.h +1 -1
- data/deps/include/OGRE/OgreUTFString.h +0 -2
- data/deps/include/OGRE/OgreWindowEventUtilities.h +3 -1
- data/deps/include/OGRE/OgreWorkQueue.h +2 -2
- data/deps/include/OGRE/RTShaderSystem/OgreShaderCGProgramProcessor.h +5 -5
- data/deps/include/OGRE/RTShaderSystem/OgreShaderCGProgramWriter.h +17 -15
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExDualQuaternionSkinning.h +3 -3
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExHardwareSkinning.h +5 -4
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExHardwareSkinningTechnique.h +3 -3
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExIntegratedPSSM3.h +50 -32
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExLayeredBlending.h +13 -9
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExLinearSkinning.h +7 -7
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExNormalMapLighting.h +149 -95
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExPerPixelLighting.h +91 -59
- data/deps/include/OGRE/RTShaderSystem/OgreShaderExTextureAtlasSampler.h +14 -9
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPColour.h +33 -24
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPFog.h +44 -30
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPLighting.h +70 -45
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPRenderStateBuilder.h +11 -10
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPTexturing.h +73 -64
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFFPTransform.h +8 -8
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFunction.h +42 -35
- data/deps/include/OGRE/RTShaderSystem/OgreShaderFunctionAtom.h +38 -32
- data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLESProgramProcessor.h +9 -8
- data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLESProgramWriter.h +45 -36
- data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLProgramProcessor.h +9 -8
- data/deps/include/OGRE/RTShaderSystem/OgreShaderGLSLProgramWriter.h +26 -20
- data/deps/include/OGRE/RTShaderSystem/OgreShaderGenerator.h +211 -160
- data/deps/include/OGRE/RTShaderSystem/OgreShaderHLSLProgramProcessor.h +5 -5
- data/deps/include/OGRE/RTShaderSystem/OgreShaderHLSLProgramWriter.h +17 -15
- data/deps/include/OGRE/RTShaderSystem/OgreShaderMaterialSerializerListener.h +5 -3
- data/deps/include/OGRE/RTShaderSystem/OgreShaderParameter.h +86 -73
- data/deps/include/OGRE/RTShaderSystem/OgreShaderProgram.h +36 -30
- data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramManager.h +38 -31
- data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramProcessor.h +54 -43
- data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramSet.h +18 -14
- data/deps/include/OGRE/RTShaderSystem/OgreShaderProgramWriter.h +10 -10
- data/deps/include/OGRE/RTShaderSystem/OgreShaderRenderState.h +28 -23
- data/deps/include/OGRE/RTShaderSystem/OgreShaderScriptTranslator.h +2 -1
- data/deps/include/OGRE/RTShaderSystem/OgreShaderSubRenderState.h +35 -32
- data/deps/include/OGRE/RenderSystems/GL/GL/wglew.h +2 -2
- data/deps/include/OGRE/RenderSystems/GL/GL/wglext.h +2 -2
- data/deps/include/OGRE/RenderSystems/GL/OgreGLRenderSystem.h +10 -1
- data/deps/include/OGRE/RenderSystems/GL/OgreGLTextureManager.h +2 -0
- data/deps/include/OGRE/Sample.h +5 -0
- data/deps/include/OGRE/SampleContext.h +13 -3
- data/deps/lib/OGRE/Plugin_BSPSceneManager.so +0 -0
- data/deps/lib/OGRE/Plugin_BSPSceneManager.so.1.8.1 +0 -0
- data/deps/lib/OGRE/Plugin_CgProgramManager.so +0 -0
- data/deps/lib/OGRE/Plugin_CgProgramManager.so.1.8.1 +0 -0
- data/deps/lib/OGRE/Plugin_OctreeSceneManager.so +0 -0
- data/deps/lib/OGRE/Plugin_OctreeSceneManager.so.1.8.1 +0 -0
- data/deps/lib/OGRE/Plugin_OctreeZone.so +0 -0
- data/deps/lib/OGRE/Plugin_OctreeZone.so.1.8.1 +0 -0
- data/deps/lib/OGRE/Plugin_PCZSceneManager.so +0 -0
- data/deps/lib/OGRE/Plugin_PCZSceneManager.so.1.8.1 +0 -0
- data/deps/lib/OGRE/Plugin_ParticleFX.so +0 -0
- data/deps/lib/OGRE/Plugin_ParticleFX.so.1.8.1 +0 -0
- data/deps/lib/OGRE/RenderSystem_GL.so +0 -0
- data/deps/lib/OGRE/RenderSystem_GL.so.1.8.1 +0 -0
- data/deps/lib/libOgreMain.so +0 -0
- data/deps/lib/libOgreMain.so.1.8.1 +0 -0
- data/deps/lib/libOgrePaging.so +0 -0
- data/deps/lib/libOgrePaging.so.1.8.1 +0 -0
- data/deps/lib/libOgreProcedural.so +0 -0
- data/deps/lib/libOgreRTShaderSystem.so +0 -0
- data/deps/lib/libOgreRTShaderSystem.so.1.8.1 +0 -0
- data/deps/lib/libOgreTerrain.so +0 -0
- data/deps/lib/libOgreTerrain.so.1.8.1 +0 -0
- data/deps/share/OGRE/media/materials/programs/DiffuseOneTexture.glsles +17 -0
- data/deps/share/OGRE/media/packs/profiler.zip +0 -0
- data/lib/ogre.so +0 -0
- data/lib/ogrebites.so +0 -0
- data/lib/procedural.so +0 -0
- data/lib/version.rb +1 -1
- data/sample/charactor/sinbad.rb +8 -4
- metadata +16 -4
@@ -59,12 +59,12 @@ public:
|
|
59
59
|
Return true upon success.
|
60
60
|
@param sceneMgr The scene manager that the shader generator will be bound to.
|
61
61
|
*/
|
62
|
-
static bool
|
62
|
+
static bool initialize();
|
63
63
|
|
64
64
|
/**
|
65
65
|
Finalize the Shader Generator instance.
|
66
66
|
*/
|
67
|
-
static void
|
67
|
+
static void finalize();
|
68
68
|
|
69
69
|
|
70
70
|
/** Override standard Singleton retrieval.
|
@@ -82,7 +82,7 @@ public:
|
|
82
82
|
but the implementation stays in this single compilation unit,
|
83
83
|
preventing link errors.
|
84
84
|
*/
|
85
|
-
static ShaderGenerator&
|
85
|
+
static ShaderGenerator& getSingleton();
|
86
86
|
|
87
87
|
|
88
88
|
/** Override standard Singleton retrieval.
|
@@ -100,70 +100,70 @@ public:
|
|
100
100
|
but the implementation stays in this single compilation unit,
|
101
101
|
preventing link errors.
|
102
102
|
*/
|
103
|
-
static ShaderGenerator*
|
103
|
+
static ShaderGenerator* getSingletonPtr();
|
104
104
|
|
105
105
|
/**
|
106
106
|
Add a scene manager to the shader generator scene managers list.
|
107
107
|
@param sceneMgr The scene manager to add to the list.
|
108
108
|
*/
|
109
|
-
void
|
109
|
+
void addSceneManager(SceneManager* sceneMgr);
|
110
110
|
|
111
111
|
/**
|
112
112
|
Remove a scene manager from the shader generator scene managers list.
|
113
113
|
@param sceneMgr The scene manager to remove from the list.
|
114
114
|
*/
|
115
|
-
void
|
115
|
+
void removeSceneManager(SceneManager* sceneMgr);
|
116
116
|
|
117
117
|
/**
|
118
118
|
Get the active scene manager that is doint the actual scene rendering.
|
119
119
|
This attribute will be update on the call to preFindVisibleObjects.
|
120
120
|
*/
|
121
|
-
SceneManager*
|
121
|
+
SceneManager* getActiveSceneManager();
|
122
122
|
|
123
123
|
/**
|
124
124
|
Set the target shader language.
|
125
125
|
@param shaderLanguage The output shader language to use.
|
126
126
|
@remarks The default shader language is cg.
|
127
127
|
*/
|
128
|
-
void
|
128
|
+
void setTargetLanguage(const String& shaderLanguage);
|
129
129
|
|
130
130
|
/**
|
131
131
|
Return the target shader language currently in use.
|
132
132
|
*/
|
133
|
-
const String&
|
133
|
+
const String& getTargetLanguage() const { return mShaderLanguage; }
|
134
134
|
|
135
135
|
/**
|
136
136
|
Set the output vertex shader target profiles.
|
137
137
|
@param vertexShaderProfile The target profiles for the vertex shader.
|
138
138
|
*/
|
139
|
-
void
|
139
|
+
void setVertexShaderProfiles(const String& vertexShaderProfiles);
|
140
140
|
|
141
141
|
/**
|
142
142
|
Get the output vertex shader target profiles.
|
143
143
|
*/
|
144
|
-
const String&
|
144
|
+
const String& getVertexShaderProfiles() const { return mVertexShaderProfiles; }
|
145
145
|
|
146
146
|
/**
|
147
147
|
Get the output vertex shader target profiles as list of strings.
|
148
148
|
*/
|
149
|
-
const StringVector&
|
149
|
+
const StringVector& getVertexShaderProfilesList() const { return mVertexShaderProfilesList; }
|
150
150
|
|
151
151
|
|
152
152
|
/**
|
153
153
|
Set the output fragment shader target profiles.
|
154
154
|
@param fragmentShaderProfile The target profiles for the fragment shader.
|
155
155
|
*/
|
156
|
-
void
|
156
|
+
void setFragmentShaderProfiles(const String& fragmentShaderProfiles);
|
157
157
|
|
158
158
|
/**
|
159
159
|
Get the output fragment shader target profiles.
|
160
160
|
*/
|
161
|
-
const String&
|
161
|
+
const String& getFragmentShaderProfiles() const { return mFragmentShaderProfiles; }
|
162
162
|
|
163
163
|
/**
|
164
164
|
Get the output fragment shader target profiles as list of strings.
|
165
165
|
*/
|
166
|
-
const StringVector&
|
166
|
+
const StringVector& getFragmentShaderProfilesList() const { return mFragmentShaderProfilesList; }
|
167
167
|
|
168
168
|
/**
|
169
169
|
Set the output shader cache path. Generated shader code will be written to this path.
|
@@ -171,18 +171,18 @@ public:
|
|
171
171
|
@param cachePath The cache path of the shader.
|
172
172
|
The default is empty cache path.
|
173
173
|
*/
|
174
|
-
void
|
174
|
+
void setShaderCachePath(const String& cachePath);
|
175
175
|
|
176
176
|
/**
|
177
177
|
Get the output shader cache path.
|
178
178
|
*/
|
179
|
-
const String&
|
179
|
+
const String& getShaderCachePath() const { return mShaderCachePath; }
|
180
180
|
|
181
181
|
/**
|
182
182
|
Flush the shader cache. This operation will cause all active sachems to be invalidated and will
|
183
183
|
destroy any CPU/GPU program that created by this shader generator.
|
184
184
|
*/
|
185
|
-
void
|
185
|
+
void flushShaderCache();
|
186
186
|
|
187
187
|
/**
|
188
188
|
Return a global render state associated with the given scheme name.
|
@@ -192,7 +192,7 @@ public:
|
|
192
192
|
regenerate shaders.
|
193
193
|
@param schemeName The destination scheme name.
|
194
194
|
*/
|
195
|
-
RenderState*
|
195
|
+
RenderState* getRenderState(const String& schemeName);
|
196
196
|
|
197
197
|
|
198
198
|
typedef std::pair<RenderState*, bool> RenderStateCreateOrRetrieveResult;
|
@@ -218,8 +218,8 @@ public:
|
|
218
218
|
@param groupName The specific material name.
|
219
219
|
@param passIndex The pass index.
|
220
220
|
*/
|
221
|
-
RenderState*
|
222
|
-
RenderState*
|
221
|
+
RenderState* getRenderState(const String& schemeName, const String& materialName, unsigned short passIndex);
|
222
|
+
RenderState* getRenderState(const String& schemeName, const String& materialName, const String& groupName, unsigned short passIndex);
|
223
223
|
|
224
224
|
/**
|
225
225
|
Add sub render state factory. Plugins or 3d party applications may implement sub classes of
|
@@ -227,12 +227,12 @@ public:
|
|
227
227
|
of these sub classes.
|
228
228
|
@param factory The factory to add.
|
229
229
|
*/
|
230
|
-
void
|
230
|
+
void addSubRenderStateFactory(SubRenderStateFactory* factory);
|
231
231
|
|
232
232
|
/**
|
233
233
|
Returns the number of existing factories
|
234
234
|
*/
|
235
|
-
size_t
|
235
|
+
size_t getNumSubRenderStateFactories() const;
|
236
236
|
|
237
237
|
/**
|
238
238
|
Returns a sub render state factory by index
|
@@ -249,20 +249,20 @@ public:
|
|
249
249
|
Remove sub render state factory.
|
250
250
|
@param factory The factory to remove.
|
251
251
|
*/
|
252
|
-
void
|
252
|
+
void removeSubRenderStateFactory(SubRenderStateFactory* factory);
|
253
253
|
|
254
254
|
/**
|
255
255
|
Create an instance of sub render state from a given type.
|
256
256
|
@param type The type of sub render state to create.
|
257
257
|
*/
|
258
|
-
SubRenderState*
|
258
|
+
SubRenderState* createSubRenderState(const String& type);
|
259
259
|
|
260
260
|
|
261
261
|
/**
|
262
262
|
Destroy an instance of sub render state.
|
263
263
|
@param subRenderState The instance to destroy.
|
264
264
|
*/
|
265
|
-
void
|
265
|
+
void destroySubRenderState(SubRenderState* subRenderState);
|
266
266
|
|
267
267
|
|
268
268
|
/**
|
@@ -273,8 +273,8 @@ public:
|
|
273
273
|
@param srcTechniqueSchemeName The source technique scheme name.
|
274
274
|
@param dstTechniqueSchemeName The destination shader based technique scheme name.
|
275
275
|
*/
|
276
|
-
bool
|
277
|
-
bool
|
276
|
+
bool hasShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
|
277
|
+
bool hasShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
|
278
278
|
|
279
279
|
/**
|
280
280
|
Create shader based technique from a given technique.
|
@@ -286,8 +286,8 @@ public:
|
|
286
286
|
@param dstTechniqueSchemeName The destination shader based technique scheme name.
|
287
287
|
@param overProgrammable If true a shader will be created even if the material has shaders
|
288
288
|
*/
|
289
|
-
bool
|
290
|
-
bool
|
289
|
+
bool createShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
|
290
|
+
bool createShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
|
291
291
|
|
292
292
|
|
293
293
|
/**
|
@@ -299,8 +299,8 @@ public:
|
|
299
299
|
@param srcTechniqueSchemeName The source technique scheme name.
|
300
300
|
@param dstTechniqueSchemeName The destination shader based technique scheme name.
|
301
301
|
*/
|
302
|
-
bool
|
303
|
-
bool
|
302
|
+
bool removeShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
|
303
|
+
bool removeShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
|
304
304
|
|
305
305
|
|
306
306
|
/**
|
@@ -309,7 +309,7 @@ public:
|
|
309
309
|
@param materialName The source material name.
|
310
310
|
@param groupName The source group name.
|
311
311
|
*/
|
312
|
-
bool
|
312
|
+
bool removeAllShaderBasedTechniques(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
313
313
|
|
314
314
|
/**
|
315
315
|
Clone all shader based techniques from one material to another.
|
@@ -327,27 +327,27 @@ public:
|
|
327
327
|
/**
|
328
328
|
Remove all shader based techniques that created by this shader generator.
|
329
329
|
*/
|
330
|
-
void
|
330
|
+
void removeAllShaderBasedTechniques();
|
331
331
|
|
332
332
|
/**
|
333
333
|
Create a scheme.
|
334
334
|
@param schemeName The scheme name to create.
|
335
335
|
*/
|
336
|
-
void
|
336
|
+
void createScheme(const String& schemeName);
|
337
337
|
|
338
338
|
/**
|
339
339
|
Invalidate a given scheme. This action will lead to shader regeneration of all techniques belongs to the
|
340
340
|
given scheme name.
|
341
341
|
@param schemeName The scheme to invalidate.
|
342
342
|
*/
|
343
|
-
void
|
343
|
+
void invalidateScheme(const String& schemeName);
|
344
344
|
|
345
345
|
/**
|
346
346
|
Validate a given scheme. This action will generate shader programs for all techniques of the
|
347
347
|
given scheme name.
|
348
348
|
@param schemeName The scheme to validate.
|
349
349
|
*/
|
350
|
-
bool
|
350
|
+
bool validateScheme(const String& schemeName);
|
351
351
|
|
352
352
|
/**
|
353
353
|
Invalidate specific material scheme. This action will lead to shader regeneration of the technique belongs to the
|
@@ -356,7 +356,7 @@ public:
|
|
356
356
|
@param materialName The material to invalidate.
|
357
357
|
@param groupName The source group name.
|
358
358
|
*/
|
359
|
-
void
|
359
|
+
void invalidateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
360
360
|
|
361
361
|
/**
|
362
362
|
Validate specific material scheme. This action will generate shader programs for the technique of the
|
@@ -365,7 +365,7 @@ public:
|
|
365
365
|
@param materialName The material to validate.
|
366
366
|
@param groupName The source group name.
|
367
367
|
*/
|
368
|
-
bool
|
368
|
+
bool validateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
369
369
|
|
370
370
|
|
371
371
|
/**
|
@@ -379,15 +379,15 @@ public:
|
|
379
379
|
3. Add the return instance of serializer listener to the MaterialSerializer.
|
380
380
|
4. Call one of the export methods of MaterialSerializer.
|
381
381
|
*/
|
382
|
-
SGMaterialSerializerListener*
|
382
|
+
SGMaterialSerializerListener* getMaterialSerializerListener();
|
383
383
|
|
384
384
|
|
385
385
|
/** Return the current number of generated vertex shaders. */
|
386
|
-
size_t
|
386
|
+
size_t getVertexShaderCount() const;
|
387
387
|
|
388
388
|
|
389
389
|
/** Return the current number of generated fragment shaders. */
|
390
|
-
size_t
|
390
|
+
size_t getFragmentShaderCount() const;
|
391
391
|
|
392
392
|
|
393
393
|
|
@@ -395,12 +395,12 @@ public:
|
|
395
395
|
@see VSOutputCompactPolicy.
|
396
396
|
@param policy The policy to set.
|
397
397
|
*/
|
398
|
-
void
|
398
|
+
void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy) { mVSOutputCompactPolicy = policy; }
|
399
399
|
|
400
400
|
/** Get the vertex shader outputs compaction policy.
|
401
401
|
@see VSOutputCompactPolicy.
|
402
402
|
*/
|
403
|
-
VSOutputCompactPolicy
|
403
|
+
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const { return mVSOutputCompactPolicy; }
|
404
404
|
|
405
405
|
|
406
406
|
/** Sets whether shaders are created for passes with shaders.
|
@@ -408,21 +408,21 @@ public:
|
|
408
408
|
Not for when calling the createShaderBasedTechnique() function directly
|
409
409
|
@param value The value to set this attribute pass.
|
410
410
|
*/
|
411
|
-
void
|
411
|
+
void setCreateShaderOverProgrammablePass(bool value) { mCreateShaderOverProgrammablePass = value; }
|
412
412
|
|
413
413
|
/** Returns whether shaders are created for passes with shaders.
|
414
414
|
@see setCreateShaderOverProgrammablePass().
|
415
415
|
*/
|
416
|
-
bool
|
416
|
+
bool getCreateShaderOverProgrammablePass() const { return mCreateShaderOverProgrammablePass; }
|
417
417
|
|
418
418
|
|
419
419
|
/** Returns the amount of schemes used in the for RT shader generation
|
420
420
|
*/
|
421
|
-
size_t
|
421
|
+
size_t getRTShaderSchemeCount() const;
|
422
422
|
|
423
423
|
/** Returns the scheme name used in the for RT shader generation by index
|
424
424
|
*/
|
425
|
-
const String&
|
425
|
+
const String& getRTShaderScheme(size_t index) const;
|
426
426
|
|
427
427
|
/// Default material scheme of the shader generator.
|
428
428
|
static String DEFAULT_SCHEME_NAME;
|
@@ -474,48 +474,54 @@ protected:
|
|
474
474
|
class _OgreRTSSExport SGPass : public RTShaderSystemAlloc
|
475
475
|
{
|
476
476
|
public:
|
477
|
-
SGPass
|
478
|
-
~SGPass
|
477
|
+
SGPass(SGTechnique* parent, Pass* srcPass, Pass* dstPass);
|
478
|
+
~SGPass();
|
479
479
|
|
480
480
|
/** Build the render state. */
|
481
|
-
void
|
481
|
+
void buildTargetRenderState();
|
482
482
|
|
483
483
|
/** Acquire the CPU/GPU programs for this pass. */
|
484
|
-
void
|
484
|
+
void acquirePrograms();
|
485
485
|
|
486
486
|
/** Release the CPU/GPU programs of this pass. */
|
487
|
-
void
|
487
|
+
void releasePrograms();
|
488
488
|
|
489
489
|
|
490
490
|
/** Called when a single object is about to be rendered. */
|
491
|
-
void
|
491
|
+
void notifyRenderSingleObject(Renderable* rend, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
|
492
492
|
|
493
493
|
/** Get source pass. */
|
494
|
-
Pass*
|
494
|
+
Pass* getSrcPass() { return mSrcPass; }
|
495
495
|
|
496
496
|
/** Get destination pass. */
|
497
|
-
Pass*
|
497
|
+
Pass* getDstPass() { return mDstPass; }
|
498
498
|
|
499
499
|
/** Get custom FPP sub state of this pass. */
|
500
|
-
SubRenderState*
|
500
|
+
SubRenderState* getCustomFFPSubState(int subStateOrder);
|
501
501
|
|
502
502
|
/** Get custom render state of this pass. */
|
503
|
-
RenderState*
|
503
|
+
RenderState* getCustomRenderState() { return mCustomRenderState; }
|
504
504
|
|
505
505
|
/** Set the custom render state of this pass. */
|
506
|
-
void
|
506
|
+
void setCustomRenderState(RenderState* customRenderState) { mCustomRenderState = customRenderState; }
|
507
507
|
|
508
|
-
|
508
|
+
// Key name for associating with a Pass instance.
|
509
|
+
static String UserKey;
|
509
510
|
|
510
511
|
protected:
|
511
|
-
SubRenderState*
|
512
|
+
SubRenderState* getCustomFFPSubState(int subStateOrder, const RenderState* renderState);
|
512
513
|
|
513
514
|
protected:
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
515
|
+
// Parent technique.
|
516
|
+
SGTechnique* mParent;
|
517
|
+
// Source pass.
|
518
|
+
Pass* mSrcPass;
|
519
|
+
// Destination pass.
|
520
|
+
Pass* mDstPass;
|
521
|
+
// Custom render state.
|
522
|
+
RenderState* mCustomRenderState;
|
523
|
+
// The compiled render state.
|
524
|
+
TargetRenderState* mTargetRenderState;
|
519
525
|
};
|
520
526
|
|
521
527
|
|
@@ -523,61 +529,69 @@ protected:
|
|
523
529
|
class _OgreRTSSExport SGTechnique : public RTShaderSystemAlloc
|
524
530
|
{
|
525
531
|
public:
|
526
|
-
SGTechnique
|
527
|
-
~SGTechnique
|
532
|
+
SGTechnique(SGMaterial* parent, Technique* srcTechnique, const String& dstTechniqueSchemeName);
|
533
|
+
~SGTechnique();
|
528
534
|
|
529
535
|
/** Get the parent SGMaterial */
|
530
|
-
const SGMaterial*
|
536
|
+
const SGMaterial* getParent() const { return mParent; }
|
531
537
|
|
532
538
|
/** Get the source technique. */
|
533
|
-
Technique*
|
539
|
+
Technique* getSourceTechnique() { return mSrcTechnique; }
|
534
540
|
|
535
541
|
/** Get the destination technique. */
|
536
|
-
Technique*
|
542
|
+
Technique* getDestinationTechnique() { return mDstTechnique; }
|
537
543
|
|
538
544
|
/** Get the destination technique scheme name. */
|
539
|
-
const String&
|
545
|
+
const String& getDestinationTechniqueSchemeName() const { return mDstTechniqueSchemeName; }
|
540
546
|
|
541
547
|
/** Build the render state. */
|
542
|
-
void
|
548
|
+
void buildTargetRenderState();
|
543
549
|
|
544
550
|
/** Acquire the CPU/GPU programs for this technique. */
|
545
|
-
void
|
551
|
+
void acquirePrograms();
|
546
552
|
|
547
553
|
/** Release the CPU/GPU programs of this technique. */
|
548
|
-
void
|
554
|
+
void releasePrograms();
|
549
555
|
|
550
556
|
/** Tells the technique that it needs to generate shader code. */
|
551
|
-
void
|
557
|
+
void setBuildDestinationTechnique(bool buildTechnique) { mBuildDstTechnique = buildTechnique; }
|
552
558
|
|
553
559
|
/** Tells if the destination technique should be build. */
|
554
|
-
bool
|
560
|
+
bool getBuildDestinationTechnique() const { return mBuildDstTechnique; }
|
555
561
|
|
556
562
|
/** Get render state of specific pass.
|
557
563
|
@param passIndex The pass index.
|
558
564
|
*/
|
559
|
-
RenderState*
|
565
|
+
RenderState* getRenderState(unsigned short passIndex);
|
560
566
|
/** Tells if a custom render state exists for the given pass. */
|
561
|
-
bool
|
567
|
+
bool hasRenderState(unsigned short passIndex);
|
562
568
|
|
563
|
-
|
569
|
+
// Key name for associating with a Technique instance.
|
570
|
+
static String UserKey;
|
564
571
|
|
565
572
|
protected:
|
566
573
|
|
567
574
|
/** Create the passes entries. */
|
568
|
-
void
|
575
|
+
void createSGPasses();
|
569
576
|
|
570
577
|
/** Destroy the passes entries. */
|
571
|
-
void
|
578
|
+
void destroySGPasses();
|
572
579
|
|
573
580
|
protected:
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
+
// Parent material.
|
582
|
+
SGMaterial* mParent;
|
583
|
+
// Source technique.
|
584
|
+
Technique* mSrcTechnique;
|
585
|
+
// Destination technique.
|
586
|
+
Technique* mDstTechnique;
|
587
|
+
// All passes entries.
|
588
|
+
SGPassList mPassEntries;
|
589
|
+
// The custom render states of all passes.
|
590
|
+
RenderStateList mCustomRenderStates;
|
591
|
+
// Flag that tells if destination technique should be build.
|
592
|
+
bool mBuildDstTechnique;
|
593
|
+
// Scheme name of destination technique.
|
594
|
+
String mDstTechniqueSchemeName;
|
581
595
|
};
|
582
596
|
|
583
597
|
|
@@ -593,21 +607,24 @@ protected:
|
|
593
607
|
}
|
594
608
|
|
595
609
|
/** Get the material name. */
|
596
|
-
const String& getMaterialName
|
610
|
+
const String& getMaterialName() const { return mName; }
|
597
611
|
|
598
612
|
/** Get the group name. */
|
599
|
-
const String& getGroupName
|
613
|
+
const String& getGroupName() const { return mGroup; }
|
600
614
|
|
601
615
|
/** Get the const techniques list of this material. */
|
602
|
-
const SGTechniqueList&
|
616
|
+
const SGTechniqueList& getTechniqueList() const { return mTechniqueEntries; }
|
603
617
|
|
604
618
|
/** Get the techniques list of this material. */
|
605
|
-
SGTechniqueList&
|
619
|
+
SGTechniqueList& getTechniqueList() { return mTechniqueEntries; }
|
606
620
|
|
607
621
|
protected:
|
608
|
-
|
609
|
-
String
|
610
|
-
|
622
|
+
// The material name.
|
623
|
+
String mName;
|
624
|
+
// The group name.
|
625
|
+
String mGroup;
|
626
|
+
// All passes entries.
|
627
|
+
SGTechniqueList mTechniqueEntries;
|
611
628
|
};
|
612
629
|
|
613
630
|
|
@@ -615,65 +632,70 @@ protected:
|
|
615
632
|
class _OgreRTSSExport SGScheme : public RTShaderSystemAlloc
|
616
633
|
{
|
617
634
|
public:
|
618
|
-
SGScheme
|
619
|
-
~SGScheme
|
635
|
+
SGScheme(const String& schemeName);
|
636
|
+
~SGScheme();
|
620
637
|
|
621
638
|
|
622
639
|
/** Return true if this scheme dose not contains any techniques.
|
623
640
|
*/
|
624
|
-
bool
|
641
|
+
bool empty() const { return mTechniqueEntries.empty(); }
|
625
642
|
|
626
643
|
/** Invalidate the whole scheme.
|
627
644
|
@see ShaderGenerator::invalidateScheme.
|
628
645
|
*/
|
629
|
-
void
|
646
|
+
void invalidate();
|
630
647
|
|
631
648
|
/** Validate the whole scheme.
|
632
649
|
@see ShaderGenerator::validateScheme.
|
633
650
|
*/
|
634
|
-
void
|
651
|
+
void validate();
|
635
652
|
|
636
653
|
/** Invalidate specific material.
|
637
654
|
@see ShaderGenerator::invalidateMaterial.
|
638
655
|
*/
|
639
|
-
void
|
656
|
+
void invalidate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
640
657
|
|
641
658
|
/** Validate specific material.
|
642
659
|
@see ShaderGenerator::validateMaterial.
|
643
660
|
*/
|
644
|
-
bool
|
661
|
+
bool validate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
|
645
662
|
|
646
663
|
/** Add a technique to current techniques list. */
|
647
|
-
void
|
664
|
+
void addTechniqueEntry(SGTechnique* techEntry);
|
648
665
|
|
649
666
|
/** Remove a technique from the current techniques list. */
|
650
|
-
void
|
667
|
+
void removeTechniqueEntry(SGTechnique* techEntry);
|
651
668
|
|
652
669
|
|
653
670
|
/** Get global render state of this scheme.
|
654
671
|
@see ShaderGenerator::getRenderState.
|
655
672
|
*/
|
656
|
-
RenderState*
|
673
|
+
RenderState* getRenderState();
|
657
674
|
|
658
675
|
/** Get specific pass render state.
|
659
676
|
@see ShaderGenerator::getRenderState.
|
660
677
|
*/
|
661
|
-
RenderState*
|
678
|
+
RenderState* getRenderState(const String& materialName, const String& groupName, unsigned short passIndex);
|
662
679
|
|
663
680
|
protected:
|
664
681
|
/** Synchronize the current light settings of this scheme with the current settings of the scene. */
|
665
|
-
void
|
682
|
+
void synchronizeWithLightSettings();
|
666
683
|
|
667
684
|
/** Synchronize the fog settings of this scheme with the current settings of the scene. */
|
668
|
-
void
|
685
|
+
void synchronizeWithFogSettings();
|
669
686
|
|
670
687
|
|
671
688
|
protected:
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
689
|
+
// Scheme name.
|
690
|
+
String mName;
|
691
|
+
// Technique entries.
|
692
|
+
SGTechniqueList mTechniqueEntries;
|
693
|
+
// Tells if this scheme is out of date.
|
694
|
+
bool mOutOfDate;
|
695
|
+
// The global render state of this scheme.
|
696
|
+
RenderState* mRenderState;
|
697
|
+
// Current fog mode.
|
698
|
+
FogMode mFogMode;
|
677
699
|
};
|
678
700
|
|
679
701
|
|
@@ -745,7 +767,8 @@ protected:
|
|
745
767
|
}
|
746
768
|
|
747
769
|
protected:
|
748
|
-
|
770
|
+
// The shader generator instance.
|
771
|
+
ShaderGenerator* mOwner;
|
749
772
|
};
|
750
773
|
|
751
774
|
/** Shader generator ScriptTranslatorManager sub class. */
|
@@ -770,7 +793,8 @@ protected:
|
|
770
793
|
}
|
771
794
|
|
772
795
|
protected:
|
773
|
-
|
796
|
+
// The shader generator instance.
|
797
|
+
ShaderGenerator* mOwner;
|
774
798
|
};
|
775
799
|
|
776
800
|
//-----------------------------------------------------------------------------
|
@@ -785,34 +809,34 @@ protected:
|
|
785
809
|
|
786
810
|
protected:
|
787
811
|
/** Class default constructor */
|
788
|
-
ShaderGenerator
|
812
|
+
ShaderGenerator();
|
789
813
|
|
790
814
|
/** Class destructor */
|
791
|
-
~ShaderGenerator
|
815
|
+
~ShaderGenerator();
|
792
816
|
|
793
817
|
/** Initialize the shader generator instance. */
|
794
|
-
bool
|
818
|
+
bool _initialize();
|
795
819
|
|
796
820
|
/** Finalize the shader generator instance. */
|
797
|
-
void
|
821
|
+
void _finalize();
|
798
822
|
|
799
823
|
/** Find source technique to generate shader based technique based on it. */
|
800
|
-
Technique*
|
824
|
+
Technique* findSourceTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName);
|
801
825
|
|
802
826
|
/** Checks if a given technique has passes with shaders. */
|
803
|
-
bool
|
827
|
+
bool isProgrammable(Technique* tech) const;
|
804
828
|
|
805
829
|
/** Called from the sub class of the RenderObjectLister when single object is rendered. */
|
806
|
-
void
|
830
|
+
void notifyRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
|
807
831
|
|
808
832
|
/** Called from the sub class of the SceneManager::Listener when finding visible object process starts. */
|
809
|
-
void
|
833
|
+
void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v);
|
810
834
|
|
811
835
|
/** Create sub render state core extensions factories */
|
812
|
-
void
|
836
|
+
void createSubRenderStateExFactories();
|
813
837
|
|
814
838
|
/** Destroy sub render state core extensions factories */
|
815
|
-
void
|
839
|
+
void destroySubRenderStateExFactories();
|
816
840
|
|
817
841
|
/** Create an instance of the SubRenderState based on script properties using the
|
818
842
|
current sub render state factories.
|
@@ -822,7 +846,7 @@ protected:
|
|
822
846
|
@param pass The pass that is the parent context of this node.
|
823
847
|
@param the translator for the specific SubRenderState
|
824
848
|
*/
|
825
|
-
SubRenderState*
|
849
|
+
SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
|
826
850
|
|
827
851
|
/** Create an instance of the SubRenderState based on script properties using the
|
828
852
|
current sub render state factories.
|
@@ -832,7 +856,7 @@ protected:
|
|
832
856
|
@param texState The texture unit state that is the parent context of this node.
|
833
857
|
@param the translator for the specific SubRenderState
|
834
858
|
*/
|
835
|
-
SubRenderState*
|
859
|
+
SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
|
836
860
|
|
837
861
|
/**
|
838
862
|
Add custom script translator.
|
@@ -840,20 +864,20 @@ protected:
|
|
840
864
|
@param key The key name of the given translator.
|
841
865
|
@param translator The translator to associate with the given key.
|
842
866
|
*/
|
843
|
-
bool
|
867
|
+
bool addCustomScriptTranslator(const String& key, ScriptTranslator* translator);
|
844
868
|
|
845
869
|
/**
|
846
870
|
Remove custom script translator.
|
847
871
|
Return true upon success.
|
848
872
|
@param key The key name of the translator to remove.
|
849
873
|
*/
|
850
|
-
bool
|
874
|
+
bool removeCustomScriptTranslator(const String& key);
|
851
875
|
|
852
876
|
/** Return number of script translators. */
|
853
|
-
size_t
|
877
|
+
size_t getNumTranslators() const;
|
854
878
|
|
855
879
|
/** Return a matching script translator. */
|
856
|
-
ScriptTranslator*
|
880
|
+
ScriptTranslator* getTranslator(const AbstractNodePtr& node);
|
857
881
|
|
858
882
|
|
859
883
|
/** This method called by instance of SGMaterialSerializerListener and
|
@@ -861,7 +885,7 @@ protected:
|
|
861
885
|
@param ser The material serializer.
|
862
886
|
@param passEntry The SGPass instance.
|
863
887
|
*/
|
864
|
-
void
|
888
|
+
void serializePassAttributes(MaterialSerializer* ser, SGPass* passEntry);
|
865
889
|
|
866
890
|
/** This method called by instance of SGMaterialSerializerListener and
|
867
891
|
serialize a given textureUnitState entry attributes.
|
@@ -890,33 +914,60 @@ protected:
|
|
890
914
|
bool getIsFinalizing() const;
|
891
915
|
protected:
|
892
916
|
OGRE_AUTO_MUTEX // Auto mutex.
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
917
|
+
// The active scene manager.
|
918
|
+
SceneManager* mActiveSceneMgr;
|
919
|
+
// A map of all scene managers this generator is bound to.
|
920
|
+
SceneManagerMap mSceneManagerMap;
|
921
|
+
// Render object listener.
|
922
|
+
SGRenderObjectListener* mRenderObjectListener;
|
923
|
+
// Scene manager listener.
|
924
|
+
SGSceneManagerListener* mSceneManagerListener;
|
925
|
+
// Script translator manager.
|
926
|
+
SGScriptTranslatorManager* mScriptTranslatorManager;
|
927
|
+
// Custom material Serializer listener - allows exporting material that contains shader generated techniques.
|
928
|
+
SGMaterialSerializerListener* mMaterialSerializerListener;
|
929
|
+
// A map of the registered custom script translators.
|
930
|
+
SGScriptTranslatorMap mScriptTranslatorsMap;
|
931
|
+
// The core translator of the RT Shader System.
|
932
|
+
SGScriptTranslator mCoreScriptTranslator;
|
933
|
+
// The target shader language (currently only cg supported).
|
934
|
+
String mShaderLanguage;
|
935
|
+
// The target vertex shader profile. Will be used as argument for program compilation.
|
936
|
+
String mVertexShaderProfiles;
|
937
|
+
// List of target vertex shader profiles.
|
938
|
+
StringVector mVertexShaderProfilesList;
|
939
|
+
// The target fragment shader profile. Will be used as argument for program compilation.
|
940
|
+
String mFragmentShaderProfiles;
|
941
|
+
// List of target fragment shader profiles..
|
942
|
+
StringVector mFragmentShaderProfilesList;
|
943
|
+
// Path for caching the generated shaders.
|
944
|
+
String mShaderCachePath;
|
945
|
+
// Shader program manager.
|
946
|
+
ProgramManager* mProgramManager;
|
947
|
+
// Shader program writer manager.
|
948
|
+
ProgramWriterManager* mProgramWriterManager;
|
949
|
+
// Fixed Function Render state builder.
|
950
|
+
FFPRenderStateBuilder* mFFPRenderStateBuilder;
|
951
|
+
// Material entries map.
|
952
|
+
SGMaterialMap mMaterialEntriesMap;
|
953
|
+
// Scheme entries map.
|
954
|
+
SGSchemeMap mSchemeEntriesMap;
|
955
|
+
// All technique entries map.
|
956
|
+
SGTechniqueMap mTechniqueEntriesMap;
|
957
|
+
// Sub render state registered factories.
|
958
|
+
SubRenderStateFactoryMap mSubRenderStateFactories;
|
959
|
+
// Sub render state core extension factories.
|
960
|
+
SubRenderStateFactoryMap mSubRenderStateExFactories;
|
961
|
+
// True if active view port use a valid SGScheme.
|
962
|
+
bool mActiveViewportValid;
|
963
|
+
// Light count per light type.
|
964
|
+
int mLightCount[3];
|
965
|
+
// Vertex shader outputs compact policy.
|
966
|
+
VSOutputCompactPolicy mVSOutputCompactPolicy;
|
967
|
+
// Tells whether shaders are created for passes with shaders
|
968
|
+
bool mCreateShaderOverProgrammablePass;
|
969
|
+
// a flag to indicate finalizing
|
970
|
+
bool mIsFinalizing;
|
920
971
|
private:
|
921
972
|
friend class SGPass;
|
922
973
|
friend class FFPRenderStateBuilder;
|