HairCalculateRenderPositions.hlsl 625 B

12345678910111213141516171819202122
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2026 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #include "HairCalculateRenderPositionsBindings.h"
  5. #include "HairCommon.h"
  6. #include "HairCalculateRenderPositions.h"
  7. JPH_SHADER_FUNCTION_BEGIN(void, main, cHairPerRenderVertexBatch, 1, 1)
  8. JPH_SHADER_PARAM_THREAD_ID(tid)
  9. JPH_SHADER_FUNCTION_END
  10. {
  11. // Check if this is a valid vertex
  12. uint vtx = tid.x;
  13. if (vtx >= cNumRenderVertices)
  14. return;
  15. float3 out_position = SkinRenderVertex(vtx);
  16. // Copy the vertex position to the output buffer
  17. gRenderPositions[vtx] = out_position;
  18. }