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

Text not rendering when logarithmicDepthBuffer is enabled #4279

Closed
Kershawj opened this issue Oct 2, 2019 · 11 comments
Closed

Text not rendering when logarithmicDepthBuffer is enabled #4279

Kershawj opened this issue Oct 2, 2019 · 11 comments

Comments

@Kershawj
Copy link
Contributor

Kershawj commented Oct 2, 2019

Creating a scene with just a entity in but then using logarithmicDepthBuffer set to true in the renderer settings works fine so like:

<a-scene renderer="logarithmicDepthBuffer: true;"> <a-text value="Some text please" color="black" position="0 0 -5"></a-text> </a-scene>

However adding a plane behind the text whilst logarithmicDepthBuffer set to true causes text to not render over the plane.

<a-scene renderer="logarithmicDepthBuffer: true;"> <a-plane height="1" width="3" color="red" position="0 0 -5.2"></a-plane> <a-text value="Some text please" color="black" position="0 0 -5"></a-text> </a-scene>

Switching to logarithmicDepthBuffer: false; then works as expected.
I have a scene which really needs this set to true for lots of other entities to render correctly and to reduce z-fighting but also need some generated text in there so I'm kinda stuck.
I'm guessing the text shader isn't aware of how to handle this correctly?

  • A-Frame Version: 0.9.2
  • Platform / Device: Chrome/Macbook
@Kershawj
Copy link
Contributor Author

Kershawj commented Oct 2, 2019

Just to say after more testing, it works as expected when using v0.8.0
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
However this is not an option for me.

@arpu
Copy link
Contributor

arpu commented Oct 2, 2019

does it work with the master version?
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@ab9821761340fd6ee28171fc38f85a45c2ade514/dist/aframe-master.min.js"></script>

@Kershawj
Copy link
Contributor Author

Kershawj commented Oct 3, 2019

No, same result.
I've removed logs from here as they were something I was doing incorrectly, but comment that it didn't work still stands.

@arpu
Copy link
Contributor

arpu commented Oct 3, 2019

sorry i have no idea here best waiting for @dmarcos

@dzoech
Copy link

dzoech commented Sep 29, 2020

Any updates on this issue?
I'm experiencing the same issues with AR.js and A-Frame 1.0.4 that text is not rendered in front of other entities independent from their z-indices.

image

@arpu
Copy link
Contributor

arpu commented Sep 29, 2020

@dzoech meantime you can try/use https://github.com/lojjic/aframe-troika-text

@dzoech
Copy link

dzoech commented Sep 29, 2020

Thank you @arpu, works like a charm

@ttguy
Copy link

ttguy commented Apr 21, 2023

I also have exactly this issue with aframe 1.4.0

@Atlinx
Copy link

Atlinx commented Jun 21, 2023

This is still an issue in aframe 1.4.2

@mrxz
Copy link
Contributor

mrxz commented Jul 6, 2023

The problem lies in the fact that logarithmicDepthBuffer requires specific shader chunks in three.js. The text shaders in A-Frame don't include these and as a result will simply write to the depth buffer as if it was a normal z-buffer.

It should be relatively easy to update the shaders. At the same time the correct encoding and tonemapping chunks can be included as well.

@dmarcos
Copy link
Member

dmarcos commented Dec 11, 2023

Fixed by #5409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants