The Wayback Machine - https://web.archive.org/web/20211126105005/https://github.com/google/filament/issues/4492
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

JavaScript Request: Expose Texture methods getWidth(), getHeight(), getDepth(), getLevels(), etc. #4492

Open
BStringhamVRSK opened this issue Aug 12, 2021 · 3 comments

Comments

@BStringhamVRSK
Copy link
Contributor

@BStringhamVRSK BStringhamVRSK commented Aug 12, 2021

Problem:
After using Engine.createTextureFromKtx/jpeg/Png, I need to query the texture width and height so I can generate proper UV coordinates for font display.

Proposed solution
Expose the Texture.getWidth(), getHeight(), etc. methods to get texture information. I currently only need width and height, but I can see usage cases for many of the other "getters" available in the C++ interface.

OS and backend
WebGL

@prideout
Copy link
Member

@prideout prideout commented Aug 12, 2021

This is a good feature request, thanks!

@abhakta-47
Copy link

@abhakta-47 abhakta-47 commented Sep 16, 2021

Hi, I would like to work on this.
as suggested I would update filament/Texture.h and also class Texture in filament/web/filament-js/filament.d.ts.
Am I missing anything?

@BStringhamVRSK
Copy link
Contributor Author

@BStringhamVRSK BStringhamVRSK commented Sep 16, 2021

Thanks! Sounds right.
Not sure, but you may also need to modify web/filament-js/jsbindings.cpp

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