fixed bug in gui+shader

This commit is contained in:
jeanlf
2018-02-28 09:14:22 +01:00
parent 368c3c00e4
commit fe633764f3
2 changed files with 10 additions and 5 deletions

View File

@@ -46,8 +46,11 @@ extension.open_local_file = function () {
var f = history[history.length - i - 1];
var names = f.url.split('/');
if (names.length == 0) names = f.url.split('\\');
o.name = names.pop();
if (names.length == 0) {
o.name = names.pop();
} else {
o.name = f.url;
}
o.directory = false;
o.path = f.url;
var delim = f.url.slice(-1);

View File

@@ -319,7 +319,7 @@ void main()
rgb.b = dot(yuv, B_mul);
rgba = vec4(rgb, alpha);
#elif defined(GF_GL_IS_ExternalOES)
rgba = texture2D(imgOES, TexCoord);
#else
@@ -340,9 +340,11 @@ void main()
//we have mat 2D + texture
#ifndef GF_GL_IS_ExternalOES
if (hasMaterial2D) {
if(gfEmissionColor.a > 0.0 && gfEmissionColor.a <1.0) {
if (gfEmissionColor.a > 0.0) {
fragColor *= gfEmissionColor;
} else if(fragColor.rgb == vec3(0.0, 0.0, 0.0)){
}
//hack - if full transparency on texture with material2D, use material color
else if (fragColor.rgb == vec3(0.0, 0.0, 0.0)){
fragColor.rgb = gfEmissionColor.rgb;
}
}