gpuRenderParticles.fragment.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Do not edit.
  2. import { ShaderStore } from "../Engines/shaderStore.js";
  3. import "./ShadersInclude/clipPlaneFragmentDeclaration2.js";
  4. import "./ShadersInclude/imageProcessingDeclaration.js";
  5. import "./ShadersInclude/logDepthDeclaration.js";
  6. import "./ShadersInclude/helperFunctions.js";
  7. import "./ShadersInclude/imageProcessingFunctions.js";
  8. import "./ShadersInclude/fogFragmentDeclaration.js";
  9. import "./ShadersInclude/clipPlaneFragment.js";
  10. import "./ShadersInclude/logDepthFragment.js";
  11. import "./ShadersInclude/fogFragment.js";
  12. const name = "gpuRenderParticlesPixelShader";
  13. const shader = `precision highp float;
  14. #ifdef LOGARITHMICDEPTH
  15. #extension GL_EXT_frag_depth : enable
  16. #endif
  17. uniform sampler2D diffuseSampler;varying vec2 vUV;varying vec4 vColor;
  18. #include<clipPlaneFragmentDeclaration2>
  19. #include<imageProcessingDeclaration>
  20. #include<logDepthDeclaration>
  21. #include<helperFunctions>
  22. #include<imageProcessingFunctions>
  23. #include<fogFragmentDeclaration>
  24. void main() {
  25. #include<clipPlaneFragment>
  26. vec4 textureColor=texture2D(diffuseSampler,vUV);gl_FragColor=textureColor*vColor;
  27. #ifdef BLENDMULTIPLYMODE
  28. float alpha=vColor.a*textureColor.a;gl_FragColor.rgb=gl_FragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);
  29. #endif
  30. #include<logDepthFragment>
  31. #include<fogFragment>(color,gl_FragColor)
  32. #ifdef IMAGEPROCESSINGPOSTPROCESS
  33. gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);
  34. #else
  35. #ifdef IMAGEPROCESSING
  36. gl_FragColor.rgb=toLinearSpace(gl_FragColor.rgb);gl_FragColor=applyImageProcessing(gl_FragColor);
  37. #endif
  38. #endif
  39. }
  40. `;
  41. // Sideeffect
  42. ShaderStore.ShadersStore[name] = shader;
  43. /** @internal */
  44. export const gpuRenderParticlesPixelShader = { name, shader };
  45. //# sourceMappingURL=gpuRenderParticles.fragment.js.map