Game Development Community

TGEInfiniteShadows

by Prairie Games · in Torque Game Engine · 03/12/2003 (2:23 am) · 20 replies

I've started work on adding Infinite Shadow Volumes to Torque...

The initial plan is to get them into interiors (where they will be most efficient/effective)... I will probably ignore self shadowing of DTS shapes for right now as this is pretty expensive...

I plan on extending SceneObjects (including Melv's fxLight) with shadow caster flags to control what lights/shapes generate shadows...

There can be multiple shadows cast per DTS depending on how many light sources are affecting it... and as light sources/objects move around the shadows will too... should be pretty cool

It might be possible for the interior to shadow itself... which would be quite fantastic... we'll see...

Now, wouldn't it be nice if max2dts supported exporting animated lights? :)

-J

#1
03/12/2003 (2:52 am)
Joshua,

I envy your freetime. :)

If you require any help at all with any of my stuff then don't hesitate to ask buddy.

- Melv.
#2
03/12/2003 (2:58 am)
This is where I typically come in and say, "You're the man, Joshua!", but I'm afraid I'll start to sound too redundant.

Awww, what the hell.

YOU'RE THE MAN, JOSHUA!!

It's awesome you're working on this. Good luck!
#3
03/12/2003 (4:30 am)
Joshua do you take a break? ;)


Well anyway great to see you working on all this cool stuff.
#4
03/12/2003 (5:43 am)
Joshua, before you get too deep into shadow volume generation, I _highly_ recommend checking out recent techniques for extruding the shadow volumes in vertex shaders. There's a couple good examples in the book 'ShaderX', and I'm sure you can find more around the internet.
#5
03/12/2003 (5:58 am)
@Melv: Thanks, btw why isn't fxLight in CVS? :)

@Mark: I'd rather stay away from vertex shaders...

Rock on!

-J
#6
03/12/2003 (6:06 am)
In that case, be sure to check out the ShadowVolumeBSP stuff in sceneLighting.cc - If you're dead set on doing the stuff on the CPU, you can probably use a lot of that work that's already in the engine.
#7
03/12/2003 (6:06 am)
Josh... wow, you never cease to amaze me.
Don't you have a life beyond programming? =)

good luck... can't wait to see results!
#8
03/12/2003 (6:33 am)
I bit off thread, but Mark where have you seen recommendations to use vertex shaders for shadows? I know it can be done, but it costs a LOT of power and requires degenerate polygons etc. At a recent nvidia conference they were saying for the moment it was a terribly wasteful technique.

I need to build a shadow implementation for another project and if i'm wrong with my assumptions i'll do it via vertex shaders... but it really does look like the lazy mans way out. Which is probably why I like it and Joshua doesn't ;)
#9
03/12/2003 (6:42 am)
As is usually the case in computer graphics, some situations it's good, some it ain't.

When you're dealing with static geometry and static lights, you should always precompute and store the Shadow Volume.

But when you're talking about dynamic lights/dynamic triangle soups (Like DTS models, say), generating the shadow volumes is probably going to be one of the signifigant bottlenecks in your engine. It's well worth offloading that processing onto the GPU when possible, even at the cost of a little extra fill rate and some bogus vertex transformations for the degenerates.

Plus, IMHO, it's the forward-looking technique. Cards are just getting better at transforming geometry every day, and I fully expect vertex shaders to become the standard way to do shadowing in the future. (At least until shadow maps take over, anyway.)

I should also point out that HW manufacturers have extra incentive to accelerate this technique in HW and drivers these days, since the latest 3D mark benchmark generates shadows this way.
#10
03/12/2003 (7:12 am)
Joshua,

I'll try to get them added soon, maybe this weekend.

- Melv.
#11
03/12/2003 (7:32 am)
@Melv, cool

If anyone is curious, the AMP II Demo is about what I would like to see... interiors self shadowing got me pretty excited...

I would like to look at dot3 for interiors too... but 6 things at a time are about my limit :)

-J
#12
03/12/2003 (7:33 am)
great. with all this new stuff my guys will be building discos instead of temples and dungeons.

=D
#13
03/12/2003 (7:43 am)
So you're saying a spinning disco ball prefab object would be a good thing to release to the community?

/duck

:)

Great work as usual Josh! :)
#14
03/12/2003 (7:50 am)
Just FYI,

DTS objects already cast shadows on the terrain, much like the interiors do, except it isn't lightmap based. They are cast just like the player shadows are cast. To get this working, in ShapeBase(I think) there is a variable called mGenerateShadow, this is false and needs to be changed to true. I'm not sure if there are other small changes like this, but that pretty much does it for static shapes.
#15
03/12/2003 (7:52 am)
@Robert: I'm going for something just a little better than that :)

-Josh
#16
03/12/2003 (8:26 am)
When this is fully implemented, will it allow for real-time shadows to be displayed with your Day/Night code? Or is that too much for this engine?
#17
09/01/2003 (5:00 pm)
Im really confused about the interiors knowledge about self and generated shadowmap, and DTS cant do that.
I started a thread before, please take a look at and give me a few exact lines about if you take a moment..

www.garagegames.com/mg/forums/result.thread.php?qt=12400

@Robert..Ur advise looks usable, but im still looking for the exact answer about the two object types differences. thx :)
#18
09/02/2003 (6:09 am)
@Rodney: Yep easily. Marble Blast already does this and it works very well.
#19
09/02/2003 (8:06 am)
Pat, do you know if that has been made a resource or part of the engine (real time shadows)?
#20
09/02/2003 (8:23 am)
No it hasn't.