Using noise texture on a geometry light

   10561   9   4
User Avatar
Member
54 posts
Joined: Oct. 2011
Offline
Hello Houdini users,
I'm trying to figureout how to create a geometry light and effecting the light intensity over an object with noise. How would I set that up?

Attachments:
noisy light.PNG (45.1 KB)

User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Sneaky this file is… It uses a custom surface shader with procedural noise feeding in to a user-defined vector Ce export variable.

Fair warning: In Houdini12.0 and 12.1, emitting light from geometry will generate far more noise than using plain area lights. Hopefully this will get better in future releases. You really need to crank up the primary samples up to 12x12, 16x16 or higher to reduce noise.

To completely understand emission from geoemtry, you first need to cover the default ways to have geometry emit light. There are two main ways to get geometry to emit light.

The first option is to use the Geometry Light shelf tool, select your geometry to emit light from and press Enter. This turns the display flag off for your geometry object and sets up the basic light to be a geometry light. You can specify an emission map which will require uv's on your geometry but this is one way to control what light is emitted and how strong.

The second option is to export a vector type called Ce for Color emissive in your surface shader. This is done with a Parameter VOP with a name set to Ce, label usually left blank and of type vector (color will do nicely) and set the Exoprt flag and the invisible flag to true.

Mantra will look to see if there is a Ce export parameter and if there is one, the surface will automatically emit light if you are raytracing (raytrace and pbr render engines). It will treat this geometry as a light emitter.

The default Mantra Surface has an Emissive Tab that allows you to set a constant emissive colour for your geometry. This also allows you to specify a constant colour modulated by a texture map and again uv's must be present on the geometry to use the map properly.

How this works is buried in the Surface Model VOP. Inside this VOP, there is a parameter called “parameter1” which very poorly named. I had to troll trough the generated vex code to find this (well in vim this takes ~3 secs after writing it to disk). It really should be named Ce, or EXPORT__Ce or OUT__Ce… This Parameter is used to explicitly export Ce. It uses two inputs: one with the parameter vector Color for Ce and the output from SSS. The author of the shader is presuming that SSS would contribute to emission. Fine.

—-

Now for the custom shader to emit Ce to mock the attached image.

For this you can roll your own shader explicitly to set Ce. If you want to use the Surface Model asset in your shader, you will have to bust it open and hack away at Ce to use a procedural texture.

or

Create your own specific emission shader.

See the attached Houdini scene file for some examples. Note that the Environment Light is there just to get Mantra to render the scene as it will default to the headlight which will blow out the emissive geometry contribution.

Attachments:
emissive_geometry_shaders.jpg (12.6 KB)
emissive_geometry_shaders.hip (1.8 MB)

There's at least one school like the old school!
User Avatar
Member
54 posts
Joined: Oct. 2011
Offline
Jeff, thank you for this. This is extremely helpful. Where did you find out this information?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I walked over to the developers desk and he told me about the Ce export feature and I figured it out. Whipped up a few files to see how far it could be pushed, just like i whipped up this file here just to make sure everything still works.

I believe this was H11.0, so about two years or so ago…

Good question btw. I've been wanting to create a straight forward example.

There is also a good video by said developer, Andrew Clinton here where he covers this briefly:
http://www.sidefx.com/index.php?option=com_content&task=view&id=1412&Itemid=344 [sidefx.com]

and the most recent master class on Mantra is worth a watch as well:
http://www.sidefx.com/index.php?option=com_content&task=view&id=2160&Itemid=344 [sidefx.com]
There's at least one school like the old school!
User Avatar
Member
390 posts
Joined: Jan. 2012
Offline
this is awesome jeff, thank you. question though.. in exporting ce, is there anyway to control anything about the light? for example, if i wanted it to have physically correct attenuation, is there anyway to tell mantra to do this?
.
User Avatar
Member
21 posts
Joined: Dec. 2008
Offline
have a look at this:
http://ihoudini.blogspot.ca/2009/08/particle-motion-blur-again-and-some.html [ihoudini.blogspot.ca]
It's a much better and faster way of creating lights, and no grainy renders…
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
That would be point light instancing and yes it would instance real physical lights where you can control the light properties and less noise.

To adapt this to a textured material, the same shader algorithm needs to be applied to the points of the geometry with Cd attribute and then scatter points in to Cd as the weight. Next enable point instancing on the object and supply your light to the instance field. You need to use the Edit Render Parameters on the Object to add the Instance parameters. Just use the keyword inst in the bottom search field for the Render Parms in the Edit Parameter Interface dialog to find these parameters quickly.

You don't need to use the Instance procedural btw. Just straight up point instancing.

But executed right, geometry light emission just has that extra little bit of specialness to it. For production at this time, absolutely use point light instancing. For personal work where time isn't as critical, give the light surface emission a whirl as a separate pass.
There's at least one school like the old school!
User Avatar
Member
330 posts
Joined: July 2007
Offline
thanks again !
except the things that cannot be seen , nothing is like it seems .
User Avatar
Member
373 posts
Joined: March 2009
Offline
According to the help file, a geometry light (using shelf tool) should be able to pick up the shader and export color if it has a Ce. “ it uses the object’s surface shader to color the emitted light.” and “Tip: get geometry lights to emit color based on their assigned surface shader, you need to define an export variable named Ce. This holds the emitted light.”

I can't seem to get a geometry light to pick up the color of the surface at all. Is the only way to get it working by usine Ce and not using a geometry light object (just using the original object)? I'm hoping to use caustics from the geometry light, while picking up the proper color of the geometry light as well, and I can't figure how to get that all working. I would prefer via photon map, not via brute force path tracing, but understand if that's how it has to be done. Anybody have any info / ideas?
Ian Farnsworth
User Avatar
Member
373 posts
Joined: March 2009
Offline
I think I figured it out. The shader needs to be applied to the geometry light to work as well. It then takes Ce as it's input for light values.
Ian Farnsworth
  • Quick Links