Very slow direct3D texture sampling

Posted by __dominic on Game Development See other posts from Game Development or by __dominic
Published on 2010-10-23T00:34:23Z Indexed on 2011/01/04 22:59 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

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.

© Game Development or respective owner

Related posts about textures

Related posts about directx