mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Only calculate texture for uv2 if it actually needs to happen. So far doing it like this seems faster.
This commit is contained in:
parent
b3418a8c84
commit
52b89c9746
@ -11,14 +11,17 @@ void fragment() {
|
||||
vec2 base_uv2 = UV2;
|
||||
|
||||
vec4 albedo_tex = texture(texture_albedo, base_uv);
|
||||
vec4 albedo_tex2 = texture(texture_albedo, base_uv2);
|
||||
|
||||
float ratio = COLOR.a;
|
||||
|
||||
albedo_tex *= ratio;
|
||||
albedo_tex2 *= 1.0 - ratio;
|
||||
|
||||
albedo_tex += albedo_tex2;
|
||||
if (ratio < 0.998) {
|
||||
vec4 albedo_tex2 = texture(texture_albedo, base_uv2);
|
||||
|
||||
albedo_tex *= ratio;
|
||||
albedo_tex2 *= 1.0 - ratio;
|
||||
|
||||
albedo_tex += albedo_tex2;
|
||||
}
|
||||
|
||||
albedo_tex *= COLOR;
|
||||
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
||||
|
Loading…
Reference in New Issue
Block a user