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

Implement large texture for all common small texture #181

Open
wow2006 opened this issue Oct 20, 2018 · 1 comment
Open

Implement large texture for all common small texture #181

wow2006 opened this issue Oct 20, 2018 · 1 comment

Comments

@wow2006
Copy link
Contributor

wow2006 commented Oct 20, 2018

In OpenGL world bind and unbind texture takes some time. I like to improve the performance of the game by export the scene to binary format and attach all models texture to one big texture 4k or 8k texture. Use UV of that 4k texture to fetch location at shader using the uniform buffer. @hhirsch @ElementW @JulianThijssen @Geertiebear I am not sure how to add this.

@ElementW
Copy link
Contributor

ElementW commented Oct 20, 2018

This is similar to when we would bake lightmaps if we had them. It's a nice idea, you just have to consider color bleeding due to texture sampling interpolation, but spacing the textures out work around that problem.
Not sure about the binary export format.
While serializing the scenes is a great idea, I don't think exporting stitched textures with it (if that what's you mean) is interesting since it would take up a lot of disk space just for duplicate data that would need re-encoding and doesn't provide faster decoding than loading the textures individually.
I'm OK however with exporting data about static geometry and models including having a texture stitch hint so the game doesn't have to compute the texture packing at run-time (especially since IIRC efficient space packing with arbitrary-sized elements is considered NP-hard), and just has to decode & move pixels around before sending the textures to the GPU.
There's also ARB_bindless_texture and EXT_direct_state_access, we might want to leverage those instead if available.

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

No branches or pull requests

2 participants