简体   繁体   English

JOGL分别加载纹理并一次使用多个纹理

[英]JOGL Loading textures individually and using multiple at once

Alright, I couldn't find a good name for this, so I will explain in a bit further detail. 好吧,我找不到这个好的名字,所以我将进一步解释。

I am making a game using LWJGL and I have gotten some basic rendering done, but now I want to do something a bit more advanced. 我正在使用LWJGL制作游戏,并且已经完成了一些基本渲染,但是现在我想做一些更高级的事情。

Here is the situation: 情况如下:

I have a mesh (positions, normals, texture coords, indices) I generate which can currently support 1 texture, this would be great if I had a single image containing all of the textures, but sadly that isn't the case. 我有一个生成的网格物体(位置,法线,纹理坐标,索引),当前可以支持1个纹理,如果我有一个包含所有纹理的图像,这会很棒,但遗憾的是事实并非如此。 I have a individual image for each texture which needs to be loaded individually. 对于每个纹理,我都有一个单独的图像,需要单独加载。

Now, I see a way how I could do this, but it doesn't seem practical or like a good usage of memory. 现在,我看到了一种方法,但它似乎不切实际,也不喜欢很好地使用内存。 -Load all the textures into one image and save where each one is in that image for usage with the texture coords. -将所有纹理加载到一个图像中,并保存每个图像在该图像中的位置,以与纹理坐标一起使用。

The textures should NOT blend together, hard coding anything is not an option as I wish to allow modding to be easy to implement, and anywhere from 1 (best case scenario) to 65,536+ textures (worst case scenario) are able to be used in the same "mesh". 纹理应该融合在一起,硬编码任何东西是不是一种选择,因为我希望允许改装很容易实现,而且从1(最好的情况下)的任何地方65,536+纹理(最坏的情况)都能够在使用相同的“网格”。

I am simply going to use a Texture Atlas as doing anything else seems impractical. 我只是要使用“纹理图集”,因为做其他任何事情似乎都不切实际。 Thanks @httpdigest for the suggestion. 感谢@httpdigest的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM