Add ramp to Dome light

   1128   2   0
User Avatar
Member
2 posts
Joined: July 2020
Offline
Hey,
I know this might be a beginner question, but I'm having trouble finding information on how to add a ramp or other procedural texture to a dome light with Karma.
User Avatar
Member
1748 posts
Joined: May 2006
Online
Good question!

19.5 added light material nodes, so you can do gobos, gels, projections. I've used it in spotlights and area lights, but never thought to try it in dome lights.

It kind of works, but it's likely I'm missing a trick. You need to get uv coordinates from the light, which look like this for a spotlight:



If you do the same for a domelight, the uv coordinates are weird; it projects two infinite planes that face each other, one of them upside down:



You can swap the texture for a ramp, having seen the previous image, this odd result makes sense, the left side has the ramp going from bottom to top, the right from top to bottom:



I've played around a bit with the various nodes and options in the light filter library context, I couldn't find anything that'd give you what you need, basically polar coordinates. As far as I can tell all the other mtlx nodes to return position, normals, tangents etc are expecting geometry, not an infinite light source, so they return the domelight's pivot at best, nothing or garbage values at worst.

The best I could do was to fix the upside down bit, and squeeze the uv's so that the values returned are more reasonable. This gives you a ramp that almost looks usable, but not really:




Anyway, I've attached a hip, but I'm quietly hoping one of the karma devs will either go 'dur matt, use this node', or 'dur matt, we've added a node to the next daily build'.


Image Not Found

Attachments:
gel_spotlight.PNG (328.4 KB)
gel_domelight.PNG (1.1 MB)
domelight_ramp.PNG (467.0 KB)
dome_ramp_fiddled.PNG (539.8 KB)
lops_domelight_ramp.hip (600.8 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
2 posts
Joined: July 2020
Offline
Thanks for this detailed answer, I will try this method
  • Quick Links