playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
23 lines (21 loc) • 648 B
JavaScript
var particleOutput_default = (
/* glsl */
`
// Writes particle state to the state texture. The fragment output type (vec4 / uvec4) is set via
// fragmentOutputTypes to match the texture format; when not float-renderable the floats are
// reinterpreted to their uint bit patterns (RGBA32U), which is lossless.
void writeOutput() {
vec4 row = gl_FragCoord.y < 1.0 ?
vec4(outPos, (outAngle + 1000.0) * visMode) :
vec4(outVel, outLife);
gl_FragColor = row;
gl_FragColor = floatBitsToUint(row);
}
`
);
export {
particleOutput_default as default
};