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

Flares #40

Open
4 tasks
SomaZ opened this issue Apr 24, 2020 · 1 comment
Open
4 tasks

Flares #40

SomaZ opened this issue Apr 24, 2020 · 1 comment
Labels
rend2-sp singlepayer rend2 rend2 multiplayer rend2 vanilla parity

Comments

@SomaZ
Copy link
Owner

SomaZ commented Apr 24, 2020

  • Create visibility buffer image
  • Create visibility fbo
  • Create pipeline to render visibility to that fbo
  • Use the visibility buffer for rendering flares
@SomaZ SomaZ added rend2 multiplayer rend2 rend2-sp singlepayer rend2 vanilla parity labels Apr 24, 2020
@SomaZ
Copy link
Owner Author

SomaZ commented Feb 10, 2023

Current implementation uses glRead to compare the view depth to the view distance of the flare to decide if you should render the flare or not. glRead is a blocking command though, as it needs to sync the gpu and the cpu to get the current view depth.

I want to replace this with an additional flare visibility FBO with an attached 1D texture. The 1D textures width would be the number of flares of the current map.

This FBO will be updated every frame after the depth prepass. We can bind the depth buffer to a texture unit and test in a fragment shader if the flare would be visable or not. If the flare is not visable, write a value of 0.0, else add some_magic_value/frame_time. Could also extend the depth testing to multiple pixels to account for partial occlusion of the flares.

Finally, the flare could be rendered with the rendered flare visibility texture.

Atlasing all the flare images per map would also be nice, so we can render all flares with one draw command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rend2-sp singlepayer rend2 rend2 multiplayer rend2 vanilla parity
Projects
None yet
Development

No branches or pull requests

1 participant