Skip to content

Commit

Permalink
[rendering] increased line thickness so that it's not just one (hard …
Browse files Browse the repository at this point in the history
…to see) pixel width
  • Loading branch information
PanosK92 committed Jan 8, 2025
1 parent 2851349 commit 5d9d60f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions runtime/Physics/PhysicsDebugDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ namespace Spartan

void PhysicsDebugDraw::drawLine(const btVector3& from, const btVector3& to, const btVector3& color_from, const btVector3& color_to)
{
if (Engine::IsFlagSet(EngineMode::Playing))
return;

// a bit dangerous to reinterpret these parameters but this is a performance critical path
// a better way would be to use a custom physics debug draw since the one from Bullet is extremely slow
Renderer::DrawLine(
Expand Down
8 changes: 4 additions & 4 deletions runtime/Rendering/Renderer_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ namespace Spartan
float bias = Light::GetBias();
float bias_clamp = 0.0f;
float bias_slope_scaled = Light::GetBiasSlopeScaled();
float line_width = 2.0f;
float line_width = 3.0f;

// Solid_Transparent: The transparents are rendered at output resolution, without taa/jitter, therefore we need to bias them to avoid z-fighting from the opaque depth

#define rasterizer_state(x) rasterizer_states[static_cast<uint8_t>(x)]
// fill mode, depth clip enabled, bias, bias clamp, slope scaled bias, line width
rasterizer_state(Renderer_RasterizerState::Solid) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, true, 0.0f, 0.0f, 0.0f, 0.0f);
rasterizer_state(Renderer_RasterizerState::Solid) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, true, 0.0f, 0.0f, 0.0f, line_width);
rasterizer_state(Renderer_RasterizerState::Wireframe) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Wireframe, true, 0.0f, 0.0f, 0.0f, line_width);
rasterizer_state(Renderer_RasterizerState::Light_point_spot) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, true, bias, bias_clamp, bias_slope_scaled, 0.0f);
rasterizer_state(Renderer_RasterizerState::Light_directional) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, false, bias * 0.1f, bias_clamp, bias_slope_scaled, 0.0f);
rasterizer_state(Renderer_RasterizerState::Light_point_spot) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, true, bias, bias_clamp, bias_slope_scaled, line_width);
rasterizer_state(Renderer_RasterizerState::Light_directional) = make_shared<RHI_RasterizerState>(RHI_PolygonMode::Solid, false, bias * 0.1f, bias_clamp, bias_slope_scaled, line_width);
}

void Renderer::CreateBlendStates()
Expand Down

0 comments on commit 5d9d60f

Please sign in to comment.