View Full Version : MEL a way to read light of an object
dan1el 07-25-2007, 06:46 PM Is there a way to read how much light a surface receives ?
see attached image.
Polygon cube, a camera and a spotlight (child of camera).
Now I'm interested in selecting those surfaces that don't receive any light (photon map ?) and perhaps delete them, to reduce file size and amount of vertices in the scene.
|
|
trancor
07-27-2007, 03:45 AM
Well, if the light is moving, the verts can't dynamicly be added and deleted.
But do you mean something like this?
http://upload.metal-asylum.net/cgtalk/bump.png
the alpha on the fade on thise (really bad image) is actually a light setting the fade.
If this is what you want to do, you need to link the light's Light Intensity to the Shader, not an object.
http://upload.metal-asylum.net/cgtalk/LightTrans.jpg
You can write a mel script to change and alter the verts of an object because of the light, but not deleting the polies.
trancor
07-27-2007, 04:18 AM
http://upload.metal-asylum.net/cgtalk/LightTransCorrect.jpg
I realized I messed up the hypergraph set up in the first post for the lighting. This should work though.
dan1el
07-27-2007, 02:08 PM
ok, so the shader tells if it's receiving any lights. can it tell which surface contains that shader which doesn't receive lights, then it could store the name and then delete it afterwards.
Is that correct understood ?
trancor
07-27-2007, 03:33 PM
If you turned every face on the object into their own objects, then yes, but not as one solid object.
You could try baking in vertex colors, and then selecting the verts/faces based on a given tolerance or set color. i.e. select all the black faces since they didn't get lit.
CGTalk Moderation
07-30-2007, 09:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.