DirectX 9 floating point texture

Started by
1 comment, last by Alin Popescu 9 years, 9 months ago

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

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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

That's what I wanted. Great stuff, thanks.

This topic is closed to new replies.

Advertisement