Texture2D diffuseMap : register(t0); //The basic texture
Texture2D normalMap : register(t1); //The bump map thing
Texture2D displacementMap : register(t2); //For the tessellated ones
Texture2D effectMap : register(t3); //Each channel contains different info like: R/G/B/A:glow/waves/transparency/ect.
and I have one shader that I use for all geometry,where each model I render has a few bools:
bool tessellated;
bool glowing;
bool transparency;bool animated;
so for instance when I pass a model with animated == true and some bones,it does skinning in the vertex shader,otherwise it ignores the skinning part and carries on forward.I want to do the same thing with the textures - if it isn't tessellated and doesn't have glow or any special effects,I just set only the first 2 textures like this:
texturePointers[0] = material.diffuseMap;
texturePointers[1] = material.normalMap;
gD3DImmediateContext->PSSetShaderResources(0, 2, texturePointers);
And I ignore the glow and transparency calculation parts in the shader.
My question is - will that work?Because in the HLSL code it's written to expect 4 textures,however I don't want to waste time passing 4 when I'll only use 2 in some cases.