PDA

View Full Version : Point Ray-Casting for Characters


LittlePenny
23-Jul-2002, 17:55
Ok, I am going to post of few ideas I have had because I wasn't sure how stupid they were, but I have reached to the conclusion to just screw it and let you guys decide.

Lets begin with my superior artwork!
http://web.umr.edu/~buechler/B3d/ray.GIF
When doing outdoor scenes, how about having a point follow you character around. This point would then cast out rays which could help tell where to place shadows and reflections.

The point position would of course depend on the time of day. But the interesting part of this is shadows could fade by using eigenvector decomposition. So if you are standing on a cliff there wouldn't be a huge dark shadow all the way down. Plus if it were dusk and street lights were just coming on, you could use point ray casting on the street lights and do basic ray interference calculations to project 3 shadows.

Oh and you could put cubes around your points. And when two cubes intersect thats when you would start doing the ray calculations. Kind of like how collision detection is done.

LittlePenny
23-Jul-2002, 20:05
http://web.umr.edu/~buechler/B3d/ray2.GIF
Blah, I was off about when dealing with light from the sun. If we used a point to cast the rays it would create a huge shadow. Instead it would require a ray field projecting from two sides of a cube.

MDolenc
24-Jul-2002, 08:11
This is how shadow volumes are done (ala Doom 3).

LittlePenny
24-Jul-2002, 12:49
No shit? Well, I certainly wouldn't mind hearing from someone else then how this is implementable. As far as I know, Doom3 is an indoor game, so why would they need a always shadowed character?

MDolenc
24-Jul-2002, 14:47
Doom 3 basically has one vector (center of point light for point lights) and then finds outline of given model in correlation with light position and then casts this outline very far away (and do some stencil operations along the way).

LittlePenny
24-Jul-2002, 17:23
Can the resultant shadow of two light sources be calculated with his method?

MDolenc
24-Jul-2002, 18:51
Yes. You cast first shadow and add light contribution to areas with stencil==0 then clear stencil and start it again.