How to pass more than one??
method "node->getMaterial(0).Texture2 = driver->getTexture"test.tga");"
doesn't work.
More than one texture to shader
I found solution, but it works only for OpenGL, which is on my computer
much slower than DirectX.
int a = 0;
services->setPixelShaderConstant("tex0", (const float*)&a, 1);
int b = 1;
services->setPixelShaderConstant("tex1", (const float*)&b, 1);
int c = 2;
services->setPixelShaderConstant("tex2", (const float*)&c, 1);
in shader, you use:
uniform sampler2D tex0, tex1, tex2;
much slower than DirectX.
int a = 0;
services->setPixelShaderConstant("tex0", (const float*)&a, 1);
int b = 1;
services->setPixelShaderConstant("tex1", (const float*)&b, 1);
int c = 2;
services->setPixelShaderConstant("tex2", (const float*)&c, 1);
in shader, you use:
uniform sampler2D tex0, tex1, tex2;
for directX, multitexture your object using the Texture1 2 3 and 4 members.
In the shader put:
Thats should work, it does here. Thanks to omaremad for that one
In the shader put:
Code: Select all
sampler2D tex0 : register(s0);
sampler2D tex1 : register(s1);