Game Development Community

Static Objects not casting shadows

by C. David Belt · in Torque Game Engine · 08/10/2005 (11:13 am) · 28 replies

OK. I am here. What do you suggest?
Page «Previous 1 2
#1
08/10/2005 (12:13 pm)
Did you run into any problems during the merge - any errors or anything (this may indicate a missed section of code)?

Try re-running WinMerge (or your favorite merge tool) comparing your source and the Lighting Pack code. You only need to look at "scenegraph/SceneLighting.cc" to make sure all of the change from the Lighting Pack code are in your source code - if you haven't changes scene lighting then the files should be identical.
#2
08/10/2005 (12:14 pm)
Rather I should say that for this particular problem we only need to look at sceneLighting.cc.
#3
08/10/2005 (12:24 pm)
Scenegraph/SceneLighting.cc is identical to the one in the LightingPack. I have rebuilt.

On another note, the F12 lighting editor does not come up in edit mode. I suspect that this is a script or gui problem. Otherwise, my shadows look great on terrain, just not on interiors.
#4
08/10/2005 (12:54 pm)
That's odd. Do you see the same problem when using the trees from the Lighting Pack example dir?

For the scripts you need to copy the 'example/common/synapseGaming' folder into your common folder and use WinMerge to compare the Lighting Pack scripts to your scripts (there are a few change to merge into your code).
#5
08/10/2005 (1:06 pm)
The trees DO cast a shadow. The poles in the middle of the village do NOT. However, my problem is not with TSStatics casting shadows on TERRAIN, but on the floor of INTERIORS. Shadows on terrain works fine for me.

I did copy over the synapseGaming folder. I know that there is something I am missing there, but I just have not been able to figure it out so far.
#6
08/10/2005 (1:08 pm)
I know, I meant do the trees, when put into your mission, cast shadows onto your interior.
#7
08/10/2005 (1:10 pm)
TGE's collision hulls are very sensitive and the trees are known to work, so I wanted to eliminate the possibility that the problem is related to the object collision hulls.
#8
08/10/2005 (1:30 pm)
I placed two trees in the mission: one on the terrain and one in the interior. The one in the interior does not cast a shadow, but the one on the terrain does.

One possibly crucial fact that I have left out is that this takes place underwater.
#9
08/10/2005 (1:43 pm)
I placed a tree on an interior ABOVE the water and it DOES cast a shadow. So the problem only exists underwater. Any ideas?
#10
08/11/2005 (7:12 am)
I just tested this using the Lighting Pack 1.3.5 demo and it works correctly. Starting with the TGE demo mission I placed several of the docks under water and then tested casting shadows onto the docks with TSStatic object that were completely above, completely below, or riding the waterline.

The lighting code itself doesn't reference the water at all, so the water can't be directly affecting the lighting.

The only thing I though of is that the directional lighting (sunlight) looks for interior surfaces that are flagged as 'outside visible' if the TGE modifications you've made alter the flag (directly or indirectly) the sunlight won't completely illuminate the interior and the shadows won't show up.
#11
08/11/2005 (8:50 am)
I have not made any modifications that would affect that. All of my modifications have been to player.cc, game.cc, and fxFoliageReplicatior.cc.

I think that the problem is related to my interior. I have a large skylight (implemented as a DTS collision mesh) where the roof would normally be. The collision mesh itself is invisible, but it casts a shadow (so no OTHER shadows would be visible). I think that this is causing the problem. However, when I try to remove it, the game locks up during the "LIGHTING MISSION" phase of game startup. I guess I will have to go back to square one and redesign the interior.

Any ideas on how to implement a transparent roof?

Thanks.
#12
08/11/2005 (9:05 am)
OK. This is just plain weird: I removed the skylight and implemented a normal roof in the DIF interior. Now, none of the TSStatics cast shadows, but the PLAYER still does. I am using light_omni lights to illuminate the interior. What Lighting Pack type of lights should I use instead?

Dave
#13
08/11/2005 (10:12 am)
Ahh... I think you're misunderstanding how the Lighting Pack works. The player casts dynamic shadows all the time, static objects cast static shadows which are baked into the light maps. The static shadows are only cast from the sun and the Lighting Pack lights, which are added through the mission editor (not the map lights which are added through Quark/Hammer). The mission lights can be edited in the mission editor, so you never need to leave Torque to setup your lighting.

Check out the Modeler's Guide that came with the Lighting Pack - it explains how to create and edit the mission lights, and has lots of information about the other features.
#14
08/11/2005 (10:18 am)
Actually, I WAS using ONLY sunlight, but because the collision mesh that made up the skylight cast a shadow (even though the mesh itself was invisible), there could not be any other shadows.

Thanks for the point out to the modeler's guide. I will give it a look.

Thank you for all the help.
#15
08/11/2005 (1:30 pm)
Hey guys, interesting dicussion, but the start of the thread seems to be missing.

I am just curious:
Was there something besides the fact, that the shadows were not showing up.
E.g. was this after a migration, initial installation, game code change?

-- Markus
#16
08/11/2005 (3:35 pm)
Well, I am still having problems with the Lighting Pack migration. I still do not have the lighting menu and in my editor, and I just rebuilt map2dif after finding a module difference in one of the modules and now I cannot get my mission to load. It locks up in the lighting mission portion.

Dave
#17
08/11/2005 (3:51 pm)
Did you merge the script changes over?

"For the scripts you need to copy the 'example/common/synapseGaming' folder into your common folder and use WinMerge to compare the Lighting Pack scripts to your scripts (there are a few change to merge into your code)."

Regarding the lighting lockup, that generally happens when the Lighting Pack code blocks in interiorIO.cc weren't merged in.


If you are receiving that many problems I recommend starting with a clean copy of the Lighting Pack, copy all of your art assets over, then slowly merge little bits of your changes into the Lighting Pack, testing after each piece is merged in. If there is an incompatibility you'll easily find it during the merge/testing cycle, and if the current issues are caused by an incomplete merge chances are you'll catch the problem the second time. If at any point you need to change or omit Lighting Pack code changes make a note of it because chances are any future problems will stem from those.
#18
08/11/2005 (3:57 pm)
I will start over. I am now also unable to run map2dif without getting "Orphaned Polygons". The interior did not change.

This has been a chore from the beginning.
#19
08/11/2005 (4:04 pm)
Out of curiosity what version of TGE are you starting with? The Lighting Pack is based on 1.3 and if you're running an older version it could cause problems.


"This has been a chore from the beginning."

I'm sorry you feel that way - it's impossible to write code that accounts for every project in the community, but I am trying to help you through this.
#20
08/11/2005 (4:11 pm)
Oh, please do not misunderstand. YOU have been very helpful. I am sure that this works quite well for most people. I probably horked it up all by myself. I was just commenting that implementing the Lighting Pack has not gone well for me at all.

Any idea what could be going wrong with the map2dif? I simply compiled the version of the code that came with the Lighting Pack and I still get the "Orphaned Polygons" warning.
Page «Previous 1 2