Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Emmit random light color from mesh light

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
pproestos
291 Views, 3 Replies

Emmit random light color from mesh light

I dont want to use the emission map.

I have three boxes attached all to gether to one single mesh.

I assign this to a mesh light.

I assign to the texture of the mesh light an OSL color switcher.

This method works to assign different color materials to a group

of objects.

How can I do a similar thing using mesh lighting?

I hope I explained it well..

thx.

image1.jpg

3 REPLIES 3
Message 2 of 4
madsd
in reply to: pproestos

Max 2020 file attached.

The 3 boxes are collapsed into 1 mesh, and each "element" is called ID:1 ID:2 ID:3
I droped down to Element in the mesh and clicked each one and gave them the numbers 1,2,3 in Material ID.
Source this ID with a Material ID node to 1 to 5 maps Index and set the colors R,G and B.
The boxes now sends out meshlight according the the array 3 first colors.

If you want them to flicker around between random colors, we setup a DCM modifier that injects a random float value, we can shuffle with the Arnold Jitter node, or by animating the DCM shuffle parameter.

4067-qweqwe.pngrgbboxlights.zip

Message 3 of 4
pproestos
in reply to: pproestos

You're a life savior @Mads God bless you prof...

I have totally ignored since now the existance of ID's.. 🙂

Again a BIG thanks 🙂

I will try also the dcm modifier...

And as I understand to have these objects also self illuminated, I have to assign

same osl node as emission color because light shape visible is always grayed out...

Message 4 of 4
madsd
in reply to: pproestos

That may be the case yes. but as you mention, you can use the same shader chain to pipe the the surface.
If you get stuck with the generation of Element ID for an animated shuffle let us know.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report