> 1) * 2.0; vec2 pos = out_uv * 2.0 - 1.0; gl_Position = vec4(pos, 0.0, 1.0); out_clusterIJ = vec2(CLUSTER_COUNT_X, CLUSTER_COUNT_Y) * out_uv; } ]]> = 0.0) { float shadow = computeShadowFactorOmni(frag2Light, light.radiusPad1.x, light.atlasTiles, light.diffuseColorTileSize.w, u_shadowTex); lambert *= shadow; } out_color += (diffC + specC) * light.diffuseColorTileSize.rgb * (att * max(gbuffer.subsurface, lambert)); } // Spot lights count = u_lightIndices[idxOffset++]; idxOffsetEnd = idxOffset + count; ANKI_LOOP while(idxOffset < idxOffsetEnd) { SpotLight light = u_spotLights[u_lightIndices[idxOffset++]]; LIGHTING_COMMON_BRDF(); float spot = computeSpotFactor( l, light.outerCosInnerCos.x, light.outerCosInnerCos.y, light.lightDirRadius.xyz); float shadowmapLayerIdx = light.diffuseColorShadowmapId.w; if(shadowmapLayerIdx >= 0.0) { float shadow = computeShadowFactorSpot( light.texProjectionMat, worldPos, light.lightDirRadius.w, u_shadowTex); lambert *= shadow; } out_color += (diffC + specC) * light.diffuseColorShadowmapId.rgb * (att * spot * max(gbuffer.subsurface, lambert)); } #if 0 count = scount; if(count == 0) { out_color = vec3(0.0, 0.0, 0.0); } else if(count == 1) { out_color = vec3(1.0, 0.0, 0.0); } else if(count == 2) { out_color = vec3(0.0, 1.0, 0.0); } else if(count == 3) { out_color = vec3(0.0, 0.0, 1.0); } else { out_color = vec3(1.0, 1.0, 1.0); } #endif } ]]>