_sun_mangle

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
ajay
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

_sun_mangle

Post by ajay »

I'm experimenting with _sunlight in my map, overall I'm quite pleased withe effect as I can get a nice minimum light level but also some good areas of darkness. I'm having a little trouble getting the angle and direction right. I'm using _sun_mangle with values of 145 -30 - but it's not quite right. Basically I want it to come from a light source that is in the east and low to the 'horizon', but all my tinkering seems to make it worse! Any tips? Cheers ajay.
jitspoe
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: _sun_mangle

Post by jitspoe »

I'm not sure what compiler you're using, but here's something I added to Quake2 to make getting sun angles easy (for arghrad):

in g_cmds.c, somewhere in ClientCommand():

Code: Select all

else if (Q_strcaseeq(cmd, "angles"))
		{
			safe_cprintf(ent, PRINT_HIGH, "Angles(YPR): %g %g %g\n", ent->s.angles[YAW],
				ent->s.angles[PITCH] * -3.0f, ent->s.angles[ROLL]);
			safe_cprintf(ent, PRINT_HIGH, "_sun_angle: %g %g\n", ent->s.angles[YAW] + 180.0f,
				ent->s.angles[PITCH] * 3.0f);
		}
Aim the crosshair at the sun in the sky, type "angles", and, bam, you've got what you need.
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: _sun_mangle

Post by goldenboy »

The format is "yaw pitch".

Yaw uses compass angles between 1 and 360.

East would be 90, not 145.

Pitch is between -90 and 90 for "up" and "down". "0" means "horizon".

What effect you get depends on your map's geometry, your skybox and your sunlight settings, as well as the other light sources in your map. Unfortunately Q1 doesn't do radiosity or the various forms of atmospheric scattering, only the fake outdoor minlight by _sunlight2 or _sunlight3.

You're probably never going to get a convincing sunset in a Q1 map because the technology simply is extremely limited when it comes to simulating light. The best you can do is an approximation.
Post Reply