Commit 9a77f09d authored by cutealien's avatar cutealien

Fix shader example (thx @ Yoran for finding & fixing)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4097 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 5d18ec92
...@@ -105,11 +105,14 @@ public: ...@@ -105,11 +105,14 @@ public:
if (UseHighLevelShaders) if (UseHighLevelShaders)
{ {
services->setVertexShaderConstant("mTransWorld", world.pointer(), 16); services->setVertexShaderConstant("mTransWorld", world.pointer(), 16);
// set texture if(driver->getDriverType() == video::EDT_OPENGL)
f32 TextureLayerID = 0.0f; {
if (UseHighLevelShaders) // set texture
services->setVertexShaderConstant("myTexture", f32 TextureLayerID = 0.0f;
reinterpret_cast<f32*>(&TextureLayerID), 1); if (UseHighLevelShaders)
services->setPixelShaderConstant("myTexture",
reinterpret_cast<f32*>(&TextureLayerID), 1);
}
} }
else else
services->setVertexShaderConstant(world.pointer(), 10, 4); services->setVertexShaderConstant(world.pointer(), 10, 4);
......
...@@ -65,7 +65,7 @@ struct PS_OUTPUT ...@@ -65,7 +65,7 @@ struct PS_OUTPUT
}; };
sampler2D myTexture; sampler2D myTexture : register(s0);
PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0, PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0,
float4 Position : POSITION, float4 Position : POSITION,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment