diff options
author | aap <aap@papnet.eu> | 2021-01-12 13:41:22 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2021-01-12 13:41:29 +0100 |
commit | 9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df (patch) | |
tree | a7873279062f306cfc0371d29d4b015a5920642e /src/extras/shaders | |
parent | Merge pull request #948 from Sergeanur/lcsPR/CutsceneMgr (diff) | |
download | re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar.gz re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar.bz2 re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar.lz re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar.xz re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.tar.zst re3-9b2037419f96c6627cb5f2a6f9d127ef1dcdb9df.zip |
Diffstat (limited to 'src/extras/shaders')
-rw-r--r-- | src/extras/shaders/Makefile | 13 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile.frag | 76 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile.vert | 42 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_PS.cso | bin | 0 -> 728 bytes | |||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_PS.hlsl | 54 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_PS.inc | 63 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_VS.cso | bin | 0 -> 1556 bytes | |||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_VS.hlsl | 60 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_VS.inc | 132 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_fs_gl.inc | 78 | ||||
-rw-r--r-- | src/extras/shaders/leedsVehicle_mobile_vs_gl.inc | 44 |
11 files changed, 561 insertions, 1 deletions
diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile index 87777e74..393ab660 100644 --- a/src/extras/shaders/Makefile +++ b/src/extras/shaders/Makefile @@ -5,7 +5,8 @@ all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \ neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc \ im2d_UV2_gl.inc screenDroplet_fs_gl.inc \ leedsBuilding_vs_gl.inc leedsBuilding_mobile_vs_gl.inc scale_fs_gl.inc \ - leedsVehicle_vs_gl.inc leedsVehicle_add_gl.inc leedsVehicle_blend_gl.inc + leedsVehicle_vs_gl.inc leedsVehicle_add_gl.inc leedsVehicle_blend_gl.inc \ + leedsVehicle_mobile_vs_gl.inc leedsVehicle_mobile_fs_gl.inc im2d_gl.inc: im2d.vert (echo 'const char *im2d_vert_src =';\ @@ -108,3 +109,13 @@ leedsVehicle_blend_gl.inc: leedsVehicle_blend.frag (echo 'const char *leedsVehicle_blend_frag_src =';\ sed 's/..*/"&\\n"/' leedsVehicle_blend.frag;\ echo ';') >leedsVehicle_blend_gl.inc + +leedsVehicle_mobile_vs_gl.inc: leedsVehicle_mobile.vert + (echo 'const char *leedsVehicle_mobile_vert_src =';\ + sed 's/..*/"&\\n"/' leedsVehicle_mobile.vert;\ + echo ';') >leedsVehicle_mobile_vs_gl.inc + +leedsVehicle_mobile_fs_gl.inc: leedsVehicle_mobile.frag + (echo 'const char *leedsVehicle_mobile_frag_src =';\ + sed 's/..*/"&\\n"/' leedsVehicle_mobile.frag;\ + echo ';') >leedsVehicle_mobile_fs_gl.inc diff --git a/src/extras/shaders/leedsVehicle_mobile.frag b/src/extras/shaders/leedsVehicle_mobile.frag new file mode 100644 index 00000000..467379dd --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile.frag @@ -0,0 +1,76 @@ +uniform sampler2D tex0; +uniform sampler2D tex1; + +uniform float u_fxparams; +uniform vec3 u_skyTop; +uniform vec3 u_skyBot; + +#define shininess (u_fxparams) + +// matfx: +// case 1 normal envmap +// custom1 (4.0, 1.0, 1.0, coef) +// custom2 (0.25, 3.0, 1.0, 1.0) +// case 2 too strong +// custom1 (4.0, 1.0, 2.0, coef) +// custom2 (0.5, 3.0, 1.0, 1.0) +// ???: practically no fresnel +// custom1 (4.0, 1.25, 0.01, coef) +// custom2 (1.0, 2.0, 1.1, 2.0) + +#define power (4.0) + +#define preMult (1.0) +#define postMult (1.0) +#define minRefl (0.25) +#define maxRefl (3.0) +#define minOpacity (1.0) +#define maxOpacity (1.0) + +//#define preMult (1.0) +//#define postMult (2.0) +//#define minRefl (0.5) +//#define maxRefl (3.0) +//#define minOpacity (1.0) +//#define maxOpacity (1.0) + +//#define preMult (1.25) +//#define postMult (0.01) +//#define minRefl (1.0) +//#define maxRefl (2.0) +//#define minOpacity (1.1) +//#define maxOpacity (2.0) + +FSIN vec4 v_color; +FSIN vec2 v_tex0; +FSIN vec2 v_tex1; +FSIN float v_fog; +FSIN vec2 v_reflData; + +#define v_NdotV (v_reflData.x) +#define v_lightingCont (v_reflData.y) + +void +main(void) +{ + vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y)); + + vec3 envtex = texture(tex1, v_tex1).rgb; // V flipped + vec3 skyColour = mix(u_skyBot, u_skyTop, envtex.g); + vec3 envOut = mix(envtex.rrr, skyColour, envtex.b); + + float fresnel = mix(shininess, shininess * 2.0, v_NdotV); + fresnel = pow(v_NdotV * preMult, power); + fresnel = clamp(fresnel * postMult, 0.0, 1.0); + float reflectivity = v_lightingCont * mix(minRefl, maxRefl, fresnel)*shininess; + + float opacity = mix(minOpacity, maxOpacity, fresnel)*pass1.a; + vec4 color = pass1 + vec4(reflectivity * envOut, 0.0); + color.a = opacity; + + color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog); + + DoAlphaTest(color.a); + + FRAGCOLOR(color); +} diff --git a/src/extras/shaders/leedsVehicle_mobile.vert b/src/extras/shaders/leedsVehicle_mobile.vert new file mode 100644 index 00000000..e18c2f02 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile.vert @@ -0,0 +1,42 @@ +uniform vec4 u_amb; +uniform vec4 u_emiss; + +VSIN(ATTRIB_POS) vec3 in_pos; + +VSOUT vec4 v_color; +VSOUT vec2 v_tex0; +VSOUT vec2 v_tex1; +VSOUT float v_fog; +VSOUT vec2 v_reflData; + +#define v_NdotV (v_reflData.x) +#define v_lightingCont (v_reflData.y) + +void +main(void) +{ + vec4 Vertex = u_world * vec4(in_pos, 1.0); + gl_Position = u_proj * u_view * Vertex; + vec3 Normal = mat3(u_world) * in_normal; + + v_tex0 = in_tex0; + + vec3 ViewNormal = mat3(u_view) * Normal; + v_tex1 = (ViewNormal.xy + vec2(1.0, 1.0))*0.5; + + v_color = in_color; + vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z); +// v_color.rgb += u_ambLight.rgb*surfAmbient; + v_color.rgb += combinedAmbient.rgb*surfAmbient; + v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse; + v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0); +// v_color = clamp(v_color, 0.0, 1.0); + v_color *= u_matColor; + + // for fresnel + vec3 camPos = -u_view[3].xyz * mat3(u_view); + vec3 viewVec = normalize(Vertex.xyz - camPos); + v_NdotV = 1.0 - dot(-Normal.xyz, viewVec.xyz); + + v_fog = DoFog(gl_Position.w); +} diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.cso b/src/extras/shaders/leedsVehicle_mobile_PS.cso Binary files differnew file mode 100644 index 00000000..04ffcf8e --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_PS.cso diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.hlsl b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl new file mode 100644 index 00000000..e81c66c9 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_PS.hlsl @@ -0,0 +1,54 @@ +struct VS_out { + float4 Position : POSITION; + float3 TexCoord0 : TEXCOORD0; + float2 TexCoord1 : TEXCOORD1; + float2 ReflData : TEXCOORD2; + float4 Color : COLOR0; +}; + +#define NdotV (input.ReflData.x) +#define lightingCont (input.ReflData.y) + +sampler2D diffTex : register(s0); +sampler2D envTex : register(s1); + +float4 fogColor : register(c0); + +float4 fxparams : register(c1); +float3 skyTop : register(c2); +float3 skyBot : register(c3); + +#define shininess (fxparams.x) + +#define power (4.0) + +#define preMult (1.0) +#define postMult (1.0) +#define minRefl (0.25) +#define maxRefl (3.0) +#define minOpacity (1.0) +#define maxOpacity (1.0) + + +float4 main(VS_out input) : COLOR +{ + float4 pass1 = input.Color*tex2D(diffTex, input.TexCoord0.xy); + + float3 envtex = tex2D(envTex, float2(input.TexCoord1.x, 1.0-input.TexCoord1.y)).rgb; // V flipped + float3 skyColour = lerp(skyBot, skyTop, envtex.g); + float3 envOut = lerp(envtex.rrr, skyColour, envtex.b); + + float fresnel = lerp(shininess, shininess * 2.0, NdotV); + fresnel = pow(NdotV * preMult, power); + fresnel = clamp(fresnel * postMult, 0.0, 1.0); + float reflectivity = lightingCont * lerp(minRefl, maxRefl, fresnel)*shininess; + + float opacity = lerp(minOpacity, maxOpacity, fresnel)*pass1.a; + float4 color = pass1 + float4(reflectivity * envOut, 0.0); +//float4 color = float4(reflectivity, reflectivity, reflectivity, reflectivity); + color.a = opacity; + + color.rgb = lerp(fogColor.rgb, color.rgb, input.TexCoord0.z); + + return color; +} diff --git a/src/extras/shaders/leedsVehicle_mobile_PS.inc b/src/extras/shaders/leedsVehicle_mobile_PS.inc new file mode 100644 index 00000000..ab8cc048 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_PS.inc @@ -0,0 +1,63 @@ +static unsigned char leedsVehicle_mobile_PS_cso[] = { + 0x00, 0x02, 0xff, 0xff, 0xfe, 0xff, 0x51, 0x00, 0x43, 0x54, 0x41, 0x42, + 0x1c, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, + 0x06, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x07, 0x01, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x02, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xac, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00, + 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xd0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x06, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe9, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0a, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x64, 0x69, 0x66, 0x66, 0x54, 0x65, 0x78, 0x00, + 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x65, 0x6e, 0x76, 0x54, 0x65, 0x78, 0x00, 0xab, + 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x78, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x00, 0x73, 0x6b, 0x79, 0x42, 0x6f, 0x74, 0x00, + 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x73, 0x6b, 0x79, 0x54, 0x6f, 0x70, 0x00, 0x70, + 0x73, 0x5f, 0x32, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, + 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, + 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, + 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, + 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0xbf, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, + 0x05, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x30, 0x40, 0x00, 0x00, 0x80, 0x3e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0xb0, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xb0, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x90, 0x01, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xb0, 0x00, 0x08, 0xe4, 0xa0, + 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xe4, 0xa0, + 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x07, 0x80, 0x01, 0x00, 0xe4, 0x81, + 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x03, 0x80, + 0x01, 0x00, 0xe4, 0xb0, 0x04, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0xd2, 0xa0, + 0x42, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0x80, + 0x01, 0x08, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, + 0x02, 0x00, 0x55, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, + 0x12, 0x00, 0x00, 0x04, 0x03, 0x00, 0x07, 0x80, 0x02, 0x00, 0xaa, 0x80, + 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, + 0x03, 0x00, 0x08, 0x80, 0x02, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0xb0, + 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x18, 0x80, 0x03, 0x00, 0xff, 0x80, + 0x03, 0x00, 0xff, 0x80, 0x04, 0x00, 0x00, 0x04, 0x03, 0x00, 0x08, 0x80, + 0x03, 0x00, 0xff, 0x80, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x55, 0xa0, + 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0x80, + 0x02, 0x00, 0x55, 0xb0, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0x08, 0x80, + 0x03, 0x00, 0xff, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, + 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x03, 0x00, 0xff, 0x80, + 0x03, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x12, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0xaa, 0xb0, 0x01, 0x00, 0xe4, 0x80, + 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x0f, 0x80, + 0x00, 0x00, 0xe4, 0x80, 0xff, 0xff, 0x00, 0x00 +}; diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.cso b/src/extras/shaders/leedsVehicle_mobile_VS.cso Binary files differnew file mode 100644 index 00000000..85796f30 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_VS.cso diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.hlsl b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl new file mode 100644 index 00000000..667c0963 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_VS.hlsl @@ -0,0 +1,60 @@ +#include "standardConstants.h" + +float4 emissive : register(c41); +float4 ambient : register(c42); +float4x4 viewMat : register(c43); + +struct VS_in +{ + float4 Position : POSITION; + float3 Normal : NORMAL; + float2 TexCoord : TEXCOORD0; + float4 Prelight : COLOR0; +}; + +struct VS_out { + float4 Position : POSITION; + float3 TexCoord0 : TEXCOORD0; // also fog + float2 TexCoord1 : TEXCOORD1; + float2 ReflData : TEXCOORD2; + float4 Color : COLOR0; +}; + +#define NdotV (output.ReflData.x) +#define lightingCont (output.ReflData.y) + +VS_out main(in VS_in input) +{ + VS_out output; + + output.Position = mul(combinedMat, input.Position); + float3 V = mul(worldMat, input.Position).xyz; + float3 N = mul(normalMat, input.Normal); + + output.TexCoord0.xy = input.TexCoord; + + float4 ViewNormal = mul(viewMat, float4(N, 0.0)); + output.TexCoord1 = (ViewNormal.xy + float2(1.0, 1.0))*0.5; + + output.Color = input.Prelight; + float4 combinedAmbient = lerp(emissive, ambient, N.z); +// output.Color.rgb += ambientLight.rgb * surfAmbient; + output.Color.rgb += combinedAmbient.rgb * surfAmbient; + + int i; + for(i = 0; i < numDirLights; i++) + output.Color.xyz += DoDirLight(lights[i+firstDirLight], N)*surfDiffuse; + lightingCont = max(0.5, (output.Color.r + output.Color.g + output.Color.b) / 3.0); + // PS2 clamps before material color +// output.Color = clamp(output.Color, 0.0, 1.0); + output.Color *= matCol; + + // for fresnel + float3 camPos = mul(-viewMat._m03_m13_m23, (float3x3)(viewMat)); + float3 viewVec = normalize(V.xyz - camPos); + NdotV = 1.0 - dot(-N.xyz, viewVec.xyz); + + output.TexCoord0.z = clamp((output.Position.w - fogEnd)*fogRange, fogDisable, 1.0); + + return output; +} diff --git a/src/extras/shaders/leedsVehicle_mobile_VS.inc b/src/extras/shaders/leedsVehicle_mobile_VS.inc new file mode 100644 index 00000000..aa8859b1 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_VS.inc @@ -0,0 +1,132 @@ +static unsigned char leedsVehicle_mobile_VS_cso[] = { + 0x00, 0x02, 0xfe, 0xff, 0xfe, 0xff, 0x99, 0x00, 0x43, 0x54, 0x41, 0x42, + 0x1c, 0x00, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff, + 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x27, 0x02, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x02, 0x00, 0x2a, 0x00, + 0x01, 0x00, 0xaa, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x24, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, + 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, + 0x02, 0x00, 0x29, 0x00, 0x01, 0x00, 0xa6, 0x00, 0x14, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, + 0x01, 0x00, 0x42, 0x00, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x64, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x3a, 0x00, + 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, + 0x02, 0x00, 0x11, 0x00, 0x18, 0x00, 0x46, 0x00, 0xb8, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00, + 0x01, 0x00, 0x32, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcf, 0x01, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x03, 0x00, 0x22, 0x00, + 0xdc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0xfc, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x0d, 0x00, + 0x01, 0x00, 0x36, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x16, 0x02, 0x00, 0x00, 0x02, 0x00, 0x2b, 0x00, 0x04, 0x00, 0xae, 0x00, + 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, 0x12, 0x00, 0x30, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x6e, 0x74, 0x00, + 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64, + 0x4d, 0x61, 0x74, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x76, 0x65, 0x00, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4c, 0x69, + 0x67, 0x68, 0x74, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x6f, 0x67, 0x44, + 0x61, 0x74, 0x61, 0x00, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x00, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00, + 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0xab, 0x73, 0x01, 0x00, 0x00, + 0x7c, 0x01, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, + 0x95, 0x01, 0x00, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x03, 0x00, 0xa0, 0x01, 0x00, 0x00, + 0x6d, 0x61, 0x74, 0x43, 0x6f, 0x6c, 0x00, 0x6e, 0x6f, 0x72, 0x6d, 0x61, + 0x6c, 0x4d, 0x61, 0x74, 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6e, 0x75, 0x6d, 0x44, 0x69, 0x72, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, + 0x00, 0xab, 0xab, 0xab, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x75, 0x72, 0x66, + 0x50, 0x72, 0x6f, 0x70, 0x73, 0x00, 0x76, 0x69, 0x65, 0x77, 0x4d, 0x61, + 0x74, 0x00, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x4d, 0x61, 0x74, 0x00, 0x76, + 0x73, 0x5f, 0x32, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, + 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, + 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, + 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0x51, 0x00, 0x00, 0x05, + 0x0b, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x51, 0x00, 0x00, 0x05, + 0x0f, 0x00, 0x0f, 0xa0, 0xab, 0xaa, 0xaa, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, + 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, + 0x0a, 0x00, 0x00, 0x80, 0x03, 0x00, 0x0f, 0x90, 0x05, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x55, 0x90, 0x01, 0x00, 0xe4, 0xa0, + 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, + 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x90, + 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, + 0x03, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90, 0x00, 0x00, 0xe4, 0x80, + 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0xe4, 0x80, + 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x55, 0x90, + 0x05, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, + 0x04, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, + 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x06, 0x00, 0xe4, 0xa0, + 0x00, 0x00, 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x07, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xff, 0x90, + 0x00, 0x00, 0xe4, 0x80, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x07, 0x80, + 0x2e, 0x00, 0xe4, 0xa0, 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0x80, + 0x01, 0x00, 0xe4, 0x81, 0x2b, 0x00, 0xe4, 0xa0, 0x08, 0x00, 0x00, 0x03, + 0x02, 0x00, 0x02, 0x80, 0x01, 0x00, 0xe4, 0x81, 0x2c, 0x00, 0xe4, 0xa0, + 0x08, 0x00, 0x00, 0x03, 0x02, 0x00, 0x04, 0x80, 0x01, 0x00, 0xe4, 0x81, + 0x2d, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0x80, + 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0xe4, 0x81, 0x24, 0x00, 0x00, 0x02, + 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x07, 0x80, 0x01, 0x00, 0x55, 0x90, 0x09, 0x00, 0xe4, 0xa0, + 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x08, 0x00, 0xe4, 0xa0, + 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x07, 0x80, 0x0a, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xaa, 0x90, + 0x00, 0x00, 0xe4, 0x80, 0x08, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x80, + 0x00, 0x00, 0xe4, 0x81, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, + 0x01, 0x00, 0x06, 0x80, 0x00, 0x00, 0x55, 0x80, 0x2c, 0x00, 0xd0, 0xa0, + 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x06, 0x80, 0x2b, 0x00, 0xd0, 0xa0, + 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, + 0x01, 0x00, 0x06, 0x80, 0x2d, 0x00, 0xd0, 0xa0, 0x00, 0x00, 0xaa, 0x80, + 0x01, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x06, 0x80, + 0x01, 0x00, 0xe4, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, + 0x01, 0x00, 0x03, 0xe0, 0x01, 0x00, 0xe9, 0x80, 0x0b, 0x00, 0x55, 0xa0, + 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x07, 0x80, 0x29, 0x00, 0xe4, 0xa0, + 0x02, 0x00, 0x00, 0x03, 0x01, 0x00, 0x0e, 0x80, 0x02, 0x00, 0x90, 0x81, + 0x2a, 0x00, 0x90, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80, + 0x00, 0x00, 0xaa, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x29, 0x00, 0x90, 0xa0, + 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x80, 0x01, 0x00, 0xe4, 0x80, + 0x0d, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x90, 0x90, 0x01, 0x00, 0x00, 0x02, + 0x02, 0x00, 0x07, 0x80, 0x01, 0x00, 0xf9, 0x80, 0x01, 0x00, 0x00, 0x02, + 0x03, 0x00, 0x01, 0x80, 0x0b, 0x00, 0xaa, 0xa0, 0x26, 0x00, 0x00, 0x01, + 0x00, 0x00, 0xe4, 0xf0, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x02, 0x80, + 0x03, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0x03, + 0x03, 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0x80, 0x0b, 0x00, 0xff, 0xa0, + 0x2e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0xb0, 0x03, 0x00, 0x55, 0x80, + 0x08, 0x00, 0x00, 0x04, 0x03, 0x00, 0x02, 0x80, 0x00, 0x00, 0xe4, 0x80, + 0x13, 0x20, 0xe4, 0xa1, 0x00, 0x00, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x03, + 0x03, 0x00, 0x02, 0x80, 0x03, 0x00, 0x55, 0x80, 0x0b, 0x00, 0xaa, 0xa0, + 0x05, 0x00, 0x00, 0x04, 0x03, 0x00, 0x0e, 0x80, 0x03, 0x00, 0x55, 0x80, + 0x11, 0x20, 0x90, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00, 0x04, + 0x02, 0x00, 0x07, 0x80, 0x03, 0x00, 0xf9, 0x80, 0x0d, 0x00, 0xaa, 0xa0, + 0x02, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x03, 0x00, 0x01, 0x80, + 0x03, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0xa0, 0x27, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x08, 0x80, 0x03, 0x00, 0xff, 0x90, + 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xd0, 0x02, 0x00, 0xe4, 0x80, + 0x0c, 0x00, 0xe4, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x01, 0xe0, + 0x01, 0x00, 0x00, 0x81, 0x0b, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0x55, 0x80, 0x02, 0x00, 0x00, 0x80, + 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80, + 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, + 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xa0, 0x0b, 0x00, 0x00, 0x03, + 0x02, 0x00, 0x02, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x55, 0xa0, + 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xff, 0x80, + 0x0e, 0x00, 0x55, 0xa1, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, + 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xaa, 0xa0, 0x0b, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0xff, 0xa0, + 0x0a, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 0x80, + 0x0b, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xe0, + 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00 +}; diff --git a/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc b/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc new file mode 100644 index 00000000..8098599c --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_fs_gl.inc @@ -0,0 +1,78 @@ +const char *leedsVehicle_mobile_frag_src = +"uniform sampler2D tex0;\n" +"uniform sampler2D tex1;\n" + +"uniform float u_fxparams;\n" +"uniform vec3 u_skyTop;\n" +"uniform vec3 u_skyBot;\n" + +"#define shininess (u_fxparams)\n" + +"// matfx:\n" +"// case 1 normal envmap\n" +"// custom1 (4.0, 1.0, 1.0, coef)\n" +"// custom2 (0.25, 3.0, 1.0, 1.0)\n" +"// case 2 too strong\n" +"// custom1 (4.0, 1.0, 2.0, coef)\n" +"// custom2 (0.5, 3.0, 1.0, 1.0)\n" +"// ???: practically no fresnel\n" +"// custom1 (4.0, 1.25, 0.01, coef)\n" +"// custom2 (1.0, 2.0, 1.1, 2.0)\n" + +"#define power (4.0)\n" + +"#define preMult (1.0)\n" +"#define postMult (1.0)\n" +"#define minRefl (0.25)\n" +"#define maxRefl (3.0)\n" +"#define minOpacity (1.0)\n" +"#define maxOpacity (1.0)\n" + +"//#define preMult (1.0)\n" +"//#define postMult (2.0)\n" +"//#define minRefl (0.5)\n" +"//#define maxRefl (3.0)\n" +"//#define minOpacity (1.0)\n" +"//#define maxOpacity (1.0)\n" + +"//#define preMult (1.25)\n" +"//#define postMult (0.01)\n" +"//#define minRefl (1.0)\n" +"//#define maxRefl (2.0)\n" +"//#define minOpacity (1.1)\n" +"//#define maxOpacity (2.0)\n" + +"FSIN vec4 v_color;\n" +"FSIN vec2 v_tex0;\n" +"FSIN vec2 v_tex1;\n" +"FSIN float v_fog;\n" +"FSIN vec2 v_reflData;\n" + +"#define v_NdotV (v_reflData.x)\n" +"#define v_lightingCont (v_reflData.y)\n" + +"void\n" +"main(void)\n" +"{\n" +" vec4 pass1 = v_color*texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y));\n" + +" vec3 envtex = texture(tex1, v_tex1).rgb; // V flipped\n" +" vec3 skyColour = mix(u_skyBot, u_skyTop, envtex.g);\n" +" vec3 envOut = mix(envtex.rrr, skyColour, envtex.b);\n" + +" float fresnel = mix(shininess, shininess * 2.0, v_NdotV);\n" +" fresnel = pow(v_NdotV * preMult, power);\n" +" fresnel = clamp(fresnel * postMult, 0.0, 1.0);\n" +" float reflectivity = v_lightingCont * mix(minRefl, maxRefl, fresnel)*shininess;\n" + +" float opacity = mix(minOpacity, maxOpacity, fresnel)*pass1.a;\n" +" vec4 color = pass1 + vec4(reflectivity * envOut, 0.0);\n" +" color.a = opacity;\n" + +" color.rgb = mix(u_fogColor.rgb, color.rgb, v_fog);\n" + +" DoAlphaTest(color.a);\n" + +" FRAGCOLOR(color);\n" +"}\n" +; diff --git a/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc new file mode 100644 index 00000000..b1f07563 --- /dev/null +++ b/src/extras/shaders/leedsVehicle_mobile_vs_gl.inc @@ -0,0 +1,44 @@ +const char *leedsVehicle_mobile_vert_src = +"uniform vec4 u_amb;\n" +"uniform vec4 u_emiss;\n" + +"VSIN(ATTRIB_POS) vec3 in_pos;\n" + +"VSOUT vec4 v_color;\n" +"VSOUT vec2 v_tex0;\n" +"VSOUT vec2 v_tex1;\n" +"VSOUT float v_fog;\n" +"VSOUT vec2 v_reflData;\n" + +"#define v_NdotV (v_reflData.x)\n" +"#define v_lightingCont (v_reflData.y)\n" + +"void\n" +"main(void)\n" +"{\n" +" vec4 Vertex = u_world * vec4(in_pos, 1.0);\n" +" gl_Position = u_proj * u_view * Vertex;\n" +" vec3 Normal = mat3(u_world) * in_normal;\n" + +" v_tex0 = in_tex0;\n" + +" vec3 ViewNormal = mat3(u_view) * Normal;\n" +" v_tex1 = (ViewNormal.xy + vec2(1.0, 1.0))*0.5;\n" + +" v_color = in_color;\n" +" vec4 combinedAmbient = mix(u_emiss, u_amb, Normal.z);\n" +"// v_color.rgb += u_ambLight.rgb*surfAmbient;\n" +" v_color.rgb += combinedAmbient.rgb*surfAmbient;\n" +" v_color.rgb += DoDynamicLight(Vertex.xyz, Normal)*surfDiffuse;\n" +" v_lightingCont = max(0.5, (v_color.r + v_color.g + v_color.b) / 3.0);\n" +"// v_color = clamp(v_color, 0.0, 1.0);\n" +" v_color *= u_matColor;\n" + +" // for fresnel\n" +" vec3 camPos = -u_view[3].xyz * mat3(u_view);\n" +" vec3 viewVec = normalize(Vertex.xyz - camPos);\n" +" v_NdotV = 1.0 - dot(-Normal.xyz, viewVec.xyz);\n" + +" v_fog = DoFog(gl_Position.w);\n" +"}\n" +; |