wes Posted August 6, 2003 Share Posted August 6, 2003 1. For light and shadow context, is L the vector from Ps to P, or P to Ps? 2. Is the vex function frontface() the same as prman's faceforward()? I get a little bit confused... Quote Link to comment Share on other sites More sharing options...
anakin78z Posted August 6, 2003 Share Posted August 6, 2003 from the docs: L: The vector from the point on the surface to the light source. The length of this vector represents the distance to the light source. Initialization of the L Variable In the Light and Shadow contexts, the P variable represents the position of the light source and the Ps variable represents the position of the surface point being shaded. In Houdini, lights can have either perspective or orthographic projections. An orthographic light in Houdini is used to represent an infinite (or very distant) light source which has all the light rays parallel with each other. A perspective light acts more as a point light source. When a perspective light shader runs, the L variable is initialized as follows: L = P - Ps; Orthographic lights, on the other hand, are initialized so that the direction of L is the same for each light ray eminating from the light source. L = Lz * dot(Lz, P - Ps); Where Lz represents the normalized "z-axis" of the light source (i.e. a unit vector pointing down the z-axis in the space of the light). Thus, the scale of the L variable will be the orthographic distance from the plane of the light source and the surface point being shaded. In a light shader, it is possible to change the L variable to any value you choose. However, this is how the L variable is initialized. Quote Link to comment Share on other sites More sharing options...
wes Posted August 6, 2003 Author Share Posted August 6, 2003 thanks, anakin78z... L is from Ps to P, it's true for surface, displacement, fog,...I get confused because for photon context, L is from light position to the surface point, and in renderman, L is from P to Ps for light shaders. So, I wanna make sure if L is from Ps to P or P to Ps in vex light & shadow contexts. Can someone give an direct answer? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted August 6, 2003 Share Posted August 6, 2003 err... L = P - Ps ... If you try a simple test in houdini, you'll find that it means that the vector is from Ps to P. bye, Jens Quote Link to comment Share on other sites More sharing options...
wes Posted August 7, 2003 Author Share Posted August 7, 2003 oh, my question sounds stupid to u, sorry for that. I really appreciate u took the time to answer me. Thanks! :> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.