Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

[HLSL+DX10] Sharp distort texture causes low fps

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've encountered a bizzare problem-if I use a non-blurred normal map to make fullscreen distortion I get low fps-but if I use a blurred texture (both are the same size) I don't get low fps??? Here is the hlsl code that offsets the UV coords based on the distortion (I must warn you that I am a beginner so I didn't look up at how "the pros" do this, but I think this is more or less it(?) )
// This will hold the UV offset once it will be retrived from the distortion texture
float2 uvOffset;
// Distortion multiplier
float offsetPower=0.1f;
// Here the distortion is retrived from the texture
float4 uvOffPower=2.0f*distMap.Sample(sampler1,input.texcoord)-1.0f;
// Distortion is scaled down a bit
uvOffPower*=offsetPower;
// Here the final UV coords are comuputed by adding the distortion to the original texcoords
uvOffset=float2(uvOffPower[0],uvOffPower[1])+input.texcoord;

Here is the image I use (if the entire image is like the left part I get low fps, but not if it is like the right part) Shrani.si Why??

Share this post


Link to post
Share on other sites
Advertisement
It’s hard to say from this shader code fragment and the screenshot. It may be related to the sampler settings you use to read from your texture. Do you have activated the anisotropic filter there?

Share this post


Link to post
Share on other sites
One possiblity:
The blurred texture is probably using the texture cache better. Since the Normalmap is blurred the UV's will tend to be more closer to each other and more likely to be in cache.

A run through PIX would probably verify this.

The textures are the same size but are they saved in the same format? DXT3, RGB, DXT5NM?

Share this post


Link to post
Share on other sites
I'll have a look into it with PIX.

I've changed the sampler from Anisotropic to min_mag_mip_linear and I don't get low fps anymore :P

Thanks for suggestions

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!