Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally render circles as point lists to replicate their 8-bit rendering on GPUs #63

Open
nmlgc opened this issue Aug 22, 2024 · 0 comments
Labels
Enhancement New feature or request Graphics Portability Porting the game away from 32-bit Windows ~≤0.33 pushes Projected number of pushes needed. Might turn out to get more expensive!

Comments

@nmlgc
Copy link
Owner

nmlgc commented Aug 22, 2024

In 8-bit mode, Shuusou Gyoku draws circles by writing pixels along the accurate outline into the framebuffer:
Screenshot of Shuusou Gyoku's circle drawing in 8-bit mode as shown during the Marisa boss fight. Nice and smooth.

In the GPU-accelerated modes, circles are instead approximated by straight lines along a 32-sided polygon. This is easier to render on GPUs, but noticeably jaggier, and might stick out at the larger resolutions this game will be scaled to.
Screenshot of Shuusou Gyoku's circle drawing in 16-bit mode as shown during the Marisa boss fight. Noticeably jaggy.

I chose to keep the 32-sided polygon for the SDL_Renderer port (#4) mainly for preservation reasons and consistency with the Direct3D backend. Since the 8-bit implementation confirms the intent ("it should just be a circle"), we could replicate the 8-bit behavior on a GPU by sending a list of all the exact points that the 8-bit version would write. But there is no reason why choosing one method over the other should be a backend question – in SDL, we'd use SDL_RenderDrawPoints(), and even old Direct3D has the D3DPT_POINTLIST primitive.
Instead, perfect circles would be a frontend option, selectable in the Graphics menu.

@nmlgc nmlgc added Enhancement New feature or request Graphics ~≤0.33 pushes Projected number of pushes needed. Might turn out to get more expensive! labels Aug 22, 2024
@nmlgc nmlgc changed the title Optionally render circles as point lists to match the 8-bit mode Optionally render circles as point lists to replicate their 8-bit rendering on GPUs Aug 22, 2024
@nmlgc nmlgc added the Portability Porting the game away from 32-bit Windows label Aug 29, 2024
nmlgc added a commit that referenced this issue Oct 22, 2024
If we get to implement #63, these won't stay DirectDraw-exclusive for
long.

Part of P0290, funded by Ember2528.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Graphics Portability Porting the game away from 32-bit Windows ~≤0.33 pushes Projected number of pushes needed. Might turn out to get more expensive!
Projects
None yet
Development

No branches or pull requests

1 participant