예제 #1
0
func (m *Material) Use() {
	if globals.UseShader {
		program.SetFrontMaterial(m)
	} else {
		gl.Materialfv(gl.FRONT, gl.EMISSION, color.Black0.Slc32())
		gl.Materialfv(gl.FRONT, gl.AMBIENT, m.A.Slc32())
		gl.Materialfv(gl.FRONT, gl.DIFFUSE, m.B.Slc32())
		gl.Materialfv(gl.FRONT, gl.SPECULAR, m.C.Slc32())
		gl.Materialf(gl.FRONT, gl.SHININESS, float32(m.S*128.0))
	}
}
예제 #2
0
파일: material.go 프로젝트: swantescholz/go
func (m *Material) Use() {
	gl.Materialfv(gl.FRONT, gl.AMBIENT, m.A.Slc())
	gl.Materialfv(gl.FRONT, gl.DIFFUSE, m.B.Slc())
	gl.Materialfv(gl.FRONT, gl.SPECULAR, m.C.Slc())
	gl.Materialf(gl.FRONT, gl.SHININESS, float32(m.S*128.0))
}