update built-in shaders.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5956 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
af661232e3
commit
07365c6428
1 changed files with 62 additions and 4 deletions
|
@ -2555,7 +2555,7 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
{QR_OPENGL, 110, "default2d",
|
{QR_OPENGL, 110, "default2d",
|
||||||
"!!ver 100-450\n"
|
"!!ver 100-450\n"
|
||||||
"!!samps 1\n"
|
"!!samps img=0\n"
|
||||||
|
|
||||||
//this shader is present for support for gles/gl3core contexts
|
//this shader is present for support for gles/gl3core contexts
|
||||||
//it is single-texture-with-vertex-colours, and doesn't do anything special.
|
//it is single-texture-with-vertex-colours, and doesn't do anything special.
|
||||||
|
@ -2582,7 +2582,7 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
"#ifdef PREMUL\n"
|
"#ifdef PREMUL\n"
|
||||||
"f.rgb *= f.a;\n"
|
"f.rgb *= f.a;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"f *= texture2D(s_t0, tc);\n"
|
"f *= texture2D(s_img, tc);\n"
|
||||||
"gl_FragColor = f;\n"
|
"gl_FragColor = f;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
@ -2856,6 +2856,46 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
"}\n"
|
"}\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
#ifdef GLQUAKE
|
||||||
|
{QR_OPENGL, 110, "default2danim",
|
||||||
|
"!!ver 300-450\n"
|
||||||
|
"!!samps anim:2DArray=0\n"
|
||||||
|
|
||||||
|
"#include \"sys/defs.h\"\n"
|
||||||
|
|
||||||
|
//this shader is present for support for gles/gl3core contexts
|
||||||
|
//it is single-texture-with-vertex-colours, and doesn't do anything special.
|
||||||
|
//beware that a few things use this, including apparently fonts and bloom rescaling.
|
||||||
|
//its really not meant to do anything special.
|
||||||
|
|
||||||
|
"varying vec2 tc;\n"
|
||||||
|
"varying vec4 vc;\n"
|
||||||
|
|
||||||
|
"#ifdef VERTEX_SHADER\n"
|
||||||
|
"void main ()\n"
|
||||||
|
"{\n"
|
||||||
|
"tc = v_texcoord;\n"
|
||||||
|
"vc = v_colour;\n"
|
||||||
|
"gl_Position = ftetransform();\n"
|
||||||
|
"}\n"
|
||||||
|
"#endif\n"
|
||||||
|
"#ifdef FRAGMENT_SHADER\n"
|
||||||
|
"void main ()\n"
|
||||||
|
"{\n"
|
||||||
|
//figure out which frame to use.
|
||||||
|
"ivec3 sz = textureSize(s_anim, 0);\n"
|
||||||
|
"float layer = mod(e_time*10, sz.z-1);\n"
|
||||||
|
|
||||||
|
"vec4 f = vc;\n"
|
||||||
|
"#ifdef PREMUL\n"
|
||||||
|
"f.rgb *= f.a;\n"
|
||||||
|
"#endif\n"
|
||||||
|
"f *= texture(s_anim, vec3(tc, layer));\n"
|
||||||
|
"gl_FragColor = f;\n"
|
||||||
|
"}\n"
|
||||||
|
"#endif\n"
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
|
@ -3488,7 +3528,10 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
|
|
||||||
"col *= factor_base;\n"
|
"col *= factor_base;\n"
|
||||||
|
|
||||||
"#define dielectricSpecular 0.04\n"
|
"#ifndef IOR\n"
|
||||||
|
"#define IOR 1.5 //Index Of Reflection.\n"
|
||||||
|
"#endif\n"
|
||||||
|
"#define dielectricSpecular pow(((IOR - 1.0)/(IOR + 1.0)),2.0)\n"
|
||||||
"#ifdef SPECULAR\n"
|
"#ifdef SPECULAR\n"
|
||||||
"vec4 specs = texture2D(s_specular, tc)*factor_spec;\n"
|
"vec4 specs = texture2D(s_specular, tc)*factor_spec;\n"
|
||||||
"#ifdef ORM\n"
|
"#ifdef ORM\n"
|
||||||
|
@ -4405,6 +4448,16 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
"{\n"
|
"{\n"
|
||||||
"vec2 tccoord;\n"
|
"vec2 tccoord;\n"
|
||||||
"vec3 dir = pos - e_eyepos;\n"
|
"vec3 dir = pos - e_eyepos;\n"
|
||||||
|
|
||||||
|
"#ifdef EQUI\n"
|
||||||
|
"#define PI 3.1415926535897932384626433832795\n"
|
||||||
|
"dir = normalize(dir);\n"
|
||||||
|
"tccoord.x = atan(dir.x,dir.y) / (PI*2.0) + 0.5;\n"
|
||||||
|
"tccoord.y = acos(dir.z) / PI;\n"
|
||||||
|
|
||||||
|
"vec3 sky = vec3(texture2D(s_base, tccoord));\n"
|
||||||
|
"#else\n"
|
||||||
|
|
||||||
"dir.z *= 3.0;\n"
|
"dir.z *= 3.0;\n"
|
||||||
"dir.xy /= 0.5*length(dir);\n"
|
"dir.xy /= 0.5*length(dir);\n"
|
||||||
"tccoord = (dir.xy + e_time*0.03125);\n"
|
"tccoord = (dir.xy + e_time*0.03125);\n"
|
||||||
|
@ -4412,6 +4465,8 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
"tccoord = (dir.xy + e_time*0.0625);\n"
|
"tccoord = (dir.xy + e_time*0.0625);\n"
|
||||||
"vec4 clouds = texture2D(s_cloud, tccoord);\n"
|
"vec4 clouds = texture2D(s_cloud, tccoord);\n"
|
||||||
"sky = (sky.rgb*(1.0-clouds.a)) + (clouds.a*clouds.rgb);\n"
|
"sky = (sky.rgb*(1.0-clouds.a)) + (clouds.a*clouds.rgb);\n"
|
||||||
|
"#endif\n"
|
||||||
|
|
||||||
"#ifdef FOG\n"
|
"#ifdef FOG\n"
|
||||||
"sky.rgb = mix(sky.rgb, w_fogcolour, float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry\n"
|
"sky.rgb = mix(sky.rgb, w_fogcolour, float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry\n"
|
||||||
//sky = fog3(sky); //fog according to actual geometry
|
//sky = fog3(sky); //fog according to actual geometry
|
||||||
|
@ -6185,7 +6240,10 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
|
||||||
// col *= factor_base;
|
// col *= factor_base;
|
||||||
"#define dielectricSpecular 0.04\n"
|
"#ifndef IOR\n"
|
||||||
|
"#define IOR 1.5 //Index Of Reflection.\n"
|
||||||
|
"#endif\n"
|
||||||
|
"#define dielectricSpecular pow(((IOR - 1.0)/(IOR + 1.0)),2.0)\n"
|
||||||
"#ifdef SPECULAR\n"
|
"#ifdef SPECULAR\n"
|
||||||
"vec4 specs = texture2D(s_specular, tc);//*factor_spec;\n"
|
"vec4 specs = texture2D(s_specular, tc);//*factor_spec;\n"
|
||||||
"#ifdef ORM\n"
|
"#ifdef ORM\n"
|
||||||
|
|
Loading…
Reference in a new issue