PDA

View Full Version : Fun in the Sun


Mr.Sardine
28th Oct 2004, 05: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
{
...
LE_Sunlight,
...
} 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

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

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

JonAzz
28th Oct 2004, 08: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...

T2A`
28th Oct 2004, 09: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.

Mr.Sardine
29th Oct 2004, 06: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...

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

If the sun is pointing like this...
http://filebox.vt.edu/users/bgibson/sunangle1.jpg

...you get shadows like this.
http://filebox.vt.edu/users/bgibson/shadowlength1.jpg

Now, if the sun is pointing like this...
http://filebox.vt.edu/users/bgibson/sunangle2.jpg

...you get shadows like this.
http://filebox.vt.edu/users/bgibson/shadowlength2.jpg

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?

chip
29th Oct 2004, 10: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.

Mr.Sardine
29th Oct 2004, 10: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.

chip
29th Oct 2004, 10: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.

Mr.Sardine
29th Oct 2004, 02: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.

chip
29th Oct 2004, 03: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.

T2A`
29th Oct 2004, 05: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

Mr.Sardine
29th Oct 2004, 06:45 PM
Aha Thanks

BmB23
30th Oct 2004, 05: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!