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

Depth buffer and SimpleRenderTarget #1126

Open
sellendk opened this issue Oct 4, 2022 · 0 comments
Open

Depth buffer and SimpleRenderTarget #1126

sellendk opened this issue Oct 4, 2022 · 0 comments
Assignees
Labels
bug fix These changes fix one or more bugs. bug

Comments

@sellendk
Copy link
Collaborator

sellendk commented Oct 4, 2022

Describe the bug
In all of the glyph shaders in the GlyphRenderer, there is a problem regarding the depth buffer. Currently, the depth gets written to a color attachment:

depth_out = ((depth / depth_w) + 1.0) * 0.5;

But, this has no impact on the depth buffer that gets returned by the SimpleRenderTarget, since the SimpleRenderTarget returns the actual DB:

ct->setData(m_GBuffer->getDepthStencil(), m_version);

In case of the box glyph, this lucks out, but for all the other glyphs and all other possible renderers that are connected, the DB is probably wrong.

Expected behavior
If the depth gets calculated 'by hand', it needs to be written to the depth buffer:

float final_depth = ((depth / depth_w) + 1.0) * 0.5;
gl_FragDepth = final_depth; // depth buffer
depth_out = final_depth;    // color attachment. can be thrown out, if not used otherwise
@sellendk sellendk added the bug label Oct 4, 2022
@sellendk sellendk added the bug fix These changes fix one or more bugs. label Oct 4, 2022
@sellendk sellendk mentioned this issue Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix These changes fix one or more bugs. bug
Projects
None yet
Development

No branches or pull requests

2 participants