Beispiel #1
0
//UNIFORMS -----------------------------------
func (p *Program) ResetUniforms() {
	for i := 0; i < globals.MaxLights; i++ {
		name := fmt.Sprintf("uLightSource[%v].enabled")
		p.UniformBool(name, false) //disable
	}
	p.SetTextureMatrix(mat4.Identity())
	p.SetModelMatrix(mat4.Identity())
	p.SetNormalMatrix(mat3.Identity())
	p.UniformFloat("uFarClipplane", GFarClipplane)
}
Beispiel #2
0
func (t *Nurbs) Render() {
	t.vbo.Enable()
	if globals.UseShader {
		program.SetModelMatrix(mat4.Identity())
		t.vbo.Draw(gl.TRIANGLES)
	} else {
		gl.PushMatrix()
		gl.MultMatrixf(mat4.Identity().Ptr32())
		t.vbo.Draw(gl.TRIANGLES)
		gl.PopMatrix()
	}
	t.vbo.Disable()
}
Beispiel #3
0
func (this *Window) resetModelViewMatrix() {
	if globals.UseShader {
		program.SetModelMatrix(mat4.Identity())
	}
	gl.MatrixMode(gl.MODELVIEW)
	gl.LoadIdentity()
}
Beispiel #4
0
func (s *Spline) Render() {
	if globals.UseShader {
		program.SetModelMatrix(mat4.Identity())
	}
	s.vbo.Enable()
	s.vbo.Draw(gl.TRIANGLES)
	s.vbo.Disable()
}