fluidRenderingParticleDepth.vertex.js 909 B

123456789101112131415161718
  1. // Do not edit.
  2. import { ShaderStore } from "../Engines/shaderStore.js";
  3. const name = "fluidRenderingParticleDepthVertexShader";
  4. const shader = `attribute vec3 position;attribute vec2 offset;uniform mat4 view;uniform mat4 projection;uniform vec2 size;varying vec2 uv;varying vec3 viewPos;varying float sphereRadius;
  5. #ifdef FLUIDRENDERING_VELOCITY
  6. attribute vec3 velocity;varying float velocityNorm;
  7. #endif
  8. void main(void) {vec3 cornerPos;cornerPos.xy=vec2(offset.x-0.5,offset.y-0.5)*size;cornerPos.z=0.0;viewPos=(view*vec4(position,1.0)).xyz;gl_Position=projection*vec4(viewPos+cornerPos,1.0);uv=offset;sphereRadius=size.x/2.0;
  9. #ifdef FLUIDRENDERING_VELOCITY
  10. velocityNorm=length(velocity);
  11. #endif
  12. }
  13. `;
  14. // Sideeffect
  15. ShaderStore.ShadersStore[name] = shader;
  16. /** @internal */
  17. export const fluidRenderingParticleDepthVertexShader = { name, shader };
  18. //# sourceMappingURL=fluidRenderingParticleDepth.vertex.js.map