Fresnel Displacement

   4436   6   0
User Avatar
Member
4 posts
Joined: March 2012
Offline
Hiya,

I have a problem in the shader, where I cannot multiply the noise used for displace along normal. It seems that whenever I connect the multiply everything breaks.

I only want the displacement to be along the blue not the red. There is the attached file and pictures for reference.

What's wrong with the setup? I'm sure it can be done this way.
:\

Attachments:
displacement_whole.png (549.9 KB)
displacement_not_working.png (540.1 KB)
fresnel_displacementProblem.hip (1.5 MB)

User Avatar
Member
9416 posts
Joined: July 2007
Offline
you cannot use I variable since it is not accessible in displacement context

but you can use P which is by default in camera space therefore acts as I for primary rays
so just plug P to your negate1 node, then connecting the complement1 to multiply3 will not produce any warning and shader will work as you expect

however for secondary rays it may not behave as you want
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
4 posts
Joined: March 2012
Offline
Thanks for the answer, I didn't know the I variable can't be displaced.

Hmm.. If I use P, will I still be able to get that “fresnel”-ing effect?
Like the blue on the outside and the reddish on the inside.

Also, by secondary rays, you mean the look of the weapon in some other geometry's reflection?
User Avatar
Member
9416 posts
Joined: July 2007
Offline
thinkSHEEP
Thanks for the answer, I didn't know the I variable can't be displaced. …?
if you place Global Variables node and change it's context type to Displacement you will not see any I variable

thinkSHEEP

Hmm.. If I use P, will I still be able to get that “fresnel”-ing effect?
Like the blue on the outside and the reddish on the inside.
yes, because P is in camera space so position of each sampled point will be vector from camera to that point so exactly what I represents
(it will be different for secondary rays however)

thinkSHEEP


Also, by secondary rays, you mean the look of the weapon in some other geometry's reflection?
exactly, or through refraction
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
4 posts
Joined: March 2012
Offline
Thanks tamte, it works fine now (:

Just a question though, what do you mean by
however for secondary rays it may not behave as you want
?

What will happen in the reflection/refraction?
User Avatar
Member
9416 posts
Joined: July 2007
Offline
the position will still represent ray from camera to shading point, however “I” would represent new, bounced ray which goes from previous shading point in reflected direction
so object in reflection by using P will not necessarily have falloff to edge but rather it would be the same falloff as from camera just looking at it from different angle
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
4 posts
Joined: March 2012
Offline
tamte
…however “I” would represent new, bounced ray which goes from previous shading point in reflected direction
so object in reflection by using P will not necessarily have falloff to edge but rather it would be the same falloff as from camera just looking at it from different angle

I don't really get it. Hmm.. is it possible to work out an example file from the file above?
  • Quick Links