UE2 - UT2kX TERRAIN + DYNAMIC LIGHTING

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Hello
I'm currently making a CTF map in which i place many dynamic actors.
I built a terrain and a rotating skybox, and i would like the sun applies some dynamic shadows on the terrain. So that it needs to work with dynamic lightings.
The first thought was to place a sunlight in the skybox, so that it could rotate with the skybox and apply dynamicaly and automatically (i dream) its light and create thus shadows. But i think dynamic light can't pass from one zone (skybox) to another (main brush). So i have to simulate my rotating light in the main brush with a movable light for example.

1. My first question is : is terrain able to receive dynamic lighting (if not i can go step 5.),
2. I switched many flags on terraininfo, add an additionnal zoneinfo, tried some triggerlight, movablelight, do i deal with them (especially light group LG_actor etc etc), Do i deal with these boolean ? (added a bticked=1 too)
3. If not, is this a matter of the terrain textures, that they have to be set to receive dynamic lights ?
4. If there's a way to script a special terraininfo (a special alpha texture on a specific layer?) and if you know any tip or the way to go through, i could make some tries :)
5. Thank you for reading !
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
I have tried to put some shader textures layers, even a sin modifier texture layer, but it has no effect on the terrain. So i rather have to export my terrain and re-import it as a staticmesh it seems ...
It is strange that such a resource-efficient actor (collisions) cannot interact with dynamic lights ...
 
Last edited:

xMurphyx

New Member
Jun 2, 2008
1,502
0
0
liandri.darkbb.com
Well, it can deal with dynamic lights (e.g. from muzzle flashes or explosions) just like most actors can, but dynamic lights won't cast shadows. They don't cast shadows on anything though. Not on BSP, not on StaticMeshes,...
 

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Thanks for your quick reply. Wrong words i wrote : i don't look for casting shadows, but in fact for enlighten areas with a dynamic light (so that shadows look like simulated from the non-lit areas). Well, should I give up with the dynamic sunlight idea, if this can't apply at all ?

To tell more i actually simulate a water wave reflexion effect with a dyn light (LE_Interference) that make cool lit waves on a brush.
I would like that it applies to the terrain too (there is some water volumes around)

Looking at terraininfo.uc, i will try to switch bStatic (actually to True) to False.
 
Last edited:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
You will have to simulate that with a Projector and appropriately animated material instead. Some UT2004 stock maps [edit](such as CTF-Lostfaith)[/edit] have such an effect around pools of water already, IIRC.

Don't mess with the bStatic property, it can break things badly in netplay. (It's hidden from UnrealEd for that reason.)
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Thank really, i didn't think about using projectors (y). It's an actor that is rarely used in custom maps for XIII . It fits very good for a water effect, and i plan to build a cave like in CTF-lostfaith. Now i have to try if it can move in real-time (attached to a mover for ex.)
 
Try building dynamic lights by using emitters!
Just add a usual emitter into your map, ignore the emitter-settings at all, and unter lighting you type in the same settings as you would in the lightactor (brightness / color / radius).

Emitters are dynamic by default and they can be attached to a mover. This is the easiest way to make dynamic, movable lights and it works quite well.

To make dynamic projectors you just have to use the "dynamicProjector" instead of the usual Projector. This can be attached to a mover as well.

-
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Another good idea, of using emitters : i will try some settings in the lighting and movement categories (didn't know these tips about Emitter)
However there is no dynamic projector coded for XIII yet. I 'll subclass Projector and add the following (melting from UT2k4 source and XIII movable light) and try it out :
Code:
Class DynamicProjector extends Projector;

Var vector OldLocation;

function Tick(float DeltaTime)
{
  DetachProjector();
  if ( Location != OldLocation )  OldLocation = Location; // bDynamicAttach doesn't exist for XIII
  AttachProjector();
}

defaultproperties
{
     bNoDelete=False
     bMovable=True
     bStatic=False
}
About the TriggerLight, it gave no-result, the terrain doesn't receive light from it ...To compare, i placed a staticmesh on the terrain. it received dyn light, but not the terrain. I'm afraid that, if it can't receive dyn lights, then it neither can't work with dyn emitters or dyn projectors... however i will try your ideas this evening, thanks for your replies !
 
Last edited:
Wormbo: Oh, I thought triggerlights were bStatic=true.

brick: Maybe your triggerlight is still set to bInitiallyOn=false?
This means the light will be turned off by mapload, so it has to be turned on (by a trigger or whatever) first to see it.

Just set bInitiallyOn to TRUE and that's it.

//edit: Hm, read about the staticmeshes.. Did you rebuild your geometry & lighting propperly?

-
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
Pandemonium : my triggerlight was well initialized at first, with a light-type Pulse. So that i could watch on the staticmesh the dyn light pulses on, but it didn't apply at all on the terrain near to it.
By cons, i compiled the DynamicProjector yesterday, placed one instance with the water-effect material used for CTF-Lostfaith), and it worked very fine ! Attached to a cycling mover, it worked as well. However some glitches, it doesn't fade across some terrain's quads seals.
 
Last edited:

brick

New Member
Sep 5, 2011
15
0
0
France
www.insidexiii.eu
What do you mean by hit ? If its radius is large enough, and its direction towards the terrain, yes this is it. But i'll post a screenshot, at least to see the whole thing.
 

xMurphyx

New Member
Jun 2, 2008
1,502
0
0
liandri.darkbb.com
I don't know if you've ever played Killing Floor, but there's a map called KF-Farm with a terrain and your pistol has a flashlight attached to it. The flashlight consists of a projector and a dynamic light. When you point it at the terrain most of the time you only see the projector and the dynamic light only shows up when you're hitting the terrain vertices just right.
So even if it should technically hit one, try increasing the radius some more and maybe move it around a bit just to rule out that that's the problem!
Apparently terrains can be a little choosy.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
I'm reading this with great interest, as it was something I was trying to achieve in UT but could never get to do correctly. What is the (guessed) performance hit on this as you guys are discussing it?
I wanted to import this idea into a remake of MH-DeadCity where you would see your shadows grow as the day turned into evening. Currently the maps use a time actor that tells you via chat time and bongs, not very immersive if you ask me.