Game Development Community

Shadow Density

by Todd Pickens · in Torque Game Engine · 07/19/2006 (6:13 pm) · 5 replies

I am trying to finish up my new content pack and learning TLK as I am going.

At the moment I am trying to understand the differences in shadow density between the Static shapes and Animated dts shapes.

More specifically how to fix the difference. The player and any similar animated shape cast a comparatively very dark shadow, while standard dts shapes cast pretty soft shadows.

This would not be so bad except that some of my dts structures are animated and stand next to ones that are not, like a barn next to a wind mill for example. The end result is not good.

Any assistance on this would be deeply appreciated.

example

www.shapesandlines.com/art/shadowexample.jpg

#1
07/19/2006 (7:33 pm)
The shadow on the left looks a lot darker, but it also looks like the shadow from a different building
fog = 1.0f-fog;
   fog *= SG_DYNAMIC_SHADOW_INTENSITY;
I believe that is supposed to define the shadow intensity, but it should be the same for all shapes, animated or not, I cant see a shadow on the other building so i'd assume you have not relight, have you?

if(!sgLightManager::sgMultiDynamicDTSShadows)
		{
			//only need to render one here...
			break;
		}
If animated dts's are dynamicdts shapes then that code might be changing the shadow, doing just one render pass.

You could have accidently turned on that other lighting option (gl or something) for one and not the other

There are also map issues like:
#ifdef SG_STATIC_LIGHT_SHADOWS_BLUR
		if(normalmap)
			lightmap->sgCopyLightMapBlur(normLightmap, normalmap, xoff, yoff);
		else
			lightmap->sgCopyLightMapBlur(normLightmap, xoff, yoff);
		if(alarmLightmap)
			lightmap->sgCopyLightMapBlur(alarmLightmap, xoff, yoff);
#else
		lightmap->sgCopyLightMap(normLightmap, xoff, yoff);
		if(alarmLightmap)
			lightmap->sgCopyLightMap(alarmLightmap, xoff, yoff);
#endif//SG_STATIC_LIGHT_SHADOWS_BLUR

There's also different types of shadows - look at sglightmanager.cc

To be honest though - I have no idea
#2
07/19/2006 (9:10 pm)
James,

Thanks very much.

With a bunch more forum searching, I fould a post that referenced "bitRender.cc

Jon Jorajuria fixed it for me and the shadow density now matches.
#3
07/19/2006 (10:38 pm)
Hi guys,

You can change the value of SG_DYNAMIC_SHADOW_INTENSITY in sgLighting.h, this will increase/decrease the dynamic shadow intensity.

-John
#4
07/19/2006 (10:47 pm)
Todd: could you post your fix? Or is it setting the constant value that John pointed out?
#5
07/19/2006 (10:58 pm)
John, thanks very much.

@ Jameson, I will forwad this link to Jon Jorajuria, he fixed it for me after I sent him the link to the post I mentioned above.

John's sgLighting.h may very well be the correct approach, I'll leave that up to Jon J.