public void setUniform(String uniformName, Matrix4f value) { glUniformMatrix4fv(uniforms.get(uniformName), true, BufferUtil.createFlippedBuffer(value)); }
public void addData(Mesh mesh) { indices = mesh.getIndices().length; vertices = mesh.getVertices().length; glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBufferSOA(mesh.getVertices()), GL_DYNAMIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(mesh.getIndices()), GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, false, 0, 0); glVertexAttribPointer(1, 2, GL_FLOAT, false, 0, vertices * offset); glBindVertexArray(0); }
glBufferData(GL_ELEMENT_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(mesh.getIndices()), GL_STATIC_DRAW);
public void addData(Vec2f[] data) { glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo); glBufferData(GL_SHADER_STORAGE_BUFFER, BufferUtil.createFlippedBuffer(data), GL_STATIC_READ); }
public void addData(int[] data) { glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo); glBufferData(GL_SHADER_STORAGE_BUFFER, BufferUtil.createFlippedBuffer(data), GL_STATIC_READ); }
public void update(List<Vec2f> texCoords) { glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferSubData(GL_ARRAY_BUFFER, vertices * offset, BufferUtil.createFlippedBuffer(texCoords)); glBindVertexArray(0); } }
public void update(Vec2f[] texCoords) { glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferSubData(GL_ARRAY_BUFFER, vertices * offset, BufferUtil.createFlippedBuffer(texCoords)); glBindVertexArray(0); }
public void update(Vec3f[] vertices) { glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(vertices), GL_STATIC_DRAW); glBindVertexArray(0); }
public void addData(Vec2f[] points) { size = points.length; glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(points), GL_STATIC_DRAW); glVertexAttribPointer(0, 2, GL_FLOAT, false, Float.BYTES*2, 0); glBindVertexArray(0); }
public void addData(Vec3f[] points) { size = points.length; glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(points), GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, false, Float.BYTES*3, 0); glBindVertexArray(0); }
public void addData(Vec3f[] vertices, int patchsize) { size = vertices.length; glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(vertices), GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, false, Float.BYTES*3, 0); glPatchParameteri(GL_PATCH_VERTICES, patchsize); glBindVertexArray(0); }
public void addData(Vec2f[] vertices, int patchsize) { size = vertices.length; glBindVertexArray(vaoId); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, BufferUtil.createFlippedBuffer(vertices), GL_STATIC_DRAW); glVertexAttribPointer(0, 2, GL_FLOAT, false, Float.BYTES*2, 0); glPatchParameteri(GL_PATCH_VERTICES, patchsize); glBindVertexArray(0); }
protected GLDirectionalLight(){ super(); ubo_light = new GLUniformBuffer(); getUbo_light().setBinding_point_index(Constants.DirectionalLightUniformBlockBinding); getUbo_light().bindBufferBase(); getUbo_light().allocate(getLightBufferSize()); setFloatBufferLight(BufferUtil.createFloatBuffer(getLightBufferSize())); getFloatBufferLight().put(BufferUtil.createFlippedBuffer(getDirection())); getFloatBufferLight().put(intensity); getFloatBufferLight().put(BufferUtil.createFlippedBuffer(getAmbient())); getFloatBufferLight().put(0); getFloatBufferLight().put(BufferUtil.createFlippedBuffer(getColor())); getFloatBufferLight().put(0); getUbo_light().updateData(getFloatBufferLight(), getLightBufferSize()); ubo_matrices = new GLUniformBuffer(); getUbo_matrices().setBinding_point_index(Constants.LightMatricesUniformBlockBinding); getUbo_matrices().bindBufferBase(); getUbo_matrices().allocate(getMatricesBufferSize()); getUbo_matrices().updateData(getFloatBufferMatrices(), getMatricesBufferSize()); }
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix)); modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));