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

Rework the way lens flares are rendered. #3

Open
DreamyCecil opened this issue Dec 7, 2024 · 0 comments
Open

Rework the way lens flares are rendered. #3

DreamyCecil opened this issue Dec 7, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed projects:engine Related to Engine project rework Something that can be made better topic:graphics Related to interactions with graphics APIs topic:rendering Related to rendering logic using abstracted graphics API methods

Comments

@DreamyCecil
Copy link
Owner

DreamyCecil commented Dec 7, 2024

Description

Right now the code for lens flares seems to be very unstable. And while it might work (mostly) fine under the current configurations on many PCs, it seems to significantly slow down the engine internally or even absolutely break down under specific in-game graphics settings.

Most issues seem to be happening under OpenGL graphics API.

A few issues to note about lens flares:

  • Tanked performance on lower end PCs, leading to less frames per second.
  • Difficulty to implement under other graphics APIs, like Vulkan.

Other issues specifically under OpenGL:

  • Rendering through everything regardless of obstacles in the way depending on rendering configurations.
    • Can be seen most prominently in Classics Patch when opening the menu while staring into a direction of lens flares obstructed by something (a torch behind a wall or the sun behind the roof).
  • Inability to render them when the world is rendered on top of an active framebuffer using glBindFramebuffer() (a continuous spam of assertions is happening under Debug builds).

Proposed solution

Find a way to determine whether a lens flare is obstructed by something without relying onto graphics API calls directly in order to display it on screen.

Perhaps try rewriting OpenGL logic from simply reading the depth buffer to whatever Direct3D is currently doing, which seems to work mostly fine with its much more complicated algorithm.

@DreamyCecil DreamyCecil added bug Something isn't working help wanted Extra attention is needed projects:engine Related to Engine project topic:graphics Related to interactions with graphics APIs topic:rendering Related to rendering logic using abstracted graphics API methods labels Dec 7, 2024
@DreamyCecil DreamyCecil added the rework Something that can be made better label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed projects:engine Related to Engine project rework Something that can be made better topic:graphics Related to interactions with graphics APIs topic:rendering Related to rendering logic using abstracted graphics API methods
Projects
None yet
Development

No branches or pull requests

1 participant