Enabling and disabling vertex attributes

Started by madeinsoviets, February 15, 2011, 12:13:39

Previous topic - Next topic

madeinsoviets

Guys, do i need to disable vertex attributes after rendering? Or i just need to enable them once when created?
// Binding float attributes
		for (GLSLVertexAttribute attr : attributes.values()) {
			attr.bind();
		}
		
		// Rendering meshData
		meshData.render();
		
		// Unbinding attributes
		for (GLSLVertexAttribute attr : attributes.values()) {
			attr.unbind();
		}

public void bind(){
		buffer.bindBuffer();
		ARBVertexShader.glVertexAttribPointerARB(location, cntPerVertex, ARBShaderObjects.GL_FLOAT, false, 0, 0);
		glEnableVertexAttribArray(location);
	}
	
	public void unbind(){
		glDisableVertexAttribArray(location);
	}