UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

3 lines (2 loc) 937 B
declare const _default: "\n\n#ifdef LIT_LIGHTMAP_BAKING_ADD_AMBIENT\n // diffuse light stores accumulated AO, apply contrast and brightness to it\n // and multiply ambient light color by the AO\n dDiffuseLight = ((dDiffuseLight - 0.5) * max(ambientBakeOcclusionContrast + 1.0, 0.0)) + 0.5;\n dDiffuseLight += vec3(ambientBakeOcclusionBrightness);\n dDiffuseLight = saturate(dDiffuseLight);\n dDiffuseLight *= dAmbientLight;\n#endif\n\n#ifdef LIGHTMAP_RGBM\n // encode to RGBM\n gl_FragColor.rgb = dDiffuseLight;\n gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));\n gl_FragColor.rgb /= 8.0;\n gl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );\n gl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;\n gl_FragColor.rgb /= gl_FragColor.a;\n#else\n gl_FragColor = vec4(dDiffuseLight, 1.0);\n#endif\n"; export default _default;