diff --git a/MAKE.bat b/MAKE.bat index 7bb6ac7..af9c43f 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -343,6 +343,8 @@ if "%1"=="gwk" ( copy/y ..\fwk-mirror\engine\fwk.c _fwk\engine\fwk.c copy/y ..\fwk-mirror\engine\fwk _fwk\engine\fwk copy/y ..\fwk-mirror\engine\split\*.inl _fwk\engine\split\ + copy/y ..\fwk-mirror\engine\art\shaders\* _fwk\engine\art\shaders\ + copy/y ..\fwk-mirror\tools\*.c _fwk\tools\ rem copy/y ..\fwk-mirror\engine\split\3rd_*.c _fwk\engine\split\ call MAKE.bat back diff --git a/engine/art/shaders/fs_0_0_shadowmap_lit.glsl b/engine/art/shaders/fs_0_0_shadowmap_lit.glsl index dede787..da05899 100644 --- a/engine/art/shaders/fs_0_0_shadowmap_lit.glsl +++ b/engine/art/shaders/fs_0_0_shadowmap_lit.glsl @@ -109,4 +109,4 @@ struct light { #endif return vec4(clamp(vec3(total_lighting), 0., 1.), 1.0); #endif - } + } \ No newline at end of file diff --git a/engine/art/shaders/fs_32_4_model.glsl b/engine/art/shaders/fs_32_4_model.glsl index 9a4d624..872fba0 100644 --- a/engine/art/shaders/fs_32_4_model.glsl +++ b/engine/art/shaders/fs_32_4_model.glsl @@ -9,7 +9,7 @@ uniform vec4 u_diffuse = vec4(1.0,1.0,1.0,1.0); // lightmapping uniform sampler2D u_lightmap; uniform bool u_texlit; -uniform bool u_texmod = false; +uniform bool u_texmod = true; uniform float u_litboost = 1.0; in vec3 v_position; @@ -137,7 +137,7 @@ vec3 sh_lighting(vec3 n) { void main() { vec3 n = normalize(v_normal_ws); vec4 diffuse; - + if(u_textured) { diffuse = texture(u_texture2d, v_texcoord); } else { @@ -157,7 +157,7 @@ void main() { vec4 lit = vec4(1.0, 1.0, 1.0, 1.0); // SH lighting - /* if (!u_texlit) */ { + if (!u_texlit) { vec3 result = sh_lighting(n); if( (result.x*result.x+result.y*result.y+result.z*result.z) > 0.0 ) lit = vec4(result, 1.0); } @@ -167,7 +167,7 @@ void main() { // base vec4 diffuse; - + if(u_matcaps) { vec2 muv = vec2(view * vec4(v_normal_ws, 0))*0.5+vec2(0.5,0.5); // normal (model space) to view space diffuse = texture(u_texture2d, vec2(muv.x, 1.0-muv.y)); @@ -178,13 +178,15 @@ void main() { } if (u_texlit) { - vec4 litsample = texture(u_lightmap, v_texcoord2); + vec4 litsample = texture(u_lightmap, v_texcoord); if (u_texmod) { - diffuse.rgb *= litsample.rgb; + diffuse *= litsample; } else { - diffuse.rgb += litsample.rgb; + diffuse += litsample; } + + diffuse.rgb += sh_lighting(n); } // lighting mix diff --git a/engine/art/shaders/fs_shadow_vsm.glsl b/engine/art/shaders/fs_shadow_vsm.glsl index e369163..1416cbe 100644 --- a/engine/art/shaders/fs_shadow_vsm.glsl +++ b/engine/art/shaders/fs_shadow_vsm.glsl @@ -16,4 +16,4 @@ void main() { float dy = dFdy(depth); moment2 += 0.25*(dx*dx+dy*dy); outColor = vec4( moment1, moment2, 0.0, 0.0); -} +} \ No newline at end of file diff --git a/engine/art/shaders/preamble.glsl b/engine/art/shaders/preamble.glsl new file mode 100644 index 0000000..3cde54d --- /dev/null +++ b/engine/art/shaders/preamble.glsl @@ -0,0 +1 @@ +#version 150 diff --git a/engine/art/shaders/vs_323444143_16_3322_model.glsl b/engine/art/shaders/vs_323444143_16_3322_model.glsl index 00bc7bc..b9e94c2 100644 --- a/engine/art/shaders/vs_323444143_16_3322_model.glsl +++ b/engine/art/shaders/vs_323444143_16_3322_model.glsl @@ -56,8 +56,8 @@ in vec4 att_indexes; // @fixme: gles might use ivec4 instead? in vec4 att_weights; // @todo: downgrade from float to byte in float att_vertexindex; // for blendshapes in vec4 att_color; -in vec2 att_texcoord2; in vec3 att_bitangent; // @todo: remove? also, ass2iqe might output this +in vec2 att_texcoord2; out vec4 v_color; out vec3 v_position, v_position_ws; out vec3 v_normal, v_normal_ws; diff --git a/engine/art/shaders/vs_shadow_vsm.glsl b/engine/art/shaders/vs_shadow_vsm.glsl index fa03c6f..22f4e96 100644 --- a/engine/art/shaders/vs_shadow_vsm.glsl +++ b/engine/art/shaders/vs_shadow_vsm.glsl @@ -12,4 +12,4 @@ void main() { #else v_position = gl_Position; #endif -} +} \ No newline at end of file