Jump to content

Normals from Displacement ?


CinnamonMetal

Recommended Posts

the first displacement is computing object space normal out of a height map. the resulting normal is then converted to a tangent space normal (with a bind export called Ntangent - use that to render the normal map as an aov). Tangent space normal map goes to the second displacement set to mode Normal which again converts the tangent space normal to the object space to be used in shader. Of course typically you don't do this kind of conversion in your actual shader, you just use a height map or a normal map with a single displace node. this is just an example how you'd go about converting height to normal.

two displacements can be used simply by combining two textures before connecting it to a displacement node.

displace has more functionality compared to simple Displace along mormal. Drop down both nodes, look at its parameters and you'll see the difference.

Link to comment
Share on other sites

I take my displace along normal, plug that into the computeTangents VOP, plug that into the TangentNormal followed by into the displace vop. Then into both a bind export, for a custom tangent normal pass and into the normals of the surfaceOutput.  Although when rendering my custom TangentNormal pass, it renders black ?

Link to comment
Share on other sites

hi, there was more issues in your file. first of all, the bind VOP. the attached picture is pretty explanatory at this point, i hope :) then, your tangentnormal VOP did not have any input normal connected and also, tangent style must be set to "Use connected utan, vtan" (which are supplied by the computetan VOP wired to it, by the way). third, in this case your displace2 VOP must be set to "Normal" mode of operation because there is a tangent normal as an input value.

and the last thing, I just don't understand what are you trying to do :) first, you use the displace along normal node to compute displaced normal in object space. then you're doing some math to convert that normal into a tangent space, only to have it connected into another displace node that will finally convert it back to the object space before it's connected to the output N. this doesn't make any sense man. that conversion is completely redundant :) why didn't you simply use the first displace VOP's normal for the surface output? 

nfix_jog.thumb.jpg.0208168748435ffe3a4e5da4e6739faa.jpg

 

cheers.

A_Shader_fix.hipnc

Edited by davpe
Link to comment
Share on other sites

4 hours ago, davpe said:

your tangentnormal VOP did not have any input normal connected and also, tangent style must be set to "Use connected utan, vtan"

What is the difference between the default within the tangentNormal VOP ?

4 hours ago, davpe said:

and the last thing, I just don't understand what are you trying to do :) first, you use the displace along normal node to compute displaced normal in object space. then you're doing some math to convert that normal into a tangent space, only to have it connected into another displace node that will finally convert it back to the object space before it's connected to the output N. this doesn't make any sense man. that conversion is completely redundant :) why didn't you simply use the first displace VOP's normal for the surface output? 

Do you mean take the displaceAlongNormal VOP and it's Normal and plug that directly into the N for surface output, if so; good point. :) Although my ExtraImage Plane Pass still renders black ?

If the export in Context from within the bind export node was set to displacements rather then surface; it could export a displacement pass; if I understand this correctly ?

 

Link to comment
Share on other sites

the difference is the input data from which tangent normals are calculated. by default i think it looks at uv coords. read the docs for details.

yes, that's exactly what i mean. just plug the displaced N into the output. it renders as expected for me, look at the picture i posted.

honestly, i don't know much about how different contexts work. but generally if you want to export any image plane data (including displacement pass) you always use Surface. at least i never had to change it. maybe again, read the docs, for more info? :)

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