UNPKG

playcanvas

Version:

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

3 lines (2 loc) 884 B
declare const _default: "\n// Reads particle state from the state texture. When float textures are renderable the texture is\n// RGBA32F and the samples are used directly; otherwise it is RGBA32U storing the exact float bits,\n// which are reinterpreted here. particleTexIN is declared as sampler2D / usampler2D to match.\nvoid readInput(float uv) {\n #ifdef CAPS_TEXTURE_FLOAT_RENDERABLE\n vec4 tex = texture2D(particleTexIN, vec2(uv, 0.25));\n vec4 tex2 = texture2D(particleTexIN, vec2(uv, 0.75));\n #else\n vec4 tex = uintBitsToFloat(texture2D(particleTexIN, vec2(uv, 0.25)));\n vec4 tex2 = uintBitsToFloat(texture2D(particleTexIN, vec2(uv, 0.75)));\n #endif\n\n inPos = tex.xyz;\n inVel = tex2.xyz;\n inAngle = (tex.w < 0.0 ? -tex.w : tex.w) - 1000.0;\n inShow = tex.w >= 0.0;\n inLife = tex2.w;\n}\n"; export default _default;