Jump to content

Rendering World Normals in range -1 to 1


kensonuken

Recommended Posts

I am working on relighting stuff and when I render out bent normal Im getting the values which are in range 0-1 rather than -1 to 1

whats the process to get this ?

Hi Kensonuken,

At first guess, I wonder if you're rendering to 8bit. Check your quantinization settings.

cheers,

-j

Link to comment
Share on other sites

Mario Im talking about worldspace normals instead of camera space...

It doesn't matter which space you're talking about, what I said applies to *all* vectors (positional, directional or normal) in *any* space -- they will all have real-valued components (that means big-R Real numbers, which means [-inf,+inf]).

Please check the pixel values I couldnt find any negative value in it..

Well, yes, you're getting positive-valued components in your rendered normals, but the reason is entirely attributable to "operator error" rather than some flaw in the occlusion function. Here are some of the flaws I caught after a very quick look ("very quick" only because I find it very time consuming to wade through a forest of spaghetti VOP connections and temporary variables):

1. Angles are supposed to be in *radians*, and in the case of a sampling cone, it refers to the half-angle.

2. You set the Transform VOP's "Interpretation" parameter to "Position", when it should have been "Normal" (you're transforming normals, not positions -- they are different animals when it comes to transformations). This was your biggest problem.

Here's the bent normal output with your original shader (and yes, it's clearly "wrong"):

post-148-1232038720_thumb.jpg

And here it is with those changes. (it *does* have negative-valued components as you would expect, but I've remapped them to be positive for display purposes only).

post-148-1232038724_thumb.jpg

And here's your hip file with the modifications:

bent_send_mgm.hipnc

I didn't even look at the rest of the shader, so there might well be other little bombs lurking in there. I only looked at the VOPs involved in the bent-normal calculation.

Cheers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...