View Full Version : Fun in the Sun

28th Oct 2004, 04:25 PM
No, not Red Dwarf, but Sunlight. What I want to know is how I can control the angle of light and therefore angle/length of shadows? What I want to do is create a sunset with long shadows.

I tried rotating my sunlight but it only changes the area that the light covers, and not the direction of the light rays themselves.

So I looked in actor class and found:

var(Lighting) enum ELightEffect
} LightEffect;

but where/how are the properties of LE_Sunlight defined? Is it hard coded into the engine or can its properties be edited?

Thanks and a free beer to anyone who can help with this

28th Oct 2004, 06:09 PM
For long shadows, move the Sunlight actor lower.

28th Oct 2004, 06:25 PM
Tried that - doesnt work. The Sunlight rays are parallel coming from an infinite distance so makes no difference where you place it.

28th Oct 2004, 07:01 PM
I really don't think there is a way to do this other than rendering a lightmap for the terrian in a 3rd party program...

28th Oct 2004, 08:08 PM
What do you mean rotating the sun doesn't affect the direction of the rays? That's why there's an arrow on the sunlight actor... You are aware of that arrow, aren't you? You do have four perspectives in UEd, don't you? And yes, lighting is native C++ code that you can't edit.

29th Oct 2004, 05:25 AM
Yes Im aware of the arrow but it only changes the area that is lit. It doesnt affect the actual angle of light/shadows.
O well maybe in Unreal 3...

29th Oct 2004, 08:47 AM
Okay, now you're just upsetting me.

If the sun is pointing like this...

...you get shadows like this.

Now, if the sun is pointing like this...

...you get shadows like this.

What's so hard about that? And if, somehow, that's still not what you're talking about, please, please elaborate, because right now you're making no sense.

You have, pray tell, hit the BUILD LIGHTING button, haven't you?

29th Oct 2004, 09:19 AM
Yes Im aware of the arrow but it only changes the area that is lit. It doesnt affect the actual angle of light/shadows.
O well maybe in Unreal 3...T2A is correct -- the directional arrow determines lighting angle. Sunlight coverage is 100% in the zone in which it is placed -- it imitates parallel rays, not a local point source.

you can get VERY long shadows with a sunlight actor set at a shallow incidence angle.

29th Oct 2004, 09:39 AM
Strange I cant get it to work at all like that! No matter how I move the arrow or position sun the shadows always appear at about 45 degs! And yes I always build all.

29th Oct 2004, 09:49 AM
position of the sunlight actor makes no difference -- just the angle set in the Movement>Rotation properties, or interactively adjusted with the mouse. what are the Pitch, Roll & Yaw specs of the different angles you've tried and gotten no change? chances are you're rotating the actor but perhaps not on the correct axis.

29th Oct 2004, 01:55 PM
Ok I see whats happening now - shadows of buildings and objects etc change with the angle, but player shadows do not and are fixed at an angle that has no relation to anything else. Its the player shadows I was looking at and not seeing any change.

29th Oct 2004, 02:50 PM
standard player shadows are generated by an entirely different method that has nothing to do with the environmental lighting. there is good info on the Wiki about a modded realtime shadow technique, but i'm not very familiar with its capabilities regarding imitating sunlight-generated shadows. worth a read.

29th Oct 2004, 04:04 PM
Shadows are projectors, and Chip's right, they have nothing to do with lights at all. Here's SquirrelZero's implementation of real-time shadows using his own projector that reads in the position of nearby lights: http://wiki.beyondunreal.com/wiki/SquirrelZero/RealtimeShadows

29th Oct 2004, 05:45 PM
Aha Thanks

30th Oct 2004, 04:44 AM
you *could* skip the use of sunlight actor and light the scene whith a normal light actor.

but it wouldnt be the best thing to do!