diff --git a/Shaders/Genshin Impact/Includes/HoyoToonGenshin-program.hlsl b/Shaders/Genshin Impact/Includes/HoyoToonGenshin-program.hlsl index a6eb09c..d6185ae 100644 --- a/Shaders/Genshin Impact/Includes/HoyoToonGenshin-program.hlsl +++ b/Shaders/Genshin Impact/Includes/HoyoToonGenshin-program.hlsl @@ -564,7 +564,7 @@ float4 ps_model(vs_out i, bool vface : SV_ISFRONTFACE) : SV_TARGET float3 shadow_area = (float3)1.0f; shadow_area = shadow_area_transition(lightmap.y, i.v_col.x, ndotl, material_id); // metalshadow = shadow_area_transition(lightmapao, vertexao, ndotl, material_id); - if(_UseFaceMapNew) shadow_area = shadow_area_face(uv_a.xy, light).xxx; + if(_UseFaceMapNew) shadow_area = ndotl; // shadow = outshadow; float bright = lightmap.y > 0.9f && !_UseFaceMapNew; diff --git a/Shaders/Honkai Impact/Includes/HoyoToonHonkaiImpact-Program.hlsl b/Shaders/Honkai Impact/Includes/HoyoToonHonkaiImpact-Program.hlsl index 7ff7ae5..81ba322 100644 --- a/Shaders/Honkai Impact/Includes/HoyoToonHonkaiImpact-Program.hlsl +++ b/Shaders/Honkai Impact/Includes/HoyoToonHonkaiImpact-Program.hlsl @@ -158,19 +158,21 @@ float4 ps_model (vs_out i, bool vface : SV_ISFRONTFACE) : SV_Target float4 lightmap = _LightMapTex.Sample(sampler_linear_repeat, uv); float s = 1.0f; - + float light_shadow = 0.0f; #if defined(use_shadow) #if defined(faceishadow) // shadow stuff float shadow_right = (_FaceMapTex.Sample(sampler_linear_repeat, float2( uv.x, uv.y)).a); float shadow_left = (_FaceMapTex.Sample(sampler_linear_repeat, float2(1.0 - uv.x, uv.y)).a); - #endif - + #endif + light_shadow = hi3_shadow(lightmap.y, ndotl, vertex.x); + float4 shadow_col = shadow_cols(lightmap.a); if(variant_selector == 1 || variant_selector == 3) shadow_col = _ShadowColor; if(variant_selector == 1) { + light_shadow = saturate(dot(float3(0.5f, 0.5f, 1.0f), light_dir)); #if defined(faceishadow) s = shadow_rate_face(shadow_right, shadow_left, lightmap.y, i.ws_pos); #endif @@ -178,6 +180,7 @@ float4 ps_model (vs_out i, bool vface : SV_ISFRONTFACE) : SV_Target else { s = hi3_shadow(lightmap.y, ndotl, vertex.x); + // light_shadow = s; } float4 _shadow = min(s + (shadow_col), 1.0); #else @@ -322,7 +325,7 @@ float4 ps_model (vs_out i, bool vface : SV_ISFRONTFACE) : SV_Target #endif #ifdef _IS_PASS_LIGHT float light_intesnity = max(0.001f, (0.299f * _LightColor0.r + 0.587f * _LightColor0.g + 0.114f * _LightColor0.b)); - float3 light_pass_color = ((diffuse.xyz * 5.0f) * _LightColor0.xyz) * atten * s * 0.5f; + float3 light_pass_color = ((diffuse.xyz * 5.0f) * _LightColor0.xyz) * atten * light_shadow * 0.5f; float3 light_color = lerp(light_pass_color.xyz, lerp(0.0f, min(light_pass_color, light_pass_color / light_intesnity), _WorldSpaceLightPos0.w), _FilterLight); // prevents lights from becoming too intense #if defined(POINT) || defined(SPOT) out_col.xyz = (light_color) * 0.5f; diff --git a/Shaders/Honkai Impact/Includes/Part2-program.hlsl b/Shaders/Honkai Impact/Includes/Part2-program.hlsl index 5ca48cc..eb698eb 100644 --- a/Shaders/Honkai Impact/Includes/Part2-program.hlsl +++ b/Shaders/Honkai Impact/Includes/Part2-program.hlsl @@ -42,6 +42,7 @@ float4 ps_model(vs_out i, bool vface : SV_ISFRONTFACE) : SV_TARGET float3 light = _WorldSpaceLightPos0; #if defined(POINT) || defined(SPOT) light = normalize(_WorldSpaceLightPos0.xyz - i.ws_pos.xyz); + #endif // half vector @@ -246,6 +247,10 @@ float4 ps_model(vs_out i, bool vface : SV_ISFRONTFACE) : SV_TARGET #endif #ifdef _IS_PASS_LIGHT + if(variant_selector == 1 && _EnableFaceMap) + { + shaded_area.x = dot(float3(0.5f, 0.5f, 1.0f), light); + } float light_intesnity = max(0.001f, (0.299f * _LightColor0.r + 0.587f * _LightColor0.g + 0.114f * _LightColor0.b)); shaded_area.x = smoothstep(0.0f, 0.5f, shaded_area.x) * 0.8f + 0.1f; float3 light_pass_color = ((diffuse.xyz * 5.0f) * _LightColor0.xyz) * atten * shaded_area.x * 0.5f; diff --git a/Shaders/Honkai Star Rail/Includes/HoyoToonStarRail-program.hlsl b/Shaders/Honkai Star Rail/Includes/HoyoToonStarRail-program.hlsl index 6b40c83..ae71029 100644 --- a/Shaders/Honkai Star Rail/Includes/HoyoToonStarRail-program.hlsl +++ b/Shaders/Honkai Star Rail/Includes/HoyoToonStarRail-program.hlsl @@ -741,17 +741,18 @@ float4 ps_base(vs_out i, bool vface : SV_IsFrontFace) : SV_Target ndotl = dot(normal, light); float3 shadow_area = (float3)1.0f; - shadow_area = shadow_rate(ndotl, lightmap.y, i.v_col.x, 2.0f); + shadow_area = shadow_rate(ndotl, lightmap.y, i.v_col.x, 1.0f); // metalshadow = shadow_area_transition(lightmapao, vertexao, ndotl, material_id); #if defined(faceishadow) - if(_FaceMaterial) shadow_area = dot((float3)0.5f, light); + ndotl = dot(float3(0.5f, 0.5f, 1.0f), light); + if(_FaceMaterial) shadow_area = ndotl; #endif float light_intesnity = max(0.001f, (0.299f * _LightColor0.r + 0.587f * _LightColor0.g + 0.114f * _LightColor0.b)); - float3 light_pass_color = ((diffuse.xyz * 1.0f) * _LightColor0.xyz) * atten * shadow_area * 0.5f; + float3 light_pass_color = ((diffuse.xyz * 1.0f) * _LightColor0.xyz) * atten * shadow_area; float3 light_color = lerp(light_pass_color.xyz, lerp(0.0f, min(light_pass_color, light_pass_color / light_intesnity), _WorldSpaceLightPos0.w), _FilterLight); // prevents lights from becoming too intense #if defined(POINT) || defined(SPOT) - out_color.xyz = (light_color) * 0.5f; + out_color.xyz = (light_color); #elif defined(DIRECTIONAL) out_color.xyz = 0.0f; // dont let extra directional lights add onto the model, this will fuck a lot of shit up #endif diff --git a/Shaders/Wuthering Waves/Include/HoyoToonWutheringWaves-program.hlsl b/Shaders/Wuthering Waves/Include/HoyoToonWutheringWaves-program.hlsl index 7763d6b..b33e9dc 100644 --- a/Shaders/Wuthering Waves/Include/HoyoToonWutheringWaves-program.hlsl +++ b/Shaders/Wuthering Waves/Include/HoyoToonWutheringWaves-program.hlsl @@ -326,6 +326,7 @@ fixed4 ps_model (vertex_out i) : SV_Target float light_intesnity = max(0.001f, (0.299f * _LightColor0.r + 0.587f * _LightColor0.g + 0.114f * _LightColor0.b)); float3 light_pass_color = ((diffuse.xyz * 5.0f) * _LightColor0.xyz) * atten * shadow_area * 0.5f; float3 light_pass_a_color = lerp(light_pass_color.xyz, lerp(0.0f, min(light_pass_color, light_pass_color / light_intesnity), _WorldSpaceLightPos0.w), _FilterLight); // prevents lights from becoming too intense + if(_MaterialType == 6) light_pass_a_color = float3(0.0f, 0.0f, 0.0f); #if defined(POINT) || defined(SPOT) output.xyz = (light_pass_a_color) * 0.5f; #elif defined(DIRECTIONAL)