mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-30 07:31:13 +00:00
4c2066601a
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
38 lines
967 B
GLSL
38 lines
967 B
GLSL
!!permu FOG
|
|
!!samps base=0, cloud=1
|
|
!!cvardf r_skyfog=0.5
|
|
#include "sys/fog.h"
|
|
|
|
//regular sky shader for scrolling q1 skies
|
|
//the sky surfaces are thrown through this as-is.
|
|
|
|
#ifdef VERTEX_SHADER
|
|
varying vec3 pos;
|
|
void main ()
|
|
{
|
|
pos = v_position.xyz;
|
|
gl_Position = ftetransform();
|
|
}
|
|
#endif
|
|
#ifdef FRAGMENT_SHADER
|
|
uniform float e_time;
|
|
uniform vec3 e_eyepos;
|
|
varying vec3 pos;
|
|
void main ()
|
|
{
|
|
vec2 tccoord;
|
|
vec3 dir = pos - e_eyepos;
|
|
dir.z *= 3.0;
|
|
dir.xy /= 0.5*length(dir);
|
|
tccoord = (dir.xy + e_time*0.03125);
|
|
vec3 sky = vec3(texture2D(s_base, tccoord));
|
|
tccoord = (dir.xy + e_time*0.0625);
|
|
vec4 clouds = texture2D(s_cloud, tccoord);
|
|
sky = (sky.rgb*(1.0-clouds.a)) + (clouds.a*clouds.rgb);
|
|
#ifdef FOG
|
|
sky.rgb = mix(sky.rgb, w_fogcolour, float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry
|
|
//sky = fog3(sky); //fog according to actual geometry
|
|
#endif
|
|
gl_FragColor = vec4(sky, 1.0);
|
|
}
|
|
#endif
|