OpenGL 3D textures and quadrant mapping

I am creating a Minecraft engine engine to learn some OpenGL and 3D, and everything works fine except for FPS, which I am not happy with.

About 66 fps with 50k vertices / frame

Current : currently I draw only visible faces and use rejection of bushes, 16 by 16 cubes by 32 cubic pieces (for now).

I use 6 display lists for each fragment, one for each side (left, right, front, back, up, down), so the cubes are not drawn one by one, but the whole part of the piece at this time.

Using this method, I get about 20-100 frames per second, which is not very convenient. Profiling says that I send about 100k vertices to the graphics card, and as soon as I look at the sky and the vertices fall below 10k, I reach 200 + fps, so I think my bottleneck.

What do I want to do . Since I am less, I found this: http://ogre3d.org/forums/viewtopic.php?f=2&t=60381&p=405688#p404631

From what I understand, Kojack uses a 3D mesh of huge planes and somehow draws textures from a 2D texture atlas to specific places of these huge planes. He says he uses a three-dimensional texture 256x256x256, and green and blue channels - to display a two-dimensional texture atlas.

, , , , .

: , :(, , , , , 3D- ( ). , - ...

- , - , Google .

+3
2

. .

+2

. 256 256 256. 256 ( ), (.. 0,0,0 0,256,256, 1,0,0 1,256,256 256,0,0 256,256,256). , - - 512 /1024 . y z, 3072 3072 ( 256 x 256 x 256).

. , , . : 256 x 256 x 256 3D 16 x 16 , . , , . , , . 42, 7, 13, - 42, 7, 13. 3D- , , - , u, v - . R = 0 ( ), G = 2, B = 4, A = 0 ( ). 2 4 u, v, 2, 4 . , 16 x 16 (256) , ( 2 4 , 16, 2/16 = 0,125 4/16 = 0,25. 0,0 2,4 , 1,1 0,125 + 1/16 0.25 + 1/16. .

, , , , 3D- , - , , 0,0 -, , 3D- R = 0 ( ), G = 0, B = 0, A = 0 ( ).

+4

Source: https://habr.com/ru/post/1788339/


All Articles