UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

45 lines (36 loc) 951 B
var gsplatOutput_default = ( /* glsl */ ` #include "tonemappingPS" #include "decodePS" #include "gammaPS" #include "fogPS" #if FOG != NONE && !defined(GSPLAT_NO_FOG) #define GSPLAT_FOG #endif // prepare the output color for the given gamma-space color vec3 prepareOutputFromGamma(vec3 gammaColor, float depth) { vec3 color = gammaColor; // decode to linear when we need linear-space processing #if TONEMAP != NONE || GAMMA == NONE || defined(GSPLAT_FOG) color = decodeGamma(color); #endif // apply fog in linear space #ifdef GSPLAT_FOG color = addFog(color, depth); #endif // apply tonemapping #if TONEMAP != NONE color = toneMap(color); #endif // encode to gamma when needed #if TONEMAP != NONE || (GAMMA != NONE && defined(GSPLAT_FOG)) color = gammaCorrectOutput(color); #endif return color; } ` ); export { gsplatOutput_default as default };