Mantra Light Shaders

   2066   30   2
User Avatar
Member
3841 posts
Joined: Sept. 2011
Offline
singhharry12
I think everything I needed was from the evalbsdf function. Sample functions are only needed for discreet samples (ray tracing). Since light shaders are continuous function, we only care about power scale in a given direction which is what the ‘eval’ argument of the evalbsdf function is. It may to be scaled by the pdf though, which is another argument of the same function.

This was my theory, and I remember getting it to work before, but for some reason the light output seems uniform in all directions even when passing ‘L’ and ‘Lz’ to the eval bsdf function. I must be doing something wrong.
User Avatar
Member
47 posts
Joined: April 2019
Offline
I just found a parameter that made things way easier! Use __illuminateangle! It takes an angle and focuses the light(but not its rays)! The only thing is, it give you a sharp cutoff so you may need to smooth Cl edges. I've kinda done it with smooth function but it doesn't look right if you make it fully directional, it loses the energy. If we can find a way to focus those rays in this direction, I bet it should be all needed
Edited by YasinH - Aug. 19, 2020 15:07:44
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
47 posts
Joined: April 2019
Offline
Here are some test renders showing the issues at almost fully directional angle.

No smoothing, pure __illuminateangle. It has a strange cone shape to it instead of being rectangular. Any idea why?


With smoothing. The intensity decreases a lot but increasing back up afterwards, poses a lot of noise issues! Would be good to know if there is a way to address this too.
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
3841 posts
Joined: Sept. 2011
Offline
YasinH
Here are some test renders showing the issues at almost fully directional angle.

No smoothing, pure __illuminateangle. It has a strange cone shape to it instead of being rectangular. Any idea why?


With smoothing. The intensity decreases a lot but increasing back up afterwards, poses a lot of noise issues! Would be good to know if there is a way to address this too.

I think illuminate angle is just used in conjunction with the spotlight shader to limit evaluation outside of the cone. It doesn't affect the power distribution.
User Avatar
Member
47 posts
Joined: April 2019
Offline
Yeah, that seems to be the case. Is there any way to somehow fake the power with this approach? Otherwise, it doesn't seem like there is any other way to implement the directionality…
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
3841 posts
Joined: Sept. 2011
Offline
YasinH
Yeah, that seems to be the case. Is there any way to somehow fake the power with this approach? Otherwise, it doesn't seem like there is any other way to implement the directionality…

I've created custom IES profiles to simulate directionality recently when I had to match VRAY renders which were making heavy use of directionality.

An IES profile is just a 1D image, so any ramp can be used to make one.
User Avatar
Member
47 posts
Joined: April 2019
Offline
jsmack
YasinH
Yeah, that seems to be the case. Is there any way to somehow fake the power with this approach? Otherwise, it doesn't seem like there is any other way to implement the directionality…

I've created custom IES profiles to simulate directionality recently when I had to match VRAY renders which were making heavy use of directionality.

An IES profile is just a 1D image, so any ramp can be used to make one.
How would you change the angle on IES profiles though? Did you make different profiles for different angles, or do you mean to simply plug a ramp to environment?
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
3841 posts
Joined: Sept. 2011
Offline
YasinH
jsmack
YasinH
Yeah, that seems to be the case. Is there any way to somehow fake the power with this approach? Otherwise, it doesn't seem like there is any other way to implement the directionality…

I've created custom IES profiles to simulate directionality recently when I had to match VRAY renders which were making heavy use of directionality.

An IES profile is just a 1D image, so any ramp can be used to make one.
How would you change the angle on IES profiles though? Did you make different profiles for different angles, or do you mean to simply plug a ramp to environment?

I made a profile for each directionality value I needed.
User Avatar
Member
47 posts
Joined: April 2019
Offline
jsmack
YasinH
jsmack
YasinH
Yeah, that seems to be the case. Is there any way to somehow fake the power with this approach? Otherwise, it doesn't seem like there is any other way to implement the directionality…

I've created custom IES profiles to simulate directionality recently when I had to match VRAY renders which were making heavy use of directionality.

An IES profile is just a 1D image, so any ramp can be used to make one.
How would you change the angle on IES profiles though? Did you make different profiles for different angles, or do you mean to simply plug a ramp to environment?

I made a profile for each directionality value I needed.
That's a good idea but how would you deal with light scaling when using IES profiles? You can't really shape the light with them.
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
User Avatar
Member
3841 posts
Joined: Sept. 2011
Offline
what do you mean by ‘light scaling’? An ies profile maps the light's intensity to the angle from its local z axis. Same as using a function to do the same in a light shader. The profile just has it ‘baked’.
User Avatar
Member
47 posts
Joined: April 2019
Offline
jsmack
what do you mean by ‘light scaling’? An ies profile maps the light's intensity to the angle from its local z axis. Same as using a function to do the same in a light shader. The profile just has it ‘baked’.
Oh I didn't know Mantra actually respects light scale when using IES lights! Sometimes renderers hard-code the scale to the profile. This made the approach more sensible now. Now I need to figure out how to make custom IES profiles that matches with directionality…
VFX Supervisor / CG Artist - Available for freelance

http://yasinhasanian.com/ [yasinhasanian.com]
  • Quick Links