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

CustomLayerInterface to expose projection matrix parameters #3080

Closed
Pessimistress opened this issue Sep 13, 2023 · 1 comment · Fixed by #3136
Closed

CustomLayerInterface to expose projection matrix parameters #3080

Pessimistress opened this issue Sep 13, 2023 · 1 comment · Fixed by #3136
Labels
need more info Further information is requested PR is more than welcomed Extra attention is needed

Comments

@Pessimistress
Copy link
Contributor

User Story

For our custom layer implementation to properly match the base map in an interleaved 3D context, we need access to the projection matrix parameters.

Rationale

CustomLayerInterface.render currently exposes a single matrix argument that is the combined view projection matrix. In our implementation, coordinate transforms are done on the GPU for better performance, but shader uniforms only support up to 32-bit floats. To compensate for lost precision, we calculate the view matrix and projection matrix separately.

Historically we poke into the source code of the Transform class to try match our calculation with the base map. This has become increasingly problematic as the base map could change its near/far plane calculation between versions. It would be much easier if CustomLayerInterface.render could expose the view and projection matrices separately, or even the individual projection matrix parameters (fov, near, far).

Impact

The matrices/parameters are already calculated internally. Making them visible to a custom layer has minimal overhead but will help create much more robust third-party renderers.

@HarelM
Copy link
Collaborator

HarelM commented Sep 13, 2023

For far and near plane there's another issue to take into consideration and that's when looking around points below sea level. See #1655.

In general, I don't mind adding more optional parameters to the custom layer render method.
Having said that, there is also the following issue which talks about adding more parameters, not sure how to address all these requirements though: #1305

I would suggest to have a more concrete proposal.
cc: @Kanahiro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested PR is more than welcomed Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants