Shadow Control

Tutorial collection, comprehensive listings on main site.

Shadow Control

Postby Tutorial on Sat Apr 16, 2005 5:57 pm

category
General Half-Life 2/Entities

description
A handy entity for tweaking the shadows cast in your map.

keywords
shadow, control, shadow_control.

This tutorial covers how to control your map's dynamic shadows using the shadow_control entity. If your dynamic shadows (shadows from props) aren't working, this will PROBABLY fix it, if used properly. This tutorial assumes you have a basic knowledge of entities, and how to use them.

First, select the entity tool, and find shadow_control.

Image

Insert this anywhere you like in your map. With the shadow_control selected, press ALT+enter to bring up its properties.

Image


There are several key properties you need to set:



Pitch Yaw Roll (Y Z X) angles shadow is cast from your props(string) - default: 80 30 0
This is the shadow direction. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, and roll is the rotation around the X axis.

Shadow Color color(color255) - default: 128 128 128
This is the color of the shadows. More than this kinda looks fake-like, depending on your maps lighting.

Maximum Distance distance(float) - default: 75
This is the maximum distance the shadow is allowed to cast, in inches. if you hold the prop higher above the ground than this value, the shadow will fade out and not be drawn, until the prop is close enough to a surface to cast a shadow again.

Compile, check it, and if it needs tweaking, tweak it!

- ishbog
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby -|Dizmas|- on Mon May 23, 2005 7:49 pm

Is there anyway to apply the shadows depending where light enties are?

It looks kinda wierd if all the shadows are going the same way because what if there is a light going a different angle? it looks unrealistic.
-|Dizmas|-
Regular
Regular
 
Joined: Sun May 15, 2005 5:04 pm

Postby mad_ferrit on Sun Jun 26, 2005 12:22 am

-|Dizmas|- wrote:It looks kinda wierd if all the shadows are going the same way because what if there is a light going a different angle? it looks unrealistic.

It depends on your map I suppose... If it were a large open area which uses the sunlight for the majority of the level then it could be quite usefull :)
User avatar
mad_ferrit
Regular
Regular
 
Joined: Thu Jan 06, 2005 11:02 am

Postby Spartan on Sun Jun 26, 2005 1:41 am

If you want your shadows to look realistic then don't use black as the shadow color. Use a dark or regular grey color for the shadow.
Spartan
Veteran
Veteran
 
Joined: Sat Oct 09, 2004 2:58 pm

Postby KewlAzMe on Tue Apr 11, 2006 1:34 am

Is there any way to programmatically get the value of how much shadow or light is cast on you?

For example, as you get closer to the light source, your player should realistically become brighter.. is there a way of calculating that out ?
~Thieves' Highway~
Multiplayer mod based on
the 'Thief' Game Series
(Switched to Unreal Engine)
KewlAzMe
Dumpling
Dumpling
 
Joined: Sat Mar 25, 2006 4:37 am

herd it waz something with shadows

Postby ItsMeMatt87 on Mon May 15, 2006 5:31 pm

materialPath: z:\valve\steam\steamapps\ziolowski87\counter-strike source\cstrike\materials
Loading D:\Mix\Counter Strike\Maps\NewYorkBrooklynGreenpoint\NewYorkBrooklynGreenpoint.vmf
Can't find surfaceprop panel for material METAL/PRODVENTA, using default
Can't find surfaceprop stone for material DE_TIDES/TIDES_CONCRETEFLOOR, using default
fixing up env_cubemap materials on brush sides...
0...1...2...3...4...5...6...7...8...9...10**** leaked ****
Entity prop_static (-3221.88 -2406.43 -766.29) leaked!

FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (10240.0, -7680.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (9729.0, -7168.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (9217.0, -7168.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (8704.0, -7168.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (10240.0, -8704.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (10240.0, -9728.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (7680.0, -7168.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:


FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (6656.0, -7168.0, -7045.5)
Leaf 0 contents:
Leaf 1 contents: CONTENTS_SOLID
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:

*** Suppressing further FindPortalSide errors.... ***
Processing areas...done (0)
Building Faces...done (0)
FixTjuncs...
PruneNodes...
WriteBSP...
done (14)
Creating default cubemaps for env_cubemap using skybox materials:
skybox/office*.vmt
Run buildcubemaps in the engine to get the correct cube maps.

No such variable "$hdrbasetexture" for material "skybox/officert"
Can't load skybox file skybox/office 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 (4) (2333702 bytes)
Emitting linux collision data (use -nolinuxdata to disable).
Building Physics collision data...
done (3) (2333702 bytes)
Placing detail props : 0...1...2...3...4...5...6...7...8...9...10
Compacting texture/material tables...
Reduced 7680 texinfos to 5633
Reduced 251 texdatas to 234 (6902 bytes to 5817)
Writing D:\Mix\Counter Strike\Maps\NewYorkBrooklynGreenpoint\NewYorkBrooklynGreenpoint.bsp
1 minute, 3 seconds elapsed



2 threads
reading d:\mix\counter strike\maps\newyorkbrooklyngreenpoint\NewYorkBrooklynGreenpoint.bsp
reading d:\mix\counter strike\maps\newyorkbrooklyngreenpoint\NewYorkBrooklynGreenpoint.prt
LoadPortals: couldn't read d:\mix\counter strike\maps\newyorkbrooklyngreenpoint\NewYorkBrooklynGreenpoint.prt



[Reading texlights from 'lights.rad']
[1 texlights parsed from 'lights.rad']

Loading d:\mix\counter strike\maps\newyorkbrooklyngreenpoint\NewYorkBrooklynGreenpoint.bsp
No vis information, direct lighting only.
44356 faces
42 degenerate faces
12831758 square feet [1847773184.00 square inches]
0 displacements
0 square feet [0.00 square inches]
96 direct lights
0...1...2...3...4...5...6...7...8...9...10Build Patch/Sample Hash Table(s).....Done<0.4032 sec>
0...1...2...3...4...5...6...7...8...9...10FinalLightFace Done
Ready to Finish
0 of 0 (0% of) surface lights went in leaf ambient cubes.
ComputePerLeafAmbientLighting: 0...1...2...3...4...5...6...7...8...9...10

Object names Objects/Maxobjs Memory / Maxmem Fullness
------------ --------------- --------------- --------
models 137/1024 6576/49152 (13.4%)
brushes 6112/8192 73344/98304 (74.6%)
brushsides 44446/65536 355568/524288 (67.8%)
planes 20118/65536 402360/1310720 (30.7%)
vertexes 63898/65536 766776/786432 (97.5%) VERY FULL!
nodes 27174/65536 869568/2097152 (41.5%)
texinfos 5633/12288 405576/884736 (45.8%)
texdata 234/2048 7488/65536 (11.4%)
dispinfos 0/0 0/0 ( 0.0%)
disp_verts 0/0 0/0 ( 0.0%)
disp_tris 0/0 0/0 ( 0.0%)
disp_lmsamples 0/0 0/0 ( 0.0%)
faces 44356/65536 2483936/3670016 (67.7%)
origfaces 21959/65536 1229704/3670016 (33.5%)
leaves 27312/65536 873984/2097152 (41.7%)
leaffaces 51021/65536 102042/131072 (77.9%)
leafbrushes 11942/65536 23884/131072 (18.2%)
areas 3/256 24/2048 ( 1.2%)
surfedges 302670/512000 1210680/2048000 (59.1%)
edges 169872/256000 679488/1024000 (66.4%)
LDR worldlights 96/8192 8448/720896 ( 1.2%)
HDR worldlights 0/8192 0/720896 ( 0.0%)
waterstrips 3530/32768 35300/327680 (10.8%)
waterverts 0/65536 0/786432 ( 0.0%)
waterindices 59289/65536 118578/131072 (90.5%) VERY FULL!
cubemapsamples 0/1024 0/16384 ( 0.0%)
overlays 0/512 0/180224 ( 0.0%)
LDR lightdata [variable] 16796468/0 ( 0.0%)
HDR lightdata [variable] 0/0 ( 0.0%)
visdata [variable] 0/16777216 ( 0.0%)
entdata [variable] 101283/393216 (25.8%)
LDR leaf ambient 27312/65536 655488/1572864 (41.7%)
HDR leaf ambient 0/65536 0/1572864 ( 0.0%)
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/50390 ( 0.0%)
pakfile [variable] 23615/0 ( 0.0%)

Win32 Specific Data:
physics [variable] 2333702/4194304 (55.6%)
==== Total Win32 BSP file data space used: 29563882 bytes ====

Linux Specific Data:
physicssurface [variable] 2333702/6291456 (37.1%)
==== Total Linux BSP file data space used: 29563882 bytes ====

Total triangle count: 123685
Writing d:\mix\counter strike\maps\newyorkbrooklyngreenpoint\NewYorkBrooklynGreenpoint.bsp
40 minutes, 51 seconds elapsed

-------------------------------------------------------

the bsp creates and everything is good just i try to load the map and a few bars load and the it stops, just shut of and goes back to main menu, does anybody know how to fix (waterindices) i have way 2 many, o and also FINDPORTALSIDE, how do i fix that? thnx, Matt
ItsMeMatt87
Dumpling
Dumpling
 
Joined: Wed May 10, 2006 8:37 pm

Postby themonk on Sat Dec 16, 2006 3:07 pm

I fixed the portalside error with moving the whole map away from the point where it was.

I think it comes when there are too much stuff close the axis helper...
themonk
Member
Member
 
Joined: Sat Sep 23, 2006 5:26 pm

Postby Sgt Doom on Sun Mar 04, 2007 1:45 pm

For a good shadow colour, use the Ambient colour settings for your light_environment. Of course, indoors it doesn't look so good.

EDIT: Whoops, didn't see the date.
I shall not compete in a battle of wits with an unarmed person!
User avatar
Sgt Doom
Regular
Regular
 
Joined: Fri Apr 07, 2006 7:53 pm

Return to Tutorials

Who is online

Users browsing this forum: No registered users