UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

6 lines (4 loc) 910 B
// fragment shader internally used to apply morph targets in textures into a final texture containing // blended morph targets var morphPS = '\n\n varying vec2 uv0;\n\n // LOOP - source morph target textures\n #include "morphDeclarationPS, MORPH_TEXTURE_COUNT"\n\n #if MORPH_TEXTURE_COUNT > 0\n uniform highp float morphFactor[{MORPH_TEXTURE_COUNT}];\n #endif\n\n #ifdef MORPH_INT\n uniform vec3 aabbSize;\n uniform vec3 aabbMin;\n #endif\n\n void main (void) {\n highp vec4 color = vec4(0, 0, 0, 1);\n\n // LOOP - source morph target textures\n #include "morphEvaluationPS, MORPH_TEXTURE_COUNT"\n\n #ifdef MORPH_INT\n color.xyz = (color.xyz - aabbMin) / aabbSize * 65535.0;\n gl_FragColor = uvec4(color);\n #else\n gl_FragColor = color;\n #endif\n }\n'; export { morphPS as default };