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
@@ -62,27 +62,27 @@ public:
|
|
62
62
|
/**
|
63
63
|
@see SubRenderState::getType.
|
64
64
|
*/
|
65
|
-
virtual const String&
|
65
|
+
virtual const String& getType() const;
|
66
66
|
|
67
67
|
/**
|
68
68
|
@see SubRenderState::getType.
|
69
69
|
*/
|
70
|
-
virtual int
|
70
|
+
virtual int getExecutionOrder() const;
|
71
71
|
|
72
72
|
/**
|
73
73
|
@see SubRenderState::updateGpuProgramsParams.
|
74
74
|
*/
|
75
|
-
virtual void
|
75
|
+
virtual void updateGpuProgramsParams(Renderable* rend, Pass* pass, const AutoParamDataSource* source, const LightList* pLightList);
|
76
76
|
|
77
77
|
/**
|
78
78
|
@see SubRenderState::copyFrom.
|
79
79
|
*/
|
80
|
-
virtual void
|
80
|
+
virtual void copyFrom(const SubRenderState& rhs);
|
81
81
|
|
82
82
|
/**
|
83
83
|
@see SubRenderState::preAddToRenderState.
|
84
84
|
*/
|
85
|
-
virtual bool
|
85
|
+
virtual bool preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass);
|
86
86
|
|
87
87
|
|
88
88
|
static String Type;
|
@@ -94,12 +94,18 @@ protected:
|
|
94
94
|
struct _OgreRTSSExport LightParams
|
95
95
|
{
|
96
96
|
Light::LightTypes mType; // Light type.
|
97
|
-
|
98
|
-
UniformParameterPtr
|
99
|
-
|
100
|
-
UniformParameterPtr
|
101
|
-
|
102
|
-
UniformParameterPtr
|
97
|
+
// Light position.
|
98
|
+
UniformParameterPtr mPosition;
|
99
|
+
// Light direction.
|
100
|
+
UniformParameterPtr mDirection;
|
101
|
+
// Attenuation parameters.
|
102
|
+
UniformParameterPtr mAttenuatParams;
|
103
|
+
// Spot light parameters.
|
104
|
+
UniformParameterPtr mSpotParams;
|
105
|
+
// Diffuse colour.
|
106
|
+
UniformParameterPtr mDiffuseColour;
|
107
|
+
// Specular colour.
|
108
|
+
UniformParameterPtr mSpecularColour;
|
103
109
|
|
104
110
|
};
|
105
111
|
|
@@ -114,85 +120,104 @@ protected:
|
|
114
120
|
can be the vertex colour component. To establish such a link one should provide the matching flags to this
|
115
121
|
sub render state.
|
116
122
|
*/
|
117
|
-
void
|
123
|
+
void setTrackVertexColourType(TrackVertexColourType type) { mTrackVertexColourType = type; }
|
118
124
|
|
119
125
|
/**
|
120
126
|
Return the current track per vertex type.
|
121
127
|
*/
|
122
|
-
TrackVertexColourType
|
128
|
+
TrackVertexColourType getTrackVertexColourType() const { return mTrackVertexColourType; }
|
123
129
|
|
124
130
|
/**
|
125
131
|
Set the light count per light type that this sub render state will generate.
|
126
132
|
@see ShaderGenerator::setLightCount.
|
127
133
|
*/
|
128
|
-
void
|
134
|
+
void setLightCount(const int lightCount[3]);
|
129
135
|
|
130
136
|
/**
|
131
137
|
Get the light count per light type that this sub render state will generate.
|
132
138
|
@see ShaderGenerator::getLightCount.
|
133
139
|
*/
|
134
|
-
void
|
140
|
+
void getLightCount(int lightCount[3]) const;
|
135
141
|
|
136
142
|
/**
|
137
143
|
Set the specular component state. If set to true this sub render state will compute a specular
|
138
144
|
lighting component in addition to the diffuse component.
|
139
145
|
@param enable Pass true to enable specular component computation.
|
140
146
|
*/
|
141
|
-
void
|
147
|
+
void setSpecularEnable(bool enable) { mSpecularEnable = enable; }
|
142
148
|
|
143
149
|
/**
|
144
150
|
Get the specular component state.
|
145
151
|
*/
|
146
|
-
bool
|
152
|
+
bool getSpecularEnable() const { return mSpecularEnable; }
|
147
153
|
|
148
154
|
/**
|
149
155
|
@see SubRenderState::resolveParameters.
|
150
156
|
*/
|
151
|
-
virtual bool
|
157
|
+
virtual bool resolveParameters(ProgramSet* programSet);
|
152
158
|
|
153
159
|
/**
|
154
160
|
@see SubRenderState::resolveDependencies.
|
155
161
|
*/
|
156
|
-
virtual bool
|
162
|
+
virtual bool resolveDependencies(ProgramSet* programSet);
|
157
163
|
|
158
164
|
/**
|
159
165
|
@see SubRenderState::addFunctionInvocations.
|
160
166
|
*/
|
161
|
-
virtual bool
|
167
|
+
virtual bool addFunctionInvocations(ProgramSet* programSet);
|
162
168
|
|
163
169
|
|
164
170
|
/**
|
165
171
|
Internal method that adds global illumination component functions invocations.
|
166
172
|
*/
|
167
|
-
bool
|
173
|
+
bool addGlobalIlluminationInvocation(Function* vsMain, const int groupOrder, int& internalCounter);
|
168
174
|
|
169
175
|
/**
|
170
176
|
Internal method that adds per light illumination component functions invocations.
|
171
177
|
*/
|
172
|
-
bool
|
178
|
+
bool addIlluminationInvocation(LightParams* curLightParams, Function* vsMain, const int groupOrder, int& internalCounter);
|
173
179
|
|
174
180
|
|
175
181
|
// Attributes.
|
176
182
|
protected:
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
183
|
+
// Track per vertex colour type.
|
184
|
+
TrackVertexColourType mTrackVertexColourType;
|
185
|
+
// Specular component enabled/disabled.
|
186
|
+
bool mSpecularEnable;
|
187
|
+
// Light list.
|
188
|
+
LightParamsList mLightParamsList;
|
189
|
+
// World view matrix parameter.
|
190
|
+
UniformParameterPtr mWorldViewMatrix;
|
191
|
+
// World view matrix inverse transpose parameter.
|
192
|
+
UniformParameterPtr mWorldViewITMatrix;
|
193
|
+
// Vertex shader input position parameter.
|
194
|
+
ParameterPtr mVSInPosition;
|
195
|
+
// Vertex shader input normal.
|
196
|
+
ParameterPtr mVSInNormal;
|
197
|
+
// Vertex shader diffuse.
|
198
|
+
ParameterPtr mVSDiffuse;
|
199
|
+
// Vertex shader output diffuse colour parameter.
|
200
|
+
ParameterPtr mVSOutDiffuse;
|
201
|
+
// Vertex shader output specular colour parameter.
|
202
|
+
ParameterPtr mVSOutSpecular;
|
203
|
+
// Derived scene colour parameter.
|
204
|
+
UniformParameterPtr mDerivedSceneColour;
|
205
|
+
// Ambient light colour parameter.
|
206
|
+
UniformParameterPtr mLightAmbientColour;
|
207
|
+
// Derived ambient light colour parameter.
|
208
|
+
UniformParameterPtr mDerivedAmbientLightColour;
|
209
|
+
// Surface ambient colour parameter.
|
210
|
+
UniformParameterPtr mSurfaceAmbientColour;
|
211
|
+
// Surface diffuse colour parameter.
|
212
|
+
UniformParameterPtr mSurfaceDiffuseColour;
|
213
|
+
// Surface specular colour parameter.
|
214
|
+
UniformParameterPtr mSurfaceSpecularColour;
|
215
|
+
// Surface emissive colour parameter.
|
216
|
+
UniformParameterPtr mSurfaceEmissiveColour;
|
217
|
+
// Surface shininess parameter.
|
218
|
+
UniformParameterPtr mSurfaceShininess;
|
219
|
+
// Shared blank light.
|
220
|
+
static Light msBlankLight;
|
196
221
|
|
197
222
|
};
|
198
223
|
|
@@ -208,17 +233,17 @@ public:
|
|
208
233
|
/**
|
209
234
|
@see SubRenderStateFactory::getType.
|
210
235
|
*/
|
211
|
-
virtual const String&
|
236
|
+
virtual const String& getType() const;
|
212
237
|
|
213
238
|
/**
|
214
239
|
@see SubRenderStateFactory::createInstance.
|
215
240
|
*/
|
216
|
-
virtual SubRenderState*
|
241
|
+
virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
|
217
242
|
|
218
243
|
/**
|
219
244
|
@see SubRenderStateFactory::writeInstance.
|
220
245
|
*/
|
221
|
-
virtual void
|
246
|
+
virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState, Pass* srcPass, Pass* dstPass);
|
222
247
|
|
223
248
|
|
224
249
|
protected:
|
@@ -226,7 +251,7 @@ protected:
|
|
226
251
|
/**
|
227
252
|
@see SubRenderStateFactory::createInstanceImpl.
|
228
253
|
*/
|
229
|
-
virtual SubRenderState*
|
254
|
+
virtual SubRenderState* createInstanceImpl();
|
230
255
|
|
231
256
|
|
232
257
|
};
|
@@ -51,8 +51,8 @@ class _OgreRTSSExport FFPRenderStateBuilder : public Singleton<FFPRenderStateBui
|
|
51
51
|
{
|
52
52
|
// Interface.
|
53
53
|
public:
|
54
|
-
FFPRenderStateBuilder
|
55
|
-
~FFPRenderStateBuilder
|
54
|
+
FFPRenderStateBuilder();
|
55
|
+
~FFPRenderStateBuilder();
|
56
56
|
|
57
57
|
/** Override standard Singleton retrieval.
|
58
58
|
@remarks
|
@@ -69,7 +69,7 @@ public:
|
|
69
69
|
but the implementation stays in this single compilation unit,
|
70
70
|
preventing link errors.
|
71
71
|
*/
|
72
|
-
static FFPRenderStateBuilder&
|
72
|
+
static FFPRenderStateBuilder& getSingleton();
|
73
73
|
|
74
74
|
/** Override standard Singleton retrieval.
|
75
75
|
@remarks
|
@@ -86,26 +86,26 @@ public:
|
|
86
86
|
but the implementation stays in this single compilation unit,
|
87
87
|
preventing link errors.
|
88
88
|
*/
|
89
|
-
static FFPRenderStateBuilder*
|
89
|
+
static FFPRenderStateBuilder* getSingletonPtr();
|
90
90
|
|
91
91
|
|
92
92
|
/**
|
93
93
|
Initialize the FFP builder instance.
|
94
94
|
Return true upon success.
|
95
95
|
*/
|
96
|
-
bool
|
96
|
+
bool initialize();
|
97
97
|
|
98
98
|
/**
|
99
99
|
Finalize the FFP builder instance.
|
100
100
|
*/
|
101
|
-
void
|
101
|
+
void finalize();
|
102
102
|
|
103
103
|
/**
|
104
104
|
Build render state from the given pass that emulates the fixed function pipeline behaviour.
|
105
105
|
@param sgPass The shader generator pass representation. Contains both source and destination pass.
|
106
106
|
@param renderState The target render state that will hold the given pass FFP representation.
|
107
107
|
*/
|
108
|
-
void
|
108
|
+
void buildRenderState(ShaderGenerator::SGPass* sgPass, TargetRenderState* renderState);
|
109
109
|
|
110
110
|
|
111
111
|
// Protected types.
|
@@ -120,18 +120,19 @@ protected:
|
|
120
120
|
/**
|
121
121
|
Internal method that builds FFP sub render state.
|
122
122
|
*/
|
123
|
-
void
|
123
|
+
void buildFFPSubRenderState(int subRenderStateOrder, const String& subRenderStateType,
|
124
124
|
ShaderGenerator::SGPass* sgPass, TargetRenderState* renderState);
|
125
125
|
|
126
126
|
/**
|
127
127
|
Internal method that resolves the colour stage flags.
|
128
128
|
*/
|
129
|
-
void
|
129
|
+
void resolveColourStageFlags(ShaderGenerator::SGPass* sgPass, TargetRenderState* renderState);
|
130
130
|
|
131
131
|
|
132
132
|
// Attributes.
|
133
133
|
protected:
|
134
|
-
|
134
|
+
// All factories needed by the FFP.
|
135
|
+
SubRenderStateFactoryList mFFPSubRenderStateFactoyList;
|
135
136
|
|
136
137
|
};
|
137
138
|
|
@@ -63,27 +63,27 @@ public:
|
|
63
63
|
/**
|
64
64
|
@see SubRenderState::getType.
|
65
65
|
*/
|
66
|
-
virtual const String&
|
66
|
+
virtual const String& getType() const;
|
67
67
|
|
68
68
|
/**
|
69
69
|
@see SubRenderState::getType.
|
70
70
|
*/
|
71
|
-
virtual int
|
71
|
+
virtual int getExecutionOrder() const;
|
72
72
|
|
73
73
|
/**
|
74
74
|
@see SubRenderState::updateGpuProgramsParams.
|
75
75
|
*/
|
76
|
-
virtual void
|
76
|
+
virtual void updateGpuProgramsParams(Renderable* rend, Pass* pass, const AutoParamDataSource* source, const LightList* pLightList);
|
77
77
|
|
78
78
|
/**
|
79
79
|
@see SubRenderState::copyFrom.
|
80
80
|
*/
|
81
|
-
virtual void
|
81
|
+
virtual void copyFrom(const SubRenderState& rhs);
|
82
82
|
|
83
83
|
/**
|
84
84
|
@see SubRenderState::preAddToRenderState.
|
85
85
|
*/
|
86
|
-
virtual bool
|
86
|
+
virtual bool preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass);
|
87
87
|
|
88
88
|
static String Type;
|
89
89
|
|
@@ -93,19 +93,32 @@ protected:
|
|
93
93
|
// Per texture unit parameters.
|
94
94
|
struct _OgreRTSSExport TextureUnitParams
|
95
95
|
{
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
96
|
+
// Texture unit state.
|
97
|
+
TextureUnitState* mTextureUnitState;
|
98
|
+
// Texture projector.
|
99
|
+
const Frustum* mTextureProjector;
|
100
|
+
// Texture sampler index.
|
101
|
+
unsigned short mTextureSamplerIndex;
|
102
|
+
// Texture sampler index.
|
103
|
+
GpuConstantType mTextureSamplerType;
|
104
|
+
// Vertex shader input texture coordinate type.
|
105
|
+
GpuConstantType mVSInTextureCoordinateType;
|
106
|
+
// Vertex shader output texture coordinates type.
|
107
|
+
GpuConstantType mVSOutTextureCoordinateType;
|
108
|
+
// Texture coordinates calculation method.
|
109
|
+
TexCoordCalcMethod mTexCoordCalcMethod;
|
110
|
+
// Texture matrix parameter.
|
111
|
+
UniformParameterPtr mTextureMatrix;
|
112
|
+
// Texture View Projection Image space matrix parameter.
|
113
|
+
UniformParameterPtr mTextureViewProjImageMatrix;
|
114
|
+
// Texture sampler parameter.
|
115
|
+
UniformParameterPtr mTextureSampler;
|
116
|
+
// Vertex shader input texture coordinates parameter.
|
117
|
+
ParameterPtr mVSInputTexCoord;
|
118
|
+
// Vertex shader output texture coordinates parameter.
|
119
|
+
ParameterPtr mVSOutputTexCoord;
|
120
|
+
// Pixel shader input texture coordinates parameter.
|
121
|
+
ParameterPtr mPSInputTexCoord;
|
109
122
|
};
|
110
123
|
|
111
124
|
typedef vector<TextureUnitParams>::type TextureUnitParamsList;
|
@@ -119,92 +132,79 @@ protected:
|
|
119
132
|
Set the number of texture units this texturing sub state has to handle.
|
120
133
|
@param count The number of texture unit states.
|
121
134
|
*/
|
122
|
-
void
|
135
|
+
void setTextureUnitCount(size_t count);
|
123
136
|
|
124
137
|
/**
|
125
138
|
Return the number of texture units this sub state handle.
|
126
139
|
*/
|
127
|
-
size_t
|
140
|
+
size_t getTextureUnitCount() const { return mTextureUnitParamsList.size(); }
|
128
141
|
|
129
142
|
/**
|
130
143
|
Set texture unit of a given stage index.
|
131
144
|
@param index The stage index of the given texture unit state.
|
132
145
|
@param textureUnitState The texture unit state to bound the the stage index.
|
133
146
|
*/
|
134
|
-
void
|
147
|
+
void setTextureUnit(unsigned short index, TextureUnitState* textureUnitState);
|
135
148
|
|
136
149
|
/**
|
137
150
|
@see SubRenderState::resolveParameters.
|
138
151
|
*/
|
139
|
-
virtual bool
|
152
|
+
virtual bool resolveParameters(ProgramSet* programSet);
|
140
153
|
|
141
154
|
/**
|
142
155
|
Internal method that resolves uniform parameters of the given texture unit parameters.
|
143
156
|
*/
|
144
|
-
|
157
|
+
bool resolveUniformParams(TextureUnitParams* textureUnitParams, ProgramSet* programSet);
|
145
158
|
|
146
159
|
/**
|
147
160
|
Internal method that resolves functions parameters of the given texture unit parameters.
|
148
161
|
*/
|
149
|
-
|
162
|
+
bool resolveFunctionsParams(TextureUnitParams* textureUnitParams, ProgramSet* programSet);
|
150
163
|
|
151
164
|
/**
|
152
165
|
@see SubRenderState::resolveDependencies.
|
153
166
|
*/
|
154
|
-
virtual bool
|
167
|
+
virtual bool resolveDependencies(ProgramSet* programSet);
|
155
168
|
|
156
169
|
/**
|
157
170
|
@see SubRenderState::addFunctionInvocations.
|
158
171
|
*/
|
159
|
-
virtual bool
|
172
|
+
virtual bool addFunctionInvocations(ProgramSet* programSet);
|
160
173
|
|
161
174
|
|
162
175
|
/**
|
163
176
|
Internal method that adds vertex shader functions invocations.
|
164
177
|
*/
|
165
|
-
bool
|
178
|
+
bool addVSFunctionInvocations(TextureUnitParams* textureUnitParams, Function* vsMain);
|
166
179
|
|
167
180
|
/**
|
168
181
|
Internal method that adds pixel shader functions invocations.
|
169
182
|
*/
|
170
|
-
bool
|
183
|
+
bool addPSFunctionInvocations(TextureUnitParams* textureUnitParams, Function* psMain, int& internalCounter);
|
171
184
|
|
172
185
|
/**
|
173
186
|
Adds the fragment shader code which samples the texel color in the texture
|
174
187
|
*/
|
175
|
-
virtual void
|
188
|
+
virtual void addPSSampleTexelInvocation(TextureUnitParams* textureUnitParams, Function* psMain,
|
176
189
|
const ParameterPtr& texel, int groupOrder, int& internalCounter);
|
177
190
|
|
178
|
-
virtual void
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
bool isAlphaArgument,
|
186
|
-
const int groupOrder,
|
187
|
-
int& internalCounter);
|
188
|
-
|
189
|
-
virtual void addPSBlendInvocations(Function* psMain,
|
190
|
-
ParameterPtr arg1,
|
191
|
-
ParameterPtr arg2,
|
192
|
-
ParameterPtr texel,
|
193
|
-
int samplerIndex,
|
194
|
-
const LayerBlendModeEx& blendMode,
|
195
|
-
const int groupOrder,
|
196
|
-
int& internalCounter,
|
197
|
-
int targetChannels);
|
191
|
+
virtual void addPSArgumentInvocations(Function* psMain, ParameterPtr arg, ParameterPtr texel,
|
192
|
+
int samplerIndex, LayerBlendSource blendSrc, const ColourValue& colourValue, Real alphaValue,
|
193
|
+
bool isAlphaArgument, const int groupOrder, int& internalCounter);
|
194
|
+
|
195
|
+
virtual void addPSBlendInvocations(Function* psMain, ParameterPtr arg1, ParameterPtr arg2,
|
196
|
+
ParameterPtr texel,int samplerIndex, const LayerBlendModeEx& blendMode,
|
197
|
+
const int groupOrder, int& internalCounter, int targetChannels);
|
198
198
|
|
199
199
|
/**
|
200
200
|
Determines the texture coordinates calculation method of the given texture unit state.
|
201
201
|
*/
|
202
|
-
TexCoordCalcMethod
|
202
|
+
TexCoordCalcMethod getTexCalcMethod(TextureUnitState* textureUnitState);
|
203
203
|
|
204
204
|
/**
|
205
205
|
Determines if the given texture unit state need to use texture transformation matrix..
|
206
206
|
*/
|
207
|
-
bool
|
207
|
+
bool needsTextureMatrix(TextureUnitState* textureUnitState);
|
208
208
|
|
209
209
|
/**
|
210
210
|
Determines whether a given texture unit needs to be processed by this srs
|
@@ -214,15 +214,24 @@ protected:
|
|
214
214
|
|
215
215
|
// Attributes.
|
216
216
|
protected:
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
UniformParameterPtr
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
217
|
+
// Texture units list.
|
218
|
+
TextureUnitParamsList mTextureUnitParamsList;
|
219
|
+
// World matrix parameter.
|
220
|
+
UniformParameterPtr mWorldMatrix;
|
221
|
+
// World inverse transpose matrix parameter.
|
222
|
+
UniformParameterPtr mWorldITMatrix;
|
223
|
+
// View matrix parameter.
|
224
|
+
UniformParameterPtr mViewMatrix;
|
225
|
+
// Vertex shader input normal parameter.
|
226
|
+
ParameterPtr mVSInputNormal;
|
227
|
+
// Vertex shader input position parameter.
|
228
|
+
ParameterPtr mVSInputPos;
|
229
|
+
// Pixel shader output colour.
|
230
|
+
ParameterPtr mPSOutDiffuse;
|
231
|
+
// Pixel shader diffuse colour.
|
232
|
+
ParameterPtr mPSDiffuse;
|
233
|
+
// Pixel shader specular colour.
|
234
|
+
ParameterPtr mPSSpecular;
|
226
235
|
};
|
227
236
|
|
228
237
|
|
@@ -237,17 +246,17 @@ public:
|
|
237
246
|
/**
|
238
247
|
@see SubRenderStateFactory::getType.
|
239
248
|
*/
|
240
|
-
virtual const String&
|
249
|
+
virtual const String& getType() const;
|
241
250
|
|
242
251
|
/**
|
243
252
|
@see SubRenderStateFactory::createInstance.
|
244
253
|
*/
|
245
|
-
virtual SubRenderState*
|
254
|
+
virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
|
246
255
|
|
247
256
|
/**
|
248
257
|
@see SubRenderStateFactory::writeInstance.
|
249
258
|
*/
|
250
|
-
virtual void
|
259
|
+
virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState, Pass* srcPass, Pass* dstPass);
|
251
260
|
|
252
261
|
|
253
262
|
protected:
|
@@ -255,7 +264,7 @@ protected:
|
|
255
264
|
/**
|
256
265
|
@see SubRenderStateFactory::createInstanceImpl.
|
257
266
|
*/
|
258
|
-
virtual SubRenderState*
|
267
|
+
virtual SubRenderState* createInstanceImpl();
|
259
268
|
|
260
269
|
|
261
270
|
};
|
@@ -54,22 +54,22 @@ public:
|
|
54
54
|
/**
|
55
55
|
@see SubRenderState::getType.
|
56
56
|
*/
|
57
|
-
virtual const String&
|
57
|
+
virtual const String& getType() const;
|
58
58
|
|
59
59
|
/**
|
60
60
|
@see SubRenderState::getExecutionOrder.
|
61
61
|
*/
|
62
|
-
virtual int
|
62
|
+
virtual int getExecutionOrder() const;
|
63
63
|
|
64
64
|
/**
|
65
65
|
@see SubRenderState::copyFrom.
|
66
66
|
*/
|
67
|
-
virtual void
|
67
|
+
virtual void copyFrom(const SubRenderState& rhs);
|
68
68
|
|
69
69
|
/**
|
70
70
|
@see SubRenderState::createCpuSubPrograms.
|
71
71
|
*/
|
72
|
-
virtual bool
|
72
|
+
virtual bool createCpuSubPrograms(ProgramSet* programSet);
|
73
73
|
|
74
74
|
|
75
75
|
static String Type;
|
@@ -87,24 +87,24 @@ public:
|
|
87
87
|
/**
|
88
88
|
@see SubRenderStateFactory::getType.
|
89
89
|
*/
|
90
|
-
virtual const String&
|
90
|
+
virtual const String& getType() const;
|
91
91
|
|
92
92
|
/**
|
93
93
|
@see SubRenderStateFactory::createInstance.
|
94
94
|
*/
|
95
|
-
virtual SubRenderState*
|
95
|
+
virtual SubRenderState* createInstance(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
|
96
96
|
|
97
97
|
/**
|
98
98
|
@see SubRenderStateFactory::writeInstance.
|
99
99
|
*/
|
100
|
-
virtual void
|
100
|
+
virtual void writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState, Pass* srcPass, Pass* dstPass);
|
101
101
|
|
102
102
|
protected:
|
103
103
|
|
104
104
|
/**
|
105
105
|
@see SubRenderStateFactory::createInstanceImpl.
|
106
106
|
*/
|
107
|
-
virtual SubRenderState*
|
107
|
+
virtual SubRenderState* createInstanceImpl();
|
108
108
|
|
109
109
|
|
110
110
|
|