-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Allow modifying farZ camera plane variable #5091
Comments
I think i have the same concerns as I had for the following PR: I'm not sure this world be the right API to expose. |
@HarelM Yes, by setting the default value to a less conservative one. (cc @kubapelc) The depth buffer is a resource shared by everything rendering to the same frame in WebGL. In order to do any sort of 3D compositing, there needs to be a sufficient range of values usable to make everything fit. The way the current Other solutions to this issue that we've thought about/evaluated all seem to have significant complexity and downsides in comparison:
There are no significant downsides to setting the value to something like 4x the current one, other than 2 bits of precision in the depth testing lost in the range used by the sphere; however considering it's mostly a single mesh that gets back-culled anyway, I don't think it would be problematic for any other user. If there's concern about that, rather than exposing |
As far as I read the code right now, and according to what you described there might be an "easy" solution, let me know if that can work. |
My thoughts: Fixing this by multiplying farZ by some hardcoded constant is not great, since other users might have need for even larger farZ values in the future - it should be configurable. Also, I think making a public property on the transform interface ( |
User Story
I want to add a simple skybox to globe view, instead of black screen behind it I want to add some stars etc. However,
globe_transform.ts
does not let me render things behind the globe:
I tried to modify projection matrix to change farZ value, however with no luck, changing 10th and 14th elements of the projection matrix were messing up rendering, also I'm not sure if having different projection matrices in one "scene" makes sense, I'm concerned about some unpredictable issues by such approach.
after modifying farZ value, by simply multiplying it by 5.0, scene is looking as expected:
So in the end it seems like I would like to keep same projection matrix as maplibre uses, but I want to be able to modify and extend far plane of the camera, to render skybox/rockets/moon/satellites etc.
The text was updated successfully, but these errors were encountered: