@@ -69,6 +69,11 @@ void PhongShader::SetGlobalTime(float global_time)
69
69
glUniform1f (uniforms.global_time , global_time);
70
70
}
71
71
72
+ void PhongShader::SetOpacity (float opacity)
73
+ {
74
+ assert (this ->is_used == true );
75
+ glUniform1f (uniforms.opacity , opacity);
76
+ }
72
77
void PhongShader::CustomSetup ()
73
78
{
74
79
Shader::Use ();
@@ -79,6 +84,7 @@ void PhongShader::CustomSetup()
79
84
uniforms.specular_albedo = glGetUniformLocation (this ->program_id , " specular_albedo" );
80
85
uniforms.specular_power = glGetUniformLocation (this ->program_id , " specular_power" );
81
86
uniforms.ambient = glGetUniformLocation (this ->program_id , " ambient" );
87
+ uniforms.opacity = glGetUniformLocation (this ->program_id , " opacity" );
82
88
uniforms.modelview_matrix = glGetUniformLocation (this ->program_id , " mv_matrix" );
83
89
uniforms.view_matrix = glGetUniformLocation (this ->program_id , " view_matrix" );
84
90
uniforms.normal_matrix = glGetUniformLocation (this ->program_id , " normal_matrix" );
@@ -89,7 +95,6 @@ void PhongShader::CustomSetup()
89
95
this ->subroutine_indices .push_back (glGetSubroutineIndex (this ->program_id , GL_FRAGMENT_SHADER, " PerPixelLighting" ));
90
96
this ->subroutine_indices .push_back (glGetSubroutineIndex (this ->program_id , GL_FRAGMENT_SHADER , " PPLWithTexture" ));
91
97
this ->subroutine_indices .push_back (glGetSubroutineIndex (this ->program_id , GL_FRAGMENT_SHADER , " ShaderToy1" ));
92
- this ->subroutine_indices .push_back (glGetSubroutineIndex (this ->program_id , GL_FRAGMENT_SHADER , " PPLWithTextureAndVignette" ));
93
98
Shader::UnUse ();
94
99
}
95
100
0 commit comments