atteneder / KtxUnity

Load KTX and Basis Universal textures at runtime
Apache License 2.0
215 stars 42 forks source link

Feature/teleport through alphatested #90

Closed kstpr closed 9 months ago

kstpr commented 9 months ago

This was some fail on our side, should have been a modification of our fork only, not the original repo. Sorry for the hassle.

atteneder commented 9 months ago

No worries.

I'm curious what additions or changes you're doing, so in case you want to exchange ideas, be my guest.

atteneder commented 9 months ago

Regarding this PR specifically, maybe the Apply parameters should be exposed so you wouldn't need to fork the whole package.

kstpr commented 9 months ago

We needed to have the textures as CPU-readable for some time during the scene building in order to create some boolean masks for the alpha threshold. We have alpha-tested geometry that we need to teleport through in VR and the collisions with the fully transparent parts of that geometry prevent teleportation. So we create some low-res boolean masks from appropriate mip levels of the textures and only then we call Apply in our app code to delete the CPU copies. Then for teleportation we can sample the boolean masks and make some changes to the logic. It's somewhat of a niche case.