Change the detail map to a more usefull decal shader. Now we can add easily details to texture

This commit is contained in:
samuncle 2016-12-28 10:23:07 -05:00
parent 8c5c85245f
commit b669382b93
2 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,8 @@ void main(void)
#endif
#endif
vec4 detail = texture(Detail, uv_bis);
color *= detail;
detail.rgb = detail.a * detail.rgb;
color.rgb = detail.rgb + color.rgb * (1 - detail.a);
float specmap = texture(SpecMap, uv).g;
FragColor = vec4(getLightFactor(color.xyz, vec3(1.), specmap, 0.), 1.);
}

View File

@ -29,6 +29,7 @@ void main(void)
vec4 detail = texture(Detail, uv_bis);
float specmap = texture(SpecMap, uv).g;
#endif
color *= detail;
detail.rgb = detail.a * detail.rgb;
color.rgb = detail.rgb + color.rgb * (1 - detail.a);
FragColor = vec4(getLightFactor(color.xyz, vec3(1.), specmap, 0.), 1.);
}