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

Invert vScale of compressed textures when invertY is set and invertY … #5545

Merged
merged 3 commits into from Nov 27, 2018

Conversation

Copy link
Member

left a comment

I am wondering about the undefined in _prepareWebGLTexture ?

src/Engine/babylon.engine.ts Outdated Show resolved Hide resolved
TrevorDev added 2 commits Nov 22, 2018
…of ktx textures as they are inverted in the file
@TrevorDev TrevorDev force-pushed the TrevorDev:useInvertVScaleForKtx branch from c852503 to dc0713b Nov 26, 2018
@sebavan

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

Could you also check rebuild on internalTexture ?

I guess you inverse vscale might be missing there ?

@TrevorDev

This comment has been minimized.

Copy link
Member Author

commented Nov 26, 2018

@sebavan good call, it looks like this is already handled by createTexture so rebuild worked fine but when testing this using context loss I found another issue which I fixed.

@sebavan

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

Other quick question why not just inverting invertY instead of relying on texture._invertVScale ???

@TrevorDev

This comment has been minimized.

Copy link
Member Author

commented Nov 26, 2018

because invertY triggers inversion with UNPACK_FLIP_Y_WEBGL which is not supported by compressed textures so vScale inversion was needed. I originally did this for all compressed textures (like dds) but it broke DDS as the UNPACK_FLIP_Y_WEBGL doesn't work at the start but then works when UploadDDSLevels calls _uploadDataToTextureDirectly.

@sebavan

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

Agree but could we not swap invertY in the KTX Loader instead of adding a separate flag (just wondering did not check the code enough) ?

@TrevorDev

This comment has been minimized.

Copy link
Member Author

commented Nov 26, 2018

vScale is in the texture class but ktxTextureLoader only has access to the internalTexture so I added the flag to internal texture which then is used in texture creation.

@sebavan

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

Ok got it :-)

@sebavan sebavan merged commit eacc0d7 into BabylonJS:master Nov 27, 2018
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.