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

Custom Shaders: Implicit Tile Coordinates as a built-in uniform? #9736

Open
ptrgags opened this issue Aug 19, 2021 · 1 comment
Open

Custom Shaders: Implicit Tile Coordinates as a built-in uniform? #9736

ptrgags opened this issue Aug 19, 2021 · 1 comment

Comments

@ptrgags
Copy link
Contributor

ptrgags commented Aug 19, 2021

While working on #9725, I observed that it would be nice if the (level, x, y, [z]) coordinates from the 3DTILES_implicit_tiling implementation were available in custom shaders.

This should be easy to implement, if the ModelExperimental has a pointer to tile.implicitTileCoordinates, I think this would be implemented by creating an automatic uniform ivec4 with value ivec4(level, x, y, z). Actually... ivec4(x, y, z, level) would be better, then coordinates.x == x, and so on.

Based on the existing limitations with index sizes, the x, y, and z components are under 16 bits, so they could fit in either an ivec4 or vec4

@lilleyse @sanjeetsuhag any opinion on which data type to use for this?

@sanjeetsuhag
Copy link
Contributor

16 bits is not a lot - could we pass these in as float and assemble a struct TileCoords in the shader that the user can access?

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

No branches or pull requests

2 participants