gpuRenderParticles.fragment.fx 932 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #version 300 es
  2. uniform sampler2D textureSampler;
  3. in vec2 vUV;
  4. in vec4 vColor;
  5. out vec4 outFragColor;
  6. #include<clipPlaneFragmentDeclaration2>
  7. #include<imageProcessingDeclaration>
  8. #include<helperFunctions>
  9. #include<imageProcessingFunctions>
  10. void main() {
  11. #include<clipPlaneFragment>
  12. vec4 textureColor = texture(textureSampler, vUV);
  13. outFragColor = textureColor * vColor;
  14. #ifdef BLENDMULTIPLYMODE
  15. float alpha = vColor.a * textureColor.a;
  16. outFragColor.rgb = outFragColor.rgb * alpha + vec3(1.0) * (1.0 - alpha);
  17. #endif
  18. // Apply image processing if relevant. As this applies in linear space,
  19. // We first move from gamma to linear.
  20. #ifdef IMAGEPROCESSINGPOSTPROCESS
  21. outFragColor.rgb = toLinearSpace(outFragColor.rgb);
  22. #else
  23. #ifdef IMAGEPROCESSING
  24. outFragColor.rgb = toLinearSpace(outFragColor.rgb);
  25. outFragColor = applyImageProcessing(outFragColor);
  26. #endif
  27. #endif
  28. }