Jump to content
  • Advertisement
Sign in to follow this  
Aph3x

texture2D bias not working?

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

Hi all, I'm trying to simulate scattered light in my reflective shader, which I gather can be done by biasing the mip level in the texture read. Whatever bias value I use in the shader seems to be ignored though. I'm using gluBuild2DMipmaps on texture load, and just a texture2D() call in the shader. Also tried texture2DLod, which is also ignored. Any ideas anyone?

Share this post


Link to post
Share on other sites
Advertisement
AFAIK texture2DLod will not work in the FS unless you have the GL_EXT_gpu_shader4 extension, which is GF8 series and newer. So you may have to use dFdx and dFdx functions to calculate it yourself. texture2D will automatically calculate the level of mipmapping for you, but I am under the assumption you want to change that level based on what you would like to see vs. the automatically level...

Share this post


Link to post
Share on other sites
hi Mars,

Yeah - I want to sample from a smaller mip level to get a more 'blurred' level.
In all the literature I read, the texture2D function can take an optional bias parameter that should be added on to the (auto-)calculated mip level.

How would the derivative functions be used in my case?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!