Jump to content

simple questions for vex


wes

Recommended Posts

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.

Link to comment
Share on other sites

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.

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