diff options
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/light_data_inc.glsl | 32 | ||||
-rw-r--r-- | servers/rendering/shader_compiler.cpp | 10 |
2 files changed, 8 insertions, 34 deletions
diff --git a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl index 61c8488a05..a3bfb59f92 100644 --- a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl @@ -50,34 +50,4 @@ struct ReflectionData { // notes: for ambientblend, use distance to edge to blend between already existing global environment }; -struct DirectionalLightData { - mediump vec3 direction; - mediump float energy; - mediump vec3 color; - mediump float size; - mediump float specular; - uint mask; - highp float softshadow_angle; - highp float soft_shadow_scale; - bool blend_splits; - bool shadow_enabled; - highp float fade_from; - highp float fade_to; - uvec2 pad; - uint bake_mode; - mediump float shadow_volumetric_fog_fade; - highp vec4 shadow_bias; - highp vec4 shadow_normal_bias; - highp vec4 shadow_transmittance_bias; - highp vec4 shadow_z_range; - highp vec4 shadow_range_begin; - highp vec4 shadow_split_offsets; - highp mat4 shadow_matrix1; - highp mat4 shadow_matrix2; - highp mat4 shadow_matrix3; - highp mat4 shadow_matrix4; - highp vec2 uv_scale1; - highp vec2 uv_scale2; - highp vec2 uv_scale3; - highp vec2 uv_scale4; -}; +uv_scale1 diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp index 3d3226e75b..5669cb2054 100644 --- a/servers/rendering/shader_compiler.cpp +++ b/servers/rendering/shader_compiler.cpp @@ -685,9 +685,13 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene } vcode += ";\n"; - - r_gen_code.stage_globals[STAGE_VERTEX] += "layout(location=" + itos(index) + ") " + interp_mode + "out " + vcode; - r_gen_code.stage_globals[STAGE_FRAGMENT] += "layout(location=" + itos(index) + ") " + interp_mode + "in " + vcode; + // GLSL ES 3.0 does not allow layout qualifiers for varyings + if (!RS::get_singleton()->is_low_end()) { + r_gen_code.stage_globals[STAGE_VERTEX] += "layout(location=" + itos(index) + ") "; + r_gen_code.stage_globals[STAGE_FRAGMENT] += "layout(location=" + itos(index) + ") "; + } + r_gen_code.stage_globals[STAGE_VERTEX] += interp_mode + "out " + vcode; + r_gen_code.stage_globals[STAGE_FRAGMENT] += interp_mode + "in " + vcode; index += inc; } |