Model not casting shadows correctly

Modelling, Textures, Animating and other general engine asset topics.

Model not casting shadows correctly

Postby Wrangler249 on Thu Mar 03, 2011 5:28 pm

Ahoyhoy, got a little problem that I'm stuck with.

As the title says, my models are not behaving properly when it comes to casting shadows; either it casts a single solid shadow (as if the object was completely solid with no gaps) or it casts no shadow whatsoever. I haven't set Disable Shadows in the entity properties to yes, so that is ruled out. I have also compared the vmt to other vmts I have for other models that work correctly and there doesn't seem to be anything there that could be causing the problem.

I have noticed that it casts dynamic shadows perfectly fine (torch shadows etc), it just seems to be static lighting that it is playing up with. Has anybody else come across this problem before?

Thanks,

Wrangler249.
Wrangler249
Member
Member
 
Joined: Fri Aug 29, 2008 6:50 pm

Re: Model not casting shadows correctly

Postby MayheM on Thu Mar 03, 2011 5:36 pm

Can you post a screenshot of what you are talking about. Pictures always help...
Image
User avatar
MayheM
Veteran
Veteran
 
Joined: Tue Oct 16, 2007 7:46 pm
Location: Lancaster SC

Re: Model not casting shadows correctly

Postby Wrangler249 on Thu Mar 03, 2011 5:53 pm

Sure can mate:

http://tinypic.com/r/ny9y6x/7

As you can see, it reacts as expected to torch light, but the shadows on the left cast by the light_environment are horrible.
Wrangler249
Member
Member
 
Joined: Fri Aug 29, 2008 6:50 pm

Re: Model not casting shadows correctly

Postby Kosire on Thu Mar 03, 2011 6:03 pm

Either you're collision box is a sqaure or you didn't compile the map's rad with -staticproppolys -staticproplighting -both -final -game $gamedir $path\$file
User avatar
Kosire
1337 p0st3r
1337 p0st3r
 
Joined: Sat Mar 07, 2009 7:25 pm
Location: Denmark

Re: Model not casting shadows correctly

Postby stoopdapoop on Thu Mar 03, 2011 6:06 pm

Alright, there are 2 solutions to your problem, I would recommend doing both.

You need to compile your map with the "-StaticPropPolys" parameter (you have to compile under expert mode to add this). This will use the models actual polygons when figuring out the lighting. By default it uses the models collision mesh to do lighting.

The other solution to your problem is to make a more accurate collision mesh for your prop. In your case you're going to have to compile it with the $concave parameter. These VDC pages should help you out.

http://developer.valvesoftware.com/wiki/$concave
http://developer.valvesoftware.com/wiki ... d_Ragdolls
http://developer.valvesoftware.com/wiki/Collision_mesh

Edit: Kosire edged my out by 3 minutes >:|
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Model not casting shadows correctly

Postby Wrangler249 on Thu Mar 03, 2011 6:09 pm

Thank you very much Kosire, that's solved it for me!
Wrangler249
Member
Member
 
Joined: Fri Aug 29, 2008 6:50 pm

Re: Model not casting shadows correctly

Postby Wrangler249 on Thu Mar 03, 2011 6:18 pm

Thank you too stoopdapoop. The model did not have any collision data, which I'm guessing is why it was acting up. I tried the parameters and it worked. I'll keep those VDC pages for when I'm working with collision models, thanks for them!
Wrangler249
Member
Member
 
Joined: Fri Aug 29, 2008 6:50 pm

Return to Art Creation

Who is online

Users browsing this forum: No registered users