0.0) { vec3 col = textureLod(u_envTex, vec4(r, texArrIdx), ENV_TEX_MIP).rgb; outCol += col * lambert * cubeCoordSolidAngle(UV_TO_NDC(uv)); weight += lambert; } } } } //out_color = outCol / weight * PI; out_color = outCol / PI; } ]]>