Skip to main content
GameDev.net gamedev.net
🔒 Locked

Display Normals

Started by zinking May 21, 2009 at 8:30 AM 1 replies 900+ views
Original Post
zinking
zinking
RGB colors have range 0,255 but normal values could be negative float values if I directly out put the normal vector as color, what Happened to the final result I see are they automatically clamped?
sebbit
sebbit
If you don't render to a target that supports the full float range than yes, your values get clamped to [0, 1]. So you would have to transform them to that range beforehand (value + 1 / 2).
Jason Z
Jason Z
If you try to display all three colors at once it can be very difficult to
interpret what information is being conveyed.

I have found it useful in the past to display a single direction at a time when debugging. This lets you clearly see the directionality of the surface normal, and if you set things up to switch the axis that it displays to change every 1-2 seconds, then you get a very good picture of what is going on.

Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.