LoadMesh.py also needs a small modification, thus:
class LoadMesh(Mesh3D):
def __init__(self, vao_ref, material, draw_type,
model_filename, texture_file=””,
back_face_cull=False):
..
#Comment out v_uvs as they aren’t needed for
#the shader and will cause Windows errors
#v_uvs = GraphicsData(“vec2”, self.uv_vals)
#v_uvs.create_variable(
# self.material.program_id,
# “vertex_uv”)
self.albedo = None
self.metallic = None
self.roughness = None
self.ao = None
#Comment out these next lines or remove them.
#if texture_file is not None:
#self.image = Texture(texture_file)
#self.texture = Uniform(“sampler2D”,
#[self.image.texture_id,
# 1])
def format_vertices(self, coordinates, triangles):
..
def set_properties(self, albedo, metallic,
roughness, ao):
self.albedo = Uniform(“vec3”, albedo)
self.metallic = Uniform(“float”, metallic)
self.roughness = Uniform(“float”, roughness)
self.ao = Uniform(“float”, ao)
def draw(self):
self.albedo.find_variable(
self.material.program_id,
“albedo”)
self.albedo.load()
self.metallic.find_variable(
self.material.program_id,
“metallic”)
self.metallic.load()
self.roughness.find_variable(
self.material.program_id,
“roughness”)
self.roughness.load()
self.ao.find_variable(
self.material.program_id, “ao”)
self.ao.load()
glBindVertexArray(self.vao_ref)
glDrawArrays(self.draw_type, 0,
len(self.coordinates))
..