Use glGenTextures to create a texture object Existing engines like Slick or jME have those. If by "how the java program stores the texture" you mean loading image data from a file, then you need a loader for that image format. You can use more textures by binding them to different texture units with glActiveTex. You modify textures by uploading different data via glTexImage. If you don't know how to do that I suggest reading general OpenGL tutorials (Google has dozens of them, Nehe's are quite popular) or read a more thorough book like the OpenGL Programming Guide (examples from that book in LWJGL are here: ) or use an engine that does this for you (e.g. There's (almost) no difference between fixed-function and glsl in the way you set up textures. set sampler uniform, to map your uniform to that unit ![]() set properties and glTexImage, to upload data to GPUĥ. set active unit, to set the tex unit you want to bind toĤ. ![]() Works the same way you do it for fixed-function:Ģ.
0 Comments
Leave a Reply. |