In MaterialX, is it possible to get the vector from the surface to a particular light? Right now, I'm creating an attribute in SOPs to store the information, then reading it as a geometry attribute in the shader. It works, but seems inelegant. I can get similar info from a dot node and putting "ray" in the note field. Maybe there is something similar for light direction?
I'm trying to create a shader where the color changes based on the relationship between the light position and surface normal. Kinda like 3dsMax's "shadow/light falloff".
Thanks!
Brad T.
MaterialX - Get light ray direction?
1772 4 0- BradThompson
- Member
- 67 posts
- Joined: 3月 2017
- Offline
- protozoan
- Member
- 1719 posts
- Joined: 3月 2009
- Offline
- jsmack
- Member
- 8045 posts
- Joined: 9月 2011
- Offline
BradThompson
In MaterialX, is it possible to get the vector from the surface to a particular light? Right now, I'm creating an attribute in SOPs to store the information, then reading it as a geometry attribute in the shader. It works, but seems inelegant. I can get similar info from a dot node and putting "ray" in the note field. Maybe there is something similar for light direction?
I'm trying to create a shader where the color changes based on the relationship between the light position and surface normal. Kinda like 3dsMax's "shadow/light falloff".
Thanks!
Brad T.
You can in a light shader. A surface shader doesn't know about values that are created at light shader evaluation time.
- tamte
- Member
- 8839 posts
- Joined: 7月 2007
- Offline
for what you are doing, you can probably use coordsys [www.sidefx.com] to access position of your light or any transformable prim
it's probably not as elegant as being able to access light directly by defining relationship or by path, but should be better than having to store primvars
if however you need per sample access to any light that the surface shader is evaluating, I'm not sure that's possible from surface shader as jsmack mentioned, since I believe there is no illuminance loop equivalent in Karma
it's probably not as elegant as being able to access light directly by defining relationship or by path, but should be better than having to store primvars
if however you need per sample access to any light that the surface shader is evaluating, I'm not sure that's possible from surface shader as jsmack mentioned, since I believe there is no illuminance loop equivalent in Karma
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- protean
- Member
- 73 posts
- Joined: 7月 2006
- Offline
Hi, I've been trying to do various things related to this. I can get coordsys to do what I need but there is a note in the docs:
Coordinate Systems works, as does a camera path but I haven't managed to get 'paths to an xformable prim' to work. Perhaps it's a syntax issue?
PARAMETERS
Space
The space to which the position should be transformed.
Karma supports paths to an xformable prim, or a camera. Also supported are Coordinate Systems.
Coordinate Systems works, as does a camera path but I haven't managed to get 'paths to an xformable prim' to work. Perhaps it's a syntax issue?
john @ goodbyekansas
-
- Quick Links