wrap buffers in bufferutils for memory fix
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
78978c7f54
commit
21ed196993
@ -17,7 +17,6 @@
|
||||
|
||||
+ feedback driven requirements
|
||||
Much much much much more UI sound effects
|
||||
Combine inventory menus into one ui
|
||||
UI spacing and scaling
|
||||
Come up with a title for the game and create a title menu for it (ideally with some animation and music)
|
||||
Better skybox
|
||||
|
||||
@ -355,16 +355,31 @@ public class RenderUtils {
|
||||
int numPoints = data.npoints();
|
||||
|
||||
//verts
|
||||
{
|
||||
FloatBuffer verts = data.points(numPoints * 3);
|
||||
sphereMesh.bufferVertices(verts, 3);
|
||||
FloatBuffer vertsFinal = BufferUtils.createFloatBuffer(verts.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
vertsFinal.put(verts);
|
||||
vertsFinal.flip();
|
||||
sphereMesh.bufferVertices(vertsFinal, 3);
|
||||
}
|
||||
|
||||
//indices
|
||||
{
|
||||
IntBuffer indices = data.triangles(data.ntriangles() * 3);
|
||||
sphereMesh.bufferFaces(indices, data.ntriangles() * 3);
|
||||
IntBuffer indicesFinal = BufferUtils.createIntBuffer(indices.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
indicesFinal.put(indices);
|
||||
indicesFinal.flip();
|
||||
sphereMesh.bufferFaces(indicesFinal, data.ntriangles() * 3);
|
||||
}
|
||||
|
||||
//texture coords
|
||||
{
|
||||
FloatBuffer texCoords = data.tcoords(numPoints * 3);
|
||||
sphereMesh.bufferTextureCoords(texCoords, 2);
|
||||
FloatBuffer texCoordsFinal = BufferUtils.createFloatBuffer(texCoords.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
texCoordsFinal.put(texCoords);
|
||||
texCoordsFinal.flip();
|
||||
sphereMesh.bufferTextureCoords(texCoordsFinal, 2);
|
||||
}
|
||||
|
||||
|
||||
//setup extra structures
|
||||
@ -396,16 +411,31 @@ public class RenderUtils {
|
||||
int numPoints = data.npoints();
|
||||
|
||||
//verts
|
||||
{
|
||||
FloatBuffer verts = data.points(numPoints * 3);
|
||||
sphereMesh.bufferVertices(verts, 3);
|
||||
FloatBuffer vertsFinal = BufferUtils.createFloatBuffer(verts.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
vertsFinal.put(verts);
|
||||
vertsFinal.flip();
|
||||
sphereMesh.bufferVertices(vertsFinal, 3);
|
||||
}
|
||||
|
||||
//indices
|
||||
{
|
||||
IntBuffer indices = data.triangles(data.ntriangles() * 3);
|
||||
sphereMesh.bufferFaces(indices, data.ntriangles() * 3);
|
||||
IntBuffer indicesFinal = BufferUtils.createIntBuffer(indices.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
indicesFinal.put(indices);
|
||||
indicesFinal.flip();
|
||||
sphereMesh.bufferFaces(indicesFinal, data.ntriangles() * 3);
|
||||
}
|
||||
|
||||
//texture coords
|
||||
FloatBuffer texCoords = data.tcoords(numPoints * 2);
|
||||
sphereMesh.bufferTextureCoords(texCoords, 2);
|
||||
{
|
||||
FloatBuffer texCoords = data.tcoords(numPoints * 3);
|
||||
FloatBuffer texCoordsFinal = BufferUtils.createFloatBuffer(texCoords.limit()); //reallocating to BufferUtils buffer to help minimize memory errors
|
||||
texCoordsFinal.put(texCoords);
|
||||
texCoordsFinal.flip();
|
||||
sphereMesh.bufferTextureCoords(texCoordsFinal, 2);
|
||||
}
|
||||
|
||||
//setup extra structures
|
||||
Material mat = new Material();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user