Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualCryoGenesis

Posted 19 August 2012 - 12:25 PM

How many faces (triangles) do you show?

The following is a world at 160 blocks viewing distance. With a low budget graphics card, it renders at about 30 FPS with 250000 triangles and 500 draw calls in full widescreen mode. If is based on VBOs.

You say that you use far too much memory. How much data do you have per vertex? I use the following per vertex:
[source lang="cpp"]struct VertexDataf { glm::vec3 fNormal; glm::vec2 fTexture; glm::vec3 fVertex; float fIntensity; // Pre computed The light intensity of this vertex float fAmbient;};[/source]
I use back face culling to skip faces I can see.

Using only one vertex buffer object for one block means you need to change the transformation matrix for every block. This is probably very expensive, with one draw call for every block. Please explain about the data structures you used for the VBOs, and maybe we can identify why it is too much RAM.

[attachment=10777:blocks.jpeg]

Well I changed it so only the voxels that are active have their VBOs initialized and that brought the Ram usage down to a gig or so.
The voxels are drawn using quads and the VBO objects have 72 floats representing each vertex for each face so even though there are only 8 vertexes for a cube I have to do it for each face so it's basically 3(spacial coordiantes)*4(vertexes per face)*6(faces) = 72. Although, I'm not sure if there is a way round that or not. I'm not sure why the static VBO was taking up so much FPS.

At the moment I'm only using 1 chunk. The chunk is 128*128*128 but only a 10th of that is active due to the terrain generation being at a low level.
Is there a way to only have 8 vertexes in a VBO and draw cubes from that?

#1CryoGenesis

Posted 19 August 2012 - 12:24 PM

How many faces (triangles) do you show?

The following is a world at 160 blocks viewing distance. With a low budget graphics card, it renders at about 30 FPS with 250000 triangles and 500 draw calls in full widescreen mode. If is based on VBOs.

You say that you use far too much memory. How much data do you have per vertex? I use the following per vertex:
[source lang="cpp"]struct VertexDataf { glm::vec3 fNormal; glm::vec2 fTexture; glm::vec3 fVertex; float fIntensity; // Pre computed The light intensity of this vertex float fAmbient;};[/source]
I use back face culling to skip faces I can see.

Using only one vertex buffer object for one block means you need to change the transformation matrix for every block. This is probably very expensive, with one draw call for every block. Please explain about the data structures you used for the VBOs, and maybe we can identify why it is too much RAM.

[attachment=10777:blocks.jpeg]

Well I changed it so only the voxels that are active have their VBOs initialized and that brought the Ram usage down to a gig or so.
The voxels are drawn using quads and the VBO objects have 72 floats representing each vertex for each face so even though there are only 8 vertexes for a cube but I have to do it for each face so it's basically 3(spacial coordiantes)*4(vertexes per face)*6(faces) = 72. Although, I'm not sure if there is a way round that or not. I'm not sure why the static VBO was taking up so much FPS.

At the moment I'm only using 1 chunk. The chunk is 128*128*128 but only a 10th of that is active due to the terrain generation being at a low level.
Is there a way to only have 8 vertexes in a VBO and draw cubes from that?

PARTNERS