Skip to content

Commit

Permalink
Removes unsupported points smoothing.
Browse files Browse the repository at this point in the history
# Conflicts:
#	samples/framework/renderer.h
  • Loading branch information
guillaumeblanc committed Mar 17, 2024
1 parent 63b21d0 commit 119c988
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
16 changes: 3 additions & 13 deletions samples/framework/internal/renderer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ bool RendererImpl::DrawPoints(const ozz::span<const float>& _positions,
const ozz::span<const float>& _sizes,
const ozz::span<const Color>& _colors,
const ozz::math::Float4x4& _transform,
bool _round, bool _screen_space) {
bool _screen_space) {
// Early out if no instance to render.
if (_positions.size() == 0) {
return true;
Expand Down Expand Up @@ -672,16 +672,6 @@ bool RendererImpl::DrawPoints(const ozz::span<const float>& _positions,
_colors.data()));
GL(BufferSubData(GL_ARRAY_BUFFER, sizes_offset, sizes_size, _sizes.data()));

// Square or round sprites. Beware msaa makes sprites round if GL_POINT_SPRITE
// isn't enabled
if (_round) {
GL(Enable(GL_POINT_SMOOTH));
GL(Disable(GL_POINT_SPRITE));
} else {
GL(Disable(GL_POINT_SMOOTH));
GL(Enable(GL_POINT_SPRITE));
}

// Size is managed in vertex shader side.
GL(Enable(GL_PROGRAM_POINT_SIZE));

Expand Down Expand Up @@ -1369,7 +1359,7 @@ bool RendererImpl::DrawMesh(const Mesh& _mesh,
}
const float size = 2.f;
DrawPoints({part.positions.data(), part.positions.size()}, {&size, 1},
{&color, 1}, _transform, true, true);
{&color, 1}, _transform, true);
}
}

Expand Down Expand Up @@ -1724,7 +1714,7 @@ bool RendererImpl::DrawSkinnedMesh(
ozz::PointerStride(vbo_map, positions_offset)),
static_cast<size_t>(vertex_count * 3)};
const float size = 2.f;
DrawPoints(vertices, {&size, 1}, colors, _transform, true, true);
DrawPoints(vertices, {&size, 1}, colors, _transform, true);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion samples/framework/internal/renderer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class RendererImpl : public Renderer {
virtual bool DrawPoints(const ozz::span<const float>& _positions,
const ozz::span<const float>& _sizes,
const ozz::span<const Color>& _colors,
const ozz::math::Float4x4& _transform, bool _round,
const ozz::math::Float4x4& _transform,
bool _screen_space);

virtual bool DrawBoxIm(const ozz::math::Box& _box,
Expand Down
11 changes: 5 additions & 6 deletions samples/framework/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ class Renderer {
// _sizes and _colors must be either of ize 1 or equal to _positions' size.
// If _screen_space is true, then points size is fixed in screen-space,
// otherwise it changes with screen depth.
virtual bool DrawPoints(
const ozz::span<const float>& _positions,
const ozz::span<const float>& _sizes,
const ozz::span<const Color>& _colors,
const ozz::math::Float4x4& _transform, bool _round = true,
bool _screen_space = false) = 0;
virtual bool DrawPoints(const ozz::span<const float>& _positions,
const ozz::span<const float>& _sizes,
const ozz::span<const Color>& _colors,
const ozz::math::Float4x4& _transform,
bool _screen_space = false) = 0;

// Renders a box at a specified location.
// The 2 slots of _colors array respectively defines color of the filled
Expand Down

0 comments on commit 119c988

Please sign in to comment.