Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
integeruser committed Nov 26, 2016
1 parent 2991a98 commit c99c6a5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/integeruser/jgltut/tut12/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,10 @@ abstract class Scene {
getMaterials(materials);

ByteBuffer materialsBuffer = BufferUtils.createByteBuffer(sizeMaterialUniformBuffer);
final float[] padding = new float[(sizeMaterialBlock - MaterialBlock.BYTES) / (Float.SIZE / Byte.SIZE)];

for (MaterialBlock materialBlock : materials) {
materialBlock.get(materialsBuffer);
for (float f : padding)
materialsBuffer.putFloat(f); // The buffer size must be sizeMaterialUniformBuffer
materialsBuffer.position(materialsBuffer.position() + (sizeMaterialBlock - MaterialBlock.BYTES));
}

materialsBuffer.flip();

materialUniformBuffer = glGenBuffers();
Expand Down

0 comments on commit c99c6a5

Please sign in to comment.