Hi
I need the transformed world position of a distant light in my karma material, not just the TX/TY/TZ
how can I get it?
thx
kuszi
How to get the world position of a light in Karma material
479 5 1- kuszi
- Member
- 9 posts
- Joined: Aug. 2020
- Offline
- jsmack
- Member
- 7771 posts
- Joined: Sept. 2011
- Offline
- kuszi
- Member
- 9 posts
- Joined: Aug. 2020
- Offline
- freshbaked
- Member
- 82 posts
- Joined: June 2020
- Offline
- jsmack
- Member
- 7771 posts
- Joined: Sept. 2011
- Offline
freshbakedI need the transformed world position of a distant light in my karma material, not just the TX/TY/TZ
Can't you do this with a coordsys to the get the position of the shading point in light space, then transform to world space?
You can certainly pass information about the light to the material, but there is no mechanism for the material to evaluate the light shader directly. You would have to re-implement everything about the light's shading in your material, but you wouldn't be able to find out how much light is hitting because you can't calculate shadowing. From the original question, for a distant light, calculating the amount of light hitting an object while ignoring shadowing is easy, it's always 100% of the light intensity.
Edited by jsmack - Feb. 27, 2024 12:24:09
- kuszi
- Member
- 9 posts
- Joined: Aug. 2020
- Offline
Thank you everyone for the answers
I think I made a wrong question.
In unreal I have a light, and an object.
I know exactly the light position, so with a simple dotproduct I can calculate the angle between the light and the surf pos.
Btw, because my light is only translated and rotated, I simply put this math into the shader and it is working (not the best solution) as you can see on the attached image, where the final dotproduct is connected into the emission
I think I made a wrong question.
In unreal I have a light, and an object.
I know exactly the light position, so with a simple dotproduct I can calculate the angle between the light and the surf pos.
Btw, because my light is only translated and rotated, I simply put this math into the shader and it is working (not the best solution) as you can see on the attached image, where the final dotproduct is connected into the emission
Image Not Found
-
- Quick Links