开发者

Need support in LWJGL - Setting the type of texture

开发者 https://www.devze.com 2023-03-29 12:17 出处:网络
Can somebody help me setting different texture types? (GL_LINEAR, GL_NEAREST, etc) I\'m usingthe slick-util lybrary with netbeans. The problem is that i can\'t set to different types.

Can somebody help me setting different texture types? (GL_LINEAR, GL_NEAREST, etc) I'm using the slick-util lybrary with netbeans. The problem is that i can't set to different types. I documented about and found out that if i want to use MIP_MAPs then i need to create them. Problem is that i cant create them. So the question is ! How can i create with or without slick-util textures and how can i set them to different texture types. I know how it's made i开发者_开发问答n c++ but haven't got implemented in java ?

Thank you for you're time, Zsurzsa,


Mipmapping means that for every texture you need to specify a so called image pyramid. In laymans terms you start with layer 0 and for each following layer you half-down round-up the resolution until you hit a image size of 1×1.

OpenGL (and any other mipmapping renderer) will only apply a mipmapped texture if it's complete. You can specify minimum and maximum levels to be used, but all the levels inbetween must be supplied.

I don't know slick utils, but if it offers you to scale images you could use something like this (pseudocode)

level = 0
while ceil(image.width) > 1 or ceil(image.height) > 1:
   glTexImage(GL_TEXTURE_2D, level, image.width, image.height, ...)
   image.scale(0.5, 0.5)
   level = level + 1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号