@@ -31,16 +31,21 @@ void Renderer::Draw(Model* model, Camera* camera, DirLight* light)
31
31
shader->SetVec3Uniform (" LightDir" , light->GetForwardVector ());
32
32
shader->SetVec3Uniform (" LightColor" , light->color );
33
33
shader->SetFloatUniform (" LightShiness" , light->shiness );
34
+ shader->SetBoolUniform (" UseOpacity" , model->m_useOpacity );
34
35
35
36
shader->SetIntUniform (" diffuseTexture" , 0 );
36
37
shader->SetIntUniform (" specularTexture" , 1 );
38
+ shader->SetIntUniform (" opacityTexture" , 2 );
37
39
38
40
glActiveTexture (GL_TEXTURE0);
39
41
glBindTexture (GL_TEXTURE_2D, model->m_material ->diffuse .id );
40
42
41
43
glActiveTexture (GL_TEXTURE1);
42
44
glBindTexture (GL_TEXTURE_2D, model->m_material ->specular .id );
43
45
46
+ glActiveTexture (GL_TEXTURE2);
47
+ glBindTexture (GL_TEXTURE_2D, model->m_material ->opacity .id );
48
+
44
49
for (Mesh mesh : model->m_meshes [0 ])
45
50
{
46
51
glBindVertexArray (mesh.m_meshData .vao );
@@ -53,6 +58,9 @@ void Renderer::Draw(Model* model, Camera* camera, DirLight* light)
53
58
54
59
glActiveTexture (GL_TEXTURE1);
55
60
glBindTexture (GL_TEXTURE_2D, 0 );
61
+
62
+ glActiveTexture (GL_TEXTURE2);
63
+ glBindTexture (GL_TEXTURE_2D, 0 );
56
64
}
57
65
58
66
void Renderer::Shutdown ()
0 commit comments