Baking a 'dynamic' shadow - possible?

Riever

L2: Junior Member
Nov 25, 2011
86
4
Dear all,

If you name a light you can turn it on and off. But is there anyway of doing something similar for a shadow?

My map has a ufo on it that casts a large shadow from the env_light (sun). Thing is the ufo is not always there, so should not always cast a shadow.

Eventually the ufo will have a number of lights on the base and so what I would like to try and do is build the area of the map affected by the ufo's shadow twice. Once for when it's around and once for when it's not and then somehow switch the lighting between them.

The only idea I have so far is to add a massively bright spot light somewhere on the map and toggle this, but I suspect this will just look odd.

Is this possible? :confused:
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Dynamic shadows and lightmap shadows are completely different processes. One is a post-process calculated ingame in real time (dynamic) and one is a material layer rendered during the game having been computed in the compile process. They appear vastly different in appearence too and dynamic shadows have a habit of overlapping.

You can have a dynamic shadow rendered from the UFO that will turn on and off if the UFO is also dynamic. But it'll probably look... not good.

For what you want to achieve though you might want to create a pseudo sun under the UFO that turns on and off.
 
Last edited:

henke37

aa
Sep 23, 2011
2,075
515
I don't think that "post-process" is the correct term, that is generally reserved for effects done on the rasterized 3d render, not during said rendering.
 

Riever

L2: Junior Member
Nov 25, 2011
86
4
Hi,

Many thanks for the advice. Unfortunately I cannot get the UFO to render a shadow at all at present.

ufo_no_shadow.jpg


Its made up of dynamic objects (prop_dynamic) and toggled on and off using a point_template.

For some reason vrad is rendering the scene with it missing - hence no shadow. Does anyone know how I can force the ufo to be present during the vrad render?

Many thanks in advance.
 

Mr. Happy

L6: Sharp Member
Jul 16, 2008
320
158
As a dynamic it casts shadow_control shadows, so you will need to place shadow_control and adjust it's angle to face down.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Or more realistically, to face the same way as normal shadows. And use roughly the same color as the "ambient" lighting in the light_environment.
 

Riever

L2: Junior Member
Nov 25, 2011
86
4
Many thanks for the info on shadow_control. Thing is I already have one of these set as;

Name - blank
Pitch etc - 0 300 0
Colour 128 128 128
Max distance 75
All shadows disabled - no

Do I need to extend the max distance, or do I need to add another controller and somehow join this to the UFO?
 

Riever

L2: Junior Member
Nov 25, 2011
86
4
Hmm, well this is odd. I made the Max distance 750 then 75000 and still no shadow.

I am confused.

The UFO was made with propper using a set of cylinders that were made hollow. I then cut it up as the collision meshes were not allowing players to enter when it was a full 360 degree model.

Do I need to do anything with the propper model to get it to create a shadow?

Thanks in advance.