Game Development Community

How to get .dts objects to self shadow and prelit like .difs

by William Freeman · in Game Design and Creative Issues · 04/30/2008 (12:08 am) · 4 replies

I've looked all over for an answer to this, and I just can't seem to find one.

I just noticed the other day that a .dts file included in a .dif will cast prelit shadows and selfshadow just as a .dif brush will.

Question is, why can't we do this with .dts files all by there lonesome?

I've implemented the Polysoup collision code for 1.5.2 and it works incredibly well I've had hundreds of thousands of polygons going all using poly accurate collisions, including concave surfaces and got 50 fps out of it. I know that .difs have advantages in terms of portals and simplified collisions, but I havn't hit the limit yet where I'm willing to suffer through creating them. My art pipeline is based on Maya and I want to keep it that way.

So. Does any one know of a post that shows that a .dts can be considered in light mapping? Obviously included .dts files in a .dif are, so why not have it work without the .dif?

Alternatively, do any guru's out there know where I'd go in the engine code to add static .dts files to the light map?

Any help is greatly appreciated.

Colin

#1
06/14/2008 (11:00 pm)
I think there is an old stencil shadow resource that may have supported self-shadowing, but it's not drop-in compatible with TGE 1.5. It was written for 1.3 maybe, so before TLK was added.
#2
06/16/2008 (11:46 am)
You can do this in TGEA by enabling polysoup collision for a static shape.
#3
07/08/2008 (7:01 am)
At the top of shadow.cc you can edit the line:

U32 Shadow::smShadowMask = TerrainObjectType | InteriorObjectType | ShapeBaseObjectType; // edited

to include additional masks for recieving software rasterized shadows like the player shadow. In this case I have added ShapeBaseObjectType. This was spoken of in a few other forum threads and people supposedly had it working. In my case it allows DTS objects to receive shadows from other DTS objects, including themselves - but only on their collision mesh. The fact it only occurs on the collision mesh is the problem I am having.

See, I have also turned on software rasterized shadowing for my DTS shapes, so they shadow just like the player which is nice and fine and rather sharp. Not a stencil shadow but it is adequate. This form of shadowing uses the visible mesh and not the collision mesh.

So when the enhanced shadows project they hit their own collision mesh and you result in some gnarly shadowing issues. I hope to someday revisit the problem and figure out a solution.

It's just confusing because many people reported being able to have the player cast shadows on DTS shapes by just adding that mask, and none of them reported the problems I am having.

The stencil shadow resource is another option, and it does look like at least one person made it work under 1.5 - they just didn't say how :P I actually might give it a go at some point. It takes the form of a patch with a readme explaining the changes which are not trivial. Let me know if you have any further luck with the matter.
#4
07/22/2008 (8:48 am)
Thanks for the input Jason!

What I'm looking for is the soft shadows that come with .Dif but on .DTS.

I've been boning up on my Constructor Dif building though and I'm comfortable enough that difs are the answer for now... Though I've entered some sort of "PORTAL" hell in the process ;-)

I'll keep looking into the .dts shadow issues but hopefully I'll be two steps behind some super zealous developer who will figure it out for me... oh did I say me.. I meant the garage games community of course.

Thanks again for the info.. I'm sure it'll come in handy as I move into the shadows of c++