• Advertisement
Sign in to follow this  

DirectX 9 floating point texture

This topic is 1284 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 would like to draw a textured full screen quad into the color buffer with alpha blending enabled to achieve lighting and shadowing of the color buffer. I have a FX file where I set AlphaBlendEnable = true, SrcBlend = DestColor and DestBlend = Zero to multiply the textured quad with the color buffer.

So far I have only achieved shadowing of the color buffer, but I would like to achieve lighting as well, that is for values in the texture bigger than 1.0, the values in the color buffer will be brightened.

For this I tried to use floating point textures to blend them with the color buffer, but for some reason the values in the texture get clamped to 1.0.

Do you know what texture format to use so that when blending with the color buffer I have values bigger than 1.0 in the texture?

Thank you, Alin

Share this post


Link to post
Share on other sites
Advertisement

An alternative is to use SrcBlend = DestColor and DestBlend = SrcColor and use a baseline of 0.5 - that way you don't need a FP texture (use baseline of 128 for a regular 0-255 range) and can get up to double brightness, saving a good deal of bandwidth and video RAM while you're at it.

Share this post


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

  • Advertisement