minib3d-monkey
minib3d-monkey copied to clipboard
HTML5 Fix for Lightmapping
at line 202 in opengl/basicshadergsl.monkey replace the FRAGBLEND string with the following
Global FRAGBLEND:String = "/*blendfunc*/"+
"vec4 BlendFunction(const float blend, const vec4 texture, const vec4 finalcolor, const vec4 vertcolorx) {"+
"vec4 color = one_zero.yyyy; "+
"if (blend ==1.0) {color.xyz = mix(finalcolor.xyz, texture.xyz, texture.w );color.w = vertcolorx.a; return color;"+
"} else if (blend ==2.0) { color = (vertcolorx * texture * finalcolor); return color;"+
"} else if(blend==3.0) { color = ((color * vertcolorx) + (texture * finalcolor)); return color;"+
"} else if(blend==4.0) { color = (vertcolorx * texture); return finalcolor+color;"+
"} else if(blend==5.0) { color = (vertcolorx * texture); return finalcolor*color;"+
"} return (texture);}"