minib3d-monkey icon indicating copy to clipboard operation
minib3d-monkey copied to clipboard

HTML5 Fix for Lightmapping

Open lancewrath opened this issue 10 years ago • 0 comments

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);}"

lancewrath avatar Aug 29 '14 18:08 lancewrath