Fixed up the -netquake / -spasm / -fitz args slightly, should actually be usable now. sv_mintic 0 is now treated as 0.013 when using nqplayerphysics, to try to make it smoother for nq clients. Preparing for astc's volume formats. Mostly for completeness, I was bored. Disabled for now because nothing supports them anyway. Fix broken mousewheel in SDL2 builds. Fix configs not getting loaded following initial downloads in the web port/etc. Make the near-cloud layer of q1 scrolling sky fully opaque by default (like vanilla). Sky fog now ignores depth, treating it as an infinite distance. Fix turbs not responding to fog. r_fullbright no longer needs vid_reload to take effect (and more efficient now). Tweaked the audio code to use an format enum instead of byte width, just with the same values still, primarily to clean up loaders that deal with S32 vs F32, or U8 vs S8. Added a cvar to control whether to use threads for the qcgc. Still disabled by default but no longer requires engine recompiles to enable! git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5683 fc73d0e0-1445-4013-8a0c-d673dee63da5
47 lines
1.4 KiB
GLSL
47 lines
1.4 KiB
GLSL
!!permu FOG
|
|
!!samps reflectcube
|
|
!!cvardf r_skyfog=0.5
|
|
!!cvard4 r_glsl_skybox_orientation=0 0 0 0
|
|
#include "sys/defs.h"
|
|
#include "sys/fog.h"
|
|
|
|
//simple shader for simple skyboxes.
|
|
|
|
varying vec3 pos;
|
|
#ifdef VERTEX_SHADER
|
|
mat3 rotateAroundAxis(vec4 axis) //xyz axis, with angle in w
|
|
{
|
|
#define skyang axis.w*(3.14/180.0)*e_time
|
|
axis.xyz = normalize(axis.xyz);
|
|
float s = sin(skyang);
|
|
float c = cos(skyang);
|
|
float oc = 1.0 - c;
|
|
|
|
return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,
|
|
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,
|
|
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c);
|
|
}
|
|
void main ()
|
|
{
|
|
pos = v_position.xyz - e_eyepos;
|
|
|
|
if (r_glsl_skybox_orientation.xyz != vec3(0.0))
|
|
pos = pos*rotateAroundAxis(r_glsl_skybox_orientation);
|
|
|
|
gl_Position = ftetransform();
|
|
}
|
|
#endif
|
|
#ifdef FRAGMENT_SHADER
|
|
void main ()
|
|
{
|
|
vec4 skybox = textureCube(s_reflectcube, pos);
|
|
|
|
//Fun question: should sky be fogged as if infinite, or as if an actual surface?
|
|
#if 1
|
|
skybox.rgb = mix(skybox.rgb, w_fogcolour_ float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry
|
|
#else
|
|
skybox.rgb = mix(skybox.rgb, fog3(skybox.rgb), float(r_skyfog)); //fog in terms of actual geometry distance
|
|
#endif
|
|
gl_FragColor = skybox;
|
|
}
|
|
#endif
|