View Full Version : cut shadows into mesh
dutch_delight 11-04-2009, 05:42 PM Hi all,
I need to write a script that takes a spotlight/directional light and cuts a shadow into the target mesh. Any objects in front of the target mesh that casts a shadow onto the target mesh should be cut out as well.
I realise this may not be as easy as it sounds so if anyone can point me in the right direction of how to go about this would be much appreciated.
THanks
|
|
ivanisavich
11-04-2009, 07:49 PM
Get vectors from light source --> series of points along the perimeter of the object casting the shadow. Create rays from those vectors, and cast intersectrays from light source to shadowed surface. Cast enough rays to create a perimeter of points following the outline of the shadow area, then use those points to construct a spline. Then, extrude that spline and use a boolean operation to subtract it from the surface.
denisT
11-04-2009, 08:20 PM
Hi all,
I need to write a script that takes a spotlight/directional light and cuts a shadow into the target mesh. Any objects in front of the target mesh that casts a shadow onto the target mesh should be cut out as well.
may i ask you why you need to cut and what do want to cut? do you want to delete all nodes which are casting shadows onto the target?
dutch_delight
11-20-2009, 04:47 PM
Hey thanks for that. Seems like a 5 minute job. :)
I need to light a cityscape but texture budget is tight. I'm currently using lightmaps but there is a probabillity that this will not be viable and I will have to try and cut the shadows into the geometry. (it's for a game)
CGTalk Moderation
11-20-2009, 04:47 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.