Skip to content

Commit

Permalink
Bug fix for point rendering
Browse files Browse the repository at this point in the history
A recent change in presort to normalize the depth from near/far, was not
applied to the PointRenderer, causing it to not sort particles properly.

Now it works!
  • Loading branch information
hyperlogic committed Apr 27, 2024
1 parent 7c54071 commit d985c9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pointrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ void PointRenderer::Render(const glm::mat4& cameraMat, const glm::mat4& projMat,
const size_t numPoints = posVec.size();
glm::mat4 modelViewMat = glm::inverse(cameraMat);

const uint32_t MAX_DEPTH = std::numeric_limits<uint32_t>::max();

{
ZoneScopedNC("pre-sort", tracy::Color::Red4);

preSortProg->Bind();
preSortProg->SetUniform("modelViewProj", projMat * modelViewMat);
preSortProg->SetUniform("nearFar", nearFar);
preSortProg->SetUniform("keyMax", MAX_DEPTH);

glm::mat4 modelViewProjMat = projMat * modelViewMat;

Expand Down

0 comments on commit d985c9f

Please sign in to comment.