Rework the way lens flares are rendered. #3
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
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:
Other issues specifically under OpenGL:
glBindFramebuffer()
(a continuous spam of assertions is happening under Debug builds).glReadPixels()
with a depth component complains about the lack of a depth buffer, despite one being set up via a render buffer that is bound to the framebuffer. The most probable error:GL_INVALID_OPERATION is generated if format is GL_DEPTH_COMPONENT and there is no depth buffer.
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.
The text was updated successfully, but these errors were encountered: