Merge pull request #41536 from Chaosus/vs_fix_specular_3.2
[3.2] Fix specular render_mode for visual shaders
This commit is contained in:
commit
3f276033c1
|
@ -1246,13 +1246,20 @@ void VisualShader::_update_shader() const {
|
||||||
{
|
{
|
||||||
//fill render mode enums
|
//fill render mode enums
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
bool specular = false;
|
||||||
while (render_mode_enums[idx].string) {
|
while (render_mode_enums[idx].string) {
|
||||||
|
|
||||||
if (shader_mode == render_mode_enums[idx].mode) {
|
if (shader_mode == render_mode_enums[idx].mode) {
|
||||||
|
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) {
|
||||||
|
|
||||||
if (modes.has(render_mode_enums[idx].string)) {
|
int which = 0;
|
||||||
|
if (modes.has(render_mode_enums[idx].string)) {
|
||||||
int which = modes[render_mode_enums[idx].string];
|
which = modes[render_mode_enums[idx].string];
|
||||||
|
}
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) {
|
for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode)).size(); i++) {
|
||||||
String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i];
|
String mode = ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader_mode))[i];
|
||||||
|
|
Loading…
Reference in New Issue