Skip to content

Commit

Permalink
Merge pull request #41533 from Chaosus/vs_fix_specular
Browse files Browse the repository at this point in the history
Fix specular render_mode for visual shaders
  • Loading branch information
akien-mga authored Sep 3, 2020
2 parents 4a5138b + 4e2d699 commit 1956c7a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scene/resources/visual_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,10 +1367,19 @@ void VisualShader::_update_shader() const {
{
//fill render mode enums
int idx = 0;
bool specular = false;
while (render_mode_enums[idx].string) {
if (shader_mode == render_mode_enums[idx].mode) {
if (modes.has(render_mode_enums[idx].string)) {
int which = modes[render_mode_enums[idx].string];
if (shader_mode == Shader::MODE_SPATIAL) {
if (String(render_mode_enums[idx].string) == "specular") {
specular = true;
}
}
if (modes.has(render_mode_enums[idx].string) || specular) {
int which = 0;
if (modes.has(render_mode_enums[idx].string)) {
which = modes[render_mode_enums[idx].string];
}
int count = 0;
for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode)).size(); i++) {
String mode = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader_mode))[i];
Expand Down

0 comments on commit 1956c7a

Please sign in to comment.