Jump to content

Mantra occasional zero-normals causing NANs


Recommended Posts

Hey all. I've got a shader built in Houdini 11, which causes occasional NAN (black pixel) errors in my render, and I've traced it back to the normalized normal and normalized incident vectors going into a fresnel node, and in turn a rayhit. When either of the normalize nodes kicks out a zero normal (I presume because it can't normalize them), it kicks out a nasty pixel... and it's random, another time it'll render just fine.

Is there any neat efficient way of catching rogue normals, or do I just have to run a check on their length, and two-way-switch them with a random normal when they're missing?

Seems a little messy having a bunch of extra nodes just to catch for that.

Link to comment
Share on other sites

How about you add a tiny tiny tiny component to every normal?

Hehe, that may be a less computationally expensive way I guess :-)

My catch-missing-normals nodes seem to work okay anyway, most/all NANs are countered, and the ones that slip through don't appear to cause black pixels any more. It doesn't add that much to the render time either...

...but I might switch it out for this to neaten things up.

Thanks for the suggestion!

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...