_sun_mangle
_sun_mangle
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.
Re: _sun_mangle
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():
Aim the crosshair at the sun in the sky, type "angles", and, bam, you've got what you need.
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);
}
Re: _sun_mangle
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.
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.