[pyassimp] Handle diffuse/ambient values stored as vec3 instead of vec4
parent
08e078e20d
commit
024bd4c470
|
@ -291,8 +291,13 @@ class PyAssimp3DViewer:
|
||||||
|
|
||||||
stride = 24 # 6 * 4 bytes
|
stride = 24 # 6 * 4 bytes
|
||||||
|
|
||||||
glUniform4f( shader.Material_diffuse, *mesh.material.properties["diffuse"] )
|
diffuse = mesh.material.properties["diffuse"]
|
||||||
glUniform4f( shader.Material_ambient, *mesh.material.properties["ambient"] )
|
if len(diffuse) == 3: diffuse.append(1.0)
|
||||||
|
ambient = mesh.material.properties["ambient"]
|
||||||
|
if len(ambient) == 3: ambient.append(1.0)
|
||||||
|
|
||||||
|
glUniform4f( shader.Material_diffuse, *diffuse )
|
||||||
|
glUniform4f( shader.Material_ambient, *ambient )
|
||||||
|
|
||||||
vbo = mesh.gl["vbo"]
|
vbo = mesh.gl["vbo"]
|
||||||
vbo.bind()
|
vbo.bind()
|
||||||
|
|
Loading…
Reference in New Issue