Very slow direct3D texture sampling
- by __dominic
Hi,
So I'm writing a small game using Direct3D 9 and I'm using multitexturing for the terrain. All I'm doing is sampling 3 textures and a blend map and getting the overall color from the three textures based on the color channels from the blend map. Anyway, I am getting a massive frame rate drop when I sample more than 1 texture, I'm going from 120+ fps to just under 50.
This is the HLSL code responsible for the slow down:
float3 ground = tex2D(GroundTex, multiTex).rgb;
float3 stone = tex2D(StoneTex, multiTex).rgb;
float3 grass = tex2D(GrassTex, multiTex).rgb;
float3 blend = tex2D(BlendMapTex, blendMap).rgb;
Am I doing it wrong ? If anyone has any info or tips about texture sampling or anything, that would be nice.
Thanks.