Jump to content
CinnamonMetal

Normals from Displacement ?

Recommended Posts

@davpe What is the difference between Displace Along Normal and Displace, if anything ?

Displace-Normal.png

Upon rendering, this branch of the material does not render the normal map as it's plugged into the N of the surfaceOutput vop ? 

Also, how do you add two displacements ? 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

that means you're doing something wrong :) don't know, try posting your scene. it certainly works for me...

Share this post


Link to post
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

Share this post


Link to post
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 ?

 

Share this post


Link to post
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? :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×