Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems with shadow maps #37512
12/09/04 06:58
12/09/04 06:58
Joined: Oct 2003
Posts: 94
bs_twinbits Offline OP
Junior Member
bs_twinbits  Offline OP
Junior Member

Joined: Oct 2003
Posts: 94
A6 Prof. Vers 6.31.4 MapComp. 6.25
I have some ugly problems with the shadows in my level.It's build out of two floors. In the first floor I put some office furniture as an mdl model. I give the shadow flag to this model in WED. The model looks fine and the shadow on ground from the first floor is fine, but it builds a shadow through the first floor to the ground floor too. How can we solve this problem, because without the shadow flag, the office model looks not nice.
Regards
BS
twinbits


Re: Problems with shadow maps [Re: bs_twinbits] #37513
12/09/04 08:47
12/09/04 08:47
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
This is not a shadow map, it's a stencil shadow. JCL will have to give a more precise answer but I think that's just a general problem with stencil shadows in that they are not cut by geometry. One thing you can do is reduce the SHADOW_RANGE value so that shadow volumes don't extend as far. Another work-around would be to create a passable black 0-height copy of your furniture and place it manually.

Re: Problems with shadow maps [Re: bs_twinbits] #37514
12/09/04 08:49
12/09/04 08:49
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
EDIT: Marco beat me to it.

That's a limitation of using stencil shadows. Geometry doesn't clip the shadow, so although it will look nice and pretty on floor one, that same shadow will essentially bleed down to the ground floor. One of a handful of ways to eliminate this and still use your current setup is to turn the furniture model invisible when the player reaches a certain disntance from it.

Code:

while(1)
{
if(vec_dist(my.x,player.x) >= ????)
{
my.invisible = on;
}
else
{
my.invisible = off;
}
wait(1);
}



Alternatively, instead of using vec_dist, if the player's X falls outside a certain hardcoded area(like below the 1st floor Z), then you could turn it off that way as well.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Problems with shadow maps [Re: Orange Brat] #37515
12/10/04 06:30
12/10/04 06:30
Joined: Oct 2003
Posts: 94
bs_twinbits Offline OP
Junior Member
bs_twinbits  Offline OP
Junior Member

Joined: Oct 2003
Posts: 94
Thank you for your reply !
Ok, this stencil shadows looks nice at our mdl models, but we don't have them, if you doesn't use the shadow flag for your models :-). Maybe it's a work-around to use 0-high model as the shadow on the floor, but you don't have any shadow at your models itself. The result is very very ugly ! For me this problem with the stencil shadows is a great one, because now it's hard to make nice looking maps with buildings out of more then only a ground floor. To clip the models away when the player comes into the area of my models is hard to do for each office furniture in my maps.
bs

Re: Problems with shadow maps [Re: bs_twinbits] #37516
12/10/04 07:51
12/10/04 07:51
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
One way would be to turn shadows off on your models initially. When your player transitions from one floor to another, setup a trigger to change a floor variable as to which floor the player is moving to. The models can have an action to turn their shadows on if they are on the same floor as the player. This would still take some carefull planning to make sure the player can only change floors where there are triggers.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Problems with shadow maps [Re: qwerty823] #37517
12/10/04 18:38
12/10/04 18:38
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, querty's suggestion of dynamically switching shadows on and off is the best way to avoid this problem. Have an entity action check it's z position compared to the camera, and only activate the shadow flag when the camera is higher than the entities' feet.

Re: Problems with shadow maps [Re: jcl] #37518
12/10/04 22:06
12/10/04 22:06
Joined: Jan 2003
Posts: 172
UK
uman Offline
Member
uman  Offline
Member

Joined: Jan 2003
Posts: 172
UK
Yes I have the problem - we need a fix.

I have a small building with a ladder against it. The ladder casts a beautiful shadow on the wall its against. As you approach the building which cant be avoided you see two sides at once and two (one distorted) shadows, one on each side of the building. i.e. corner position : previously you see an ugly incorrect shadow first on one wall and floor below before you even get to see the ladder, (which has the correct shadow) around the corner which causes it.

In my case scenario which in many instances is a typical one I would think -suggested fixes would not work as the correct and offending shadow can be seen at the same time. Its not in a different location or on a different level, but almost attached to the correct one.

How do we turn off Stencil shadows and go back to using the old shadow system - can we do that? Lets hope so as although the stencil shadows do look great when they work properly they are extremely ugly when not.

Great shadows in parts of a game are no recommendation for supporting a system which causes such problems in others.

Work arounds as suggested are not practical in levels with hundreds of entities for various reasons - extra work is not needed and fixing faults are an attempt at a cure - when prevention is whats needed. The problem needs fixing so that stencil shadows work correctly or take them out of the engine altogether.

Re: Problems with shadow maps [Re: uman] #37519
12/11/04 02:00
12/11/04 02:00
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
As you've noticed yourself, every shadow method has its advantages and disadvantages. As a game designer it's up to you to choose the right combination of static, stencil, or z buffer shadows for your game, so that every part looks right. Gamestudio can offer some tools, like different shadow methods, but can not "fix" your game.

Re: Problems with shadow maps [Re: uman] #37520
12/11/04 05:05
12/11/04 05:05
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Quote:

Yes I have the problem - we need a fix.




It's not a bug, it's the way stencils work and the workarounds provided(my way or qwerty's way) work perfectly. Dynamic lights are exactly the same..they aren't clipped by geometry(and the same workarounds work for them, too). Assuming there is no way to make them them clip, then this sounds like a DirectX quirk and not a Conitec one. You'll need to contact Microsoft.

I've played plenty of AAA caliber games with non-clipping dynamic lights and stencils(Half-Life 2 comes to mind). It's up to you, the level designer, to insure that the clipping is not seen. Even the big boys slip up with this sometimes.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Problems with shadow maps [Re: Orange Brat] #37521
12/11/04 05:21
12/11/04 05:21
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Frankly if your maps are built correctly.. any floor above the one the camera is in ought be culled by the visibility system, so the models on that floor ought to be culled too. Then of course this problem wont happen.. if however it does.. simply turn off shadows if camera.z<model.z


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1