vs.chunk 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <surfaces/default-functions/common-vs>
  2. #include <surfaces/module-functions/common-vs>
  3. #include <common/math/number>
  4. #include <common/lighting/functions>
  5. out highp float v_dist;
  6. void main()
  7. {
  8. SurfacesStandardVertexIntermediate In;
  9. // Local Space
  10. CCSurfacesVertexInput(In);
  11. CCSurfacesVertexAnimation(In);
  12. In.position.xyz = SurfacesVertexModifyLocalPos(In);
  13. SurfacesVertexModifyLocalSharedData(In);
  14. // World Space
  15. CCSurfacesVertexWorldTransform(In);
  16. In.worldPos = SurfacesVertexModifyWorldPos(In);
  17. vec4 shadowPos = CalculatePlanarShadowPos(In.worldPos, cc_cameraPos.xyz, cc_mainLitDir.xyz, cc_planarNDInfo);
  18. In.worldPos = shadowPos.xyz;
  19. // Clip Space
  20. In.clipPos = CalculatePlanarShadowClipPos(shadowPos, cc_cameraPos.xyz, cc_matView, cc_matProj, cc_nearFar, cc_shadowWHPBInfo.w);
  21. In.clipPos = SurfacesVertexModifyClipPos(In);
  22. // Other Surfaces Function
  23. SurfacesVertexModifyUV(In);
  24. SurfacesVertexModifySharedData(In);
  25. // Other Data
  26. CCSurfacesVertexTransformUV(In);
  27. CCSurfacesVertexOutput(In);
  28. // Depth
  29. v_dist = shadowPos.w;
  30. }