Skip to content

Commit

Permalink
gpu: sw: Somewhat take care of edge-marking with anti-aliasing enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jan 21, 2024
1 parent fe793af commit 0d386fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ namespace dual::nds::gpu {
edge |= y != 191 ? EvaluateCondition(center_depth, center_poly_id, m_depth_buffer[0][y_d][x], m_attribute_buffer[y_d][x].poly_id[0]) : border_edge;

if(edge) {
m_frame_buffer[0][y][x] = m_edge_color[center_poly_id >> 3];
const Color4 edge_color = m_edge_color[center_poly_id >> 3];

m_frame_buffer[0][y][x].R() = edge_color.R();
m_frame_buffer[0][y][x].G() = edge_color.G();
m_frame_buffer[0][y][x].B() = edge_color.B();

// @todo: It is unclear how edge-marking and anti-aliasing work together.
if(m_io.disp3dcnt.enable_anti_aliasing) {
m_coverage_buffer[y][x] = 32u;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ namespace dual::nds::gpu {
}
RenderPolygons(viewport, polygons);

if(enabled_aa) {
RenderAntiAliasing();
}

if(m_io.disp3dcnt.enable_edge_marking) {
RenderEdgeMarking();
}

if(enabled_aa) {
RenderAntiAliasing();
}
}

void SoftwareRenderer::CaptureColor(int scanline, std::span<u16, 256> dst_buffer, int dst_width, bool display_capture) {
Expand Down

0 comments on commit 0d386fc

Please sign in to comment.