|
Problems with shadow maps
#37512
12/09/04 06:58
12/09/04 06:58
|
Joined: Oct 2003
Posts: 94
bs_twinbits
OP
Junior Member
|
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]
#37514
12/09/04 08:49
12/09/04 08:49
|
Joined: Aug 2000
Posts: 7,490
Orange Brat
Senior Expert
|
Senior Expert
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
OP
Junior Member
|
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
Senior Developer
|
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
|
|
|
|