Rendering to 32bit Float texture

Started by
1 comment, last by RobM 2 years, 4 months ago

Simple one. I'm rendering to a 32bit floating point texture for my terrain - I'm essentially trying to have a levelling function where I can set the terrain to a particular height. For the life of me I can't understand why I'm getting really weird results.

In the pixel shader, my return type is float4 and I'm just returning a single float, like 50 for instance. Is this not the correct way to do it? Funnily enough, I've implemented my raise/lower function and that works perfectly but that uses alpha when rendering to build up the layers. There I'm just returning a float and it works fine.

Can I just return a value like 50 in the pixel shader and it should write 50 in the texture? Or does it need to be in the range 0..1?

Advertisement

@RobM Fixed, it was a schoolboy error, I was leaving some alpha blend state prior to running the shader which was messing up the values…

This topic is closed to new replies.

Advertisement