Jump to content
  • Advertisement
Sign in to follow this  
multifractal

Sobel Filter Normal Map Issue

This topic is 1928 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

Hello,

In my quadtree each tile contains 32x32 vertices. Recently I have tried lighting each of these patches with a sobel filter and a 1024x1024 heightmap. Yet this heightmap takes too long to generate so I went down to 128x128 and the following was the result: 

pixelated.png

 

Which as you can see has a very flat-shaded type of look. Should I be generating a higher-resolution map for quads that are closer in distance? Or should I be averaging the normal vectors somehow?

Thanks for the input. 

Share this post


Link to post
Share on other sites
Advertisement

It would be worth a try turning on bilinear texture filtering (and don't forget to re-normalize in the pixel shader).

 

You only have 128/32 = 4 texels per vertex, though, which is really pretty minimal. If heightmap generation is the bottleneck, why not move that (and the sobel filter) onto the GPU?

Share this post


Link to post
Share on other sites

It would be worth a try turning on bilinear texture filtering (and don't forget to re-normalize in the pixel shader).

 

You only have 128/32 = 4 texels per vertex, though, which is really pretty minimal. If heightmap generation is the bottleneck, why not move that (and the sobel filter) onto the GPU?

Well it turns out the problem was caused by me leaving the texel size set to 1/1024 rather than 1/128... The heightmap is generated on the GPU using openCL currently and the sobel operator is implemented on the pixel shader. Using a size of 1024 for the heightmap caused very noticeable stutters every time a quad was split. How many times the resolution of the quad should the heightmap be? 

Thanks for the help..

Share this post


Link to post
Share on other sites

There's no hard-and-fast rule, but normal mapped detail tends to be cheaper than geometric detail.

 

I'm using 256x256 height/normal maps for each 17x17 chunk of vertices. 

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!