How do you use not-power-of-2 textures in LWJGL?

折月煮酒 提交于 2020-01-25 00:04:50

问题


I'm using Slick Util's Texture class to load textures for lwjgl, but apparently that forces your texture to a power of 2.

How would you use a texture that's not a power of 2? (I really don't want to add transparent pixels to the edge of the image to make it a power of 2.)

I've seen somewhere that it's possible, but I can't find any way of doing it.


回答1:


The reason the stick-utils package forces you to use power-of-two textures is this is what graphics cards like to load. Where possible, you should pack all your images in to a large power-of-two texture and draw from that instead of loading all the textures separately.

So whilst it's not impossible, there is a reason it is made hard.



来源:https://stackoverflow.com/questions/9543093/how-do-you-use-not-power-of-2-textures-in-lwjgl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!