Horizontal Player/model shadows not drawing

  • If you're asking a question make sure to set the thread type to be a question!

mug

L1: Registered
Aug 13, 2008
23
9
Hello,
In the latest map im making which is a beach landing map. I'm having a problem with shadows.
The layout of my map is quite basic to start off with, just a beach, 2 bunkers and 2 hills with cliffs surrounding left and right.
I'm using the well skybox with the recommended valve sky list light_environment, env_sun and shadow control settings

Highlighted areas are horizontal

It seems that player/model shadows are showing on vertical brushes or any brush thats not horizontal. any brush thats horizontal shows no shadows at all


I have searched to the best of my ability for a tutorial covering this, but have not found any :confused:

My quick compile log if any help:
Valve Software - vbsp.exe (Mar 11 2008)
1 threads
materialPath: g:\program files\steam\steamapps\*****\team fortress 2\tf\materials
Loading G:\Program Files\Steam\steamapp\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.vmf
fixing up env_cubemap materials on brush sides...
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0)
Processing areas...done (0)
Building Faces...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (0)
writing G:\Program Files\Steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.prt...Building visibility clusters...
done (1)
*** Error: Skybox vtf files for skybox/sky_well_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_well_01 to build the default cubemap!
*** Error: Skybox vtf files for skybox/sky_well_01 weren't compiled with the same size texture and/or same flags!
Can't load skybox file skybox/sky_well_01 to build the default cubemap!
Finding displacement neighbors...
Finding lightmap sample positions...
Displacement Alpha : 0...1...2...3...4...5...6...7...8...9...10
Building Physics collision data...
done (1) (168713 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 411 texinfos to 249
Reduced 29 texdatas to 26 (891 bytes to 682)
Writing G:\Program Files\Steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.bsp
3 seconds elapsed

** Executing...
** Command: "g:\program files\steam\steamapps\*****\sourcesdk\bin\orangebox\bin\vvis.exe"
** Parameters: -game "g:\program files\steam\steamapps\*****\team fortress 2\tf" -fast "G:\Program Files\Steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1"

Valve Software - vvis.exe (Mar 11 2008)
fastvis = true
1 threads
reading g:\program files\steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.bsp
reading g:\program files\steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.prt
948 portalclusters
2941 numportals
BasePortalVis: 0...1...2...3...4...5...6...7...8...9...10 (3)
Optimized: 26164 visible clusters (0.00%)
Total clusters visible: 630385
Average clusters visible: 664
Building PAS...
Average clusters audible: 944
visdatasize:220109 compressed from 227520
writing g:\program files\steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.bsp
3 seconds elapsed

** Executing...
** Command: "g:\program files\steam\steamapps\*****\sourcesdk\bin\orangebox\bin\vrad.exe"
** Parameters: -game "g:\program files\steam\steamapps\*****\team fortress 2\tf" -noextra "G:\Program Files\Steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1"

Valve Software - vrad.exe SSE (Mar 11 2008)

Valve Radiosity Simulator
1 threads
[Reading texlights from 'lights.rad']
[34 texlights parsed from 'lights.rad']

Loading g:\program files\steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.bsp
Setting up ray-trace acceleration structure... Done (1.24 seconds)
2694 faces
2 degenerate faces
2480065 square feet [357129408.00 square inches]
79 Displacements
449620 Square Feet [64745308.00 Square Inches]
2692 patches before subdivision
93760 patches after subdivision
sun extent from map=0.000000
2 direct lights
BuildFacelights: 0...1...2...3...4...5...6...7...8...9...10 (72)
BuildVisLeafs: 0...1...2...3...4...5...6...7...8...9...10 (79)
transfers 8109387, max 938
transfer lists: 61.9 megs
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #1 added RGB(470570, 204534, 82099)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #2 added RGB(161297, 61977, 19516)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #3 added RGB(9174, 1920, 324)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #4 added RGB(9400, 2400, 368)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #5 added RGB(396, 61, 8)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #6 added RGB(673, 112, 8)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (0)
Bounce #7 added RGB(28, 3, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #8 added RGB(51, 5, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #9 added RGB(2, 0, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #10 added RGB(4, 0, 0)
GatherLight: 0...1...2...3...4...5...6...7...8...9...10 (1)
Bounce #11 added RGB(0, 0, 0)
Build Patch/Sample Hash Table(s).....Done<0.1279 sec>
FinalLightFace: 0...1...2...3...4...5...6...7...8...9...10 (32)
FinalLightFace Done
0 of 0 (0% of) surface lights went in leaf ambient cubes.
ThreadComputeLeafAmbient: 0...1...2...3...4...5...6...7...8...9...10 (40)
Writing leaf ambient...done
Ready to Finish

Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
models 8/1024 384/49152 ( 0.8%)
brushes 477/8192 5724/98304 ( 5.8%)
brushsides 3603/65536 28824/524288 ( 5.5%)
planes 2094/65536 41880/1310720 ( 3.2%)
vertexes 4320/65536 51840/786432 ( 6.6%)
nodes 1994/65536 63808/2097152 ( 3.0%)
texinfos 249/12288 17928/884736 ( 2.0%)
texdata 26/2048 832/65536 ( 1.3%)
dispinfos 79/0 13904/0 ( 0.0%)
disp_verts 3559/0 71180/0 ( 0.0%)
disp_tris 5408/0 10816/0 ( 0.0%)
disp_lmsamples 1044681/0 1044681/0 ( 0.0%)
faces 2694/65536 150864/3670016 ( 4.1%)
hdr faces 0/65536 0/3670016 ( 0.0%)
origfaces 1004/65536 56224/3670016 ( 1.5%)
leaves 2003/65536 64096/2097152 ( 3.1%)
leaffaces 3021/65536 6042/131072 ( 4.6%)
leafbrushes 1205/65536 2410/131072 ( 1.8%)
areas 3/256 24/2048 ( 1.2%)
surfedges 16130/512000 64520/2048000 ( 3.2%)
edges 9440/256000 37760/1024000 ( 3.7%)
LDR worldlights 2/8192 176/720896 ( 0.0%)
HDR worldlights 0/8192 0/720896 ( 0.0%)
leafwaterdata 2/32768 24/393216 ( 0.0%)
waterstrips 135/32768 1350/327680 ( 0.4%)
waterverts 0/65536 0/786432 ( 0.0%)
waterindices 2580/65536 5160/131072 ( 3.9%)
cubemapsamples 2/1024 32/16384 ( 0.2%)
overlays 2/512 704/180224 ( 0.4%)
LDR lightdata [variable] 11086532/0 ( 0.0%)
HDR lightdata [variable] 0/0 ( 0.0%)
visdata [variable] 220109/16777216 ( 1.3%)
entdata [variable] 8660/393216 ( 2.2%)
LDR ambient table 2003/65536 8012/262144 ( 3.1%)
HDR ambient table 2003/65536 8012/262144 ( 3.1%)
LDR leaf ambient 10650/65536 298200/1835008 (16.3%)
HDR leaf ambient 2003/65536 56084/1835008 ( 3.1%)
occluders 0/0 0/0 ( 0.0%)
occluder polygons 0/0 0/0 ( 0.0%)
occluder vert ind 0/0 0/0 ( 0.0%)
detail props [variable] 1/12 ( 8.3%)
static props [variable] 1/2516 ( 0.0%)
pakfile [variable] 1697/0 ( 0.0%)
physics [variable] 168713/4194304 ( 4.0%)
physics terrain [variable] 16147/1048576 ( 1.5%)

Level flags = 0

Total triangle count: 6724
Writing g:\program files\steam\steamapps\*****\sourcesdk_content\tf\mapsrc\cp_ohmughaha_beach_b1.bsp
3 minutes, 55 seconds elapsed

Thanks!
been driving me mad! :angry:
 

Dox

L8: Fancy Shmancy Member
Oct 26, 2007
588
62
With light_enviorment there is a setting for the lights direction which is 0 by default, which is strait horizontal, try setting it to negative 90 degrees and it should cast shadows strait down.
 

mug

L1: Registered
Aug 13, 2008
23
9
With light_environment there is a setting for the lights direction which is 0 by default, which is strait horizontal, try setting it to negative 90 degrees and it should cast shadows strait down.
Thx for the reply Dox
Ive just tried testing this today, I changed the pitch value from -35 to -90 in both my light_environment and env_sun. I have also checked the useangles key to yes.
Strangely enough, the shadows didn't seem to change angle at all, still casting from south east corner of map from quite low.
puzzled :cursing:
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
got a shadow_control entity? it needs all its values to be similar to those of the light_env to look best.
 

mug

L1: Registered
Aug 13, 2008
23
9
got a shadow_control entity? it needs all its values to be similar to those of the light_env to look best.
Yes got a shadow control. with Pitch Yaw Roll @ 0 300 0, max distance 75 and the same Pitch Yaw Roll @ 0 300 0 in light_environment and env_sun. Sunspreadangle is at 0 in light_environment if that would make a difference.
Thanks for the thinktank guys, i know its a pretty minor problem with the map, but i like shadows looking nice! :thumbup:
 

mug

L1: Registered
Aug 13, 2008
23
9
I fixed this today by taking a close look at decompiled cp_well.
The angles in the light_environment are 0 300 0
The angles in the shadow_control are 66 300 0
It all makes sense now. when i had the angles of shadow_control set @ 0 300 0 it was drawing the shadow from a pitch of 0 so the horizontal surfaces were not drawing shadows because they were level with the casting direction.
This should be mentioned in the lighting tuts available, so other people don't get confused similarly.
From what i thought was such a complex problem turned out to be a simple fix.
Decompiled maps FTW.
Thanks to all for your help anyhow :thumbup:
 
Dec 25, 2007
566
439
I fixed this today by taking a close look at decompiled cp_well.
The angles in the light_environment are 0 300 0
The angles in the shadow_control are 66 300 0

With the light_environment and light_spot entities (among others), there is a separate keyvalue "pitch" that controls the downward angle, instead of the first bit of "angles". Most other entities just use "angles". This is why the first bit is "0" for cp_well's light_environment.

To make things more confusing, some entities use 66 to mean 66 degrees down, other use -66 to mean 66 degrees down, and I can never remember which. :huh: