Remove low_end option from renderer, being replaced by separate implementation
This commit is contained in:
parent
1075943cc5
commit
71c5d73b5e
|
@ -941,7 +941,7 @@ void RenderForwardClustered::_fill_render_list(RenderListType p_render_list, con
|
||||||
uses_lightmap = true;
|
uses_lightmap = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (!low_end) {
|
} else {
|
||||||
if (p_using_opaque_gi) {
|
if (p_using_opaque_gi) {
|
||||||
flags |= INSTANCE_DATA_FLAG_USE_GI_BUFFERS;
|
flags |= INSTANCE_DATA_FLAG_USE_GI_BUFFERS;
|
||||||
}
|
}
|
||||||
|
@ -1133,7 +1133,7 @@ void RenderForwardClustered::_render_scene(RID p_render_buffer, const Transform
|
||||||
|
|
||||||
opaque_framebuffer = render_buffer->color_fb;
|
opaque_framebuffer = render_buffer->color_fb;
|
||||||
|
|
||||||
if (!low_end && p_gi_probes.size() > 0) {
|
if (p_gi_probes.size() > 0) {
|
||||||
using_giprobe = true;
|
using_giprobe = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1212,7 +1212,7 @@ void RenderForwardClustered::_render_scene(RID p_render_buffer, const Transform
|
||||||
|
|
||||||
RD::get_singleton()->draw_command_end_label();
|
RD::get_singleton()->draw_command_end_label();
|
||||||
|
|
||||||
bool using_sss = !low_end && render_buffer && scene_state.used_sss && sub_surface_scattering_get_quality() != RS::SUB_SURFACE_SCATTERING_QUALITY_DISABLED;
|
bool using_sss = render_buffer && scene_state.used_sss && sub_surface_scattering_get_quality() != RS::SUB_SURFACE_SCATTERING_QUALITY_DISABLED;
|
||||||
|
|
||||||
if (using_sss) {
|
if (using_sss) {
|
||||||
using_separate_specular = true;
|
using_separate_specular = true;
|
||||||
|
@ -1296,7 +1296,7 @@ void RenderForwardClustered::_render_scene(RID p_render_buffer, const Transform
|
||||||
|
|
||||||
bool debug_giprobes = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_ALBEDO || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION;
|
bool debug_giprobes = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_ALBEDO || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_LIGHTING || get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_GI_PROBE_EMISSION;
|
||||||
bool debug_sdfgi_probes = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_SDFGI_PROBES;
|
bool debug_sdfgi_probes = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_SDFGI_PROBES;
|
||||||
bool depth_pre_pass = !low_end && depth_framebuffer.is_valid();
|
bool depth_pre_pass = depth_framebuffer.is_valid();
|
||||||
|
|
||||||
bool using_ssao = depth_pre_pass && p_render_buffer.is_valid() && p_environment.is_valid() && environment_is_ssao_enabled(p_environment);
|
bool using_ssao = depth_pre_pass && p_render_buffer.is_valid() && p_environment.is_valid() && environment_is_ssao_enabled(p_environment);
|
||||||
bool continue_depth = false;
|
bool continue_depth = false;
|
||||||
|
@ -1903,7 +1903,7 @@ void RenderForwardClustered::_update_render_base_uniform_set() {
|
||||||
uniforms.push_back(u);
|
uniforms.push_back(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!low_end) {
|
{
|
||||||
RD::Uniform u;
|
RD::Uniform u;
|
||||||
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
|
u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER;
|
||||||
u.binding = 13;
|
u.binding = 13;
|
||||||
|
@ -2065,7 +2065,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend
|
||||||
uniforms.push_back(u);
|
uniforms.push_back(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!low_end) {
|
{
|
||||||
{
|
{
|
||||||
RD::Uniform u;
|
RD::Uniform u;
|
||||||
u.binding = 11;
|
u.binding = 11;
|
||||||
|
@ -2616,7 +2616,7 @@ void RenderForwardClustered::_geometry_instance_update(GeometryInstance *p_geome
|
||||||
ginstance->store_transform_cache = store_transform;
|
ginstance->store_transform_cache = store_transform;
|
||||||
ginstance->can_sdfgi = false;
|
ginstance->can_sdfgi = false;
|
||||||
|
|
||||||
if (!lightmap_instance_is_valid(ginstance->lightmap_instance) && !low_end) {
|
if (!lightmap_instance_is_valid(ginstance->lightmap_instance)) {
|
||||||
if (ginstance->gi_probes[0].is_null() && (ginstance->data->use_baked_light || ginstance->data->use_dynamic_gi)) {
|
if (ginstance->gi_probes[0].is_null() && (ginstance->data->use_baked_light || ginstance->data->use_dynamic_gi)) {
|
||||||
ginstance->can_sdfgi = true;
|
ginstance->can_sdfgi = true;
|
||||||
}
|
}
|
||||||
|
@ -2843,10 +2843,6 @@ RenderForwardClustered::RenderForwardClustered(RendererStorageRD *p_storage) :
|
||||||
|
|
||||||
{
|
{
|
||||||
String defines;
|
String defines;
|
||||||
if (low_end) {
|
|
||||||
defines += "\n#define LOW_END_MODE \n";
|
|
||||||
}
|
|
||||||
|
|
||||||
defines += "\n#define MAX_ROUGHNESS_LOD " + itos(get_roughness_layers() - 1) + ".0\n";
|
defines += "\n#define MAX_ROUGHNESS_LOD " + itos(get_roughness_layers() - 1) + ".0\n";
|
||||||
if (is_using_radiance_cubemap_array()) {
|
if (is_using_radiance_cubemap_array()) {
|
||||||
defines += "\n#define USE_RADIANCE_CUBEMAP_ARRAY \n";
|
defines += "\n#define USE_RADIANCE_CUBEMAP_ARRAY \n";
|
||||||
|
@ -2856,7 +2852,7 @@ RenderForwardClustered::RenderForwardClustered(RendererStorageRD *p_storage) :
|
||||||
|
|
||||||
{
|
{
|
||||||
//lightmaps
|
//lightmaps
|
||||||
scene_state.max_lightmaps = low_end ? 2 : MAX_LIGHTMAPS;
|
scene_state.max_lightmaps = MAX_LIGHTMAPS;
|
||||||
defines += "\n#define MAX_LIGHTMAP_TEXTURES " + itos(scene_state.max_lightmaps) + "\n";
|
defines += "\n#define MAX_LIGHTMAP_TEXTURES " + itos(scene_state.max_lightmaps) + "\n";
|
||||||
defines += "\n#define MAX_LIGHTMAPS " + itos(scene_state.max_lightmaps) + "\n";
|
defines += "\n#define MAX_LIGHTMAPS " + itos(scene_state.max_lightmaps) + "\n";
|
||||||
|
|
||||||
|
@ -2872,7 +2868,7 @@ RenderForwardClustered::RenderForwardClustered(RendererStorageRD *p_storage) :
|
||||||
defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n";
|
defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
scene_shader.init(p_storage, defines, low_end);
|
scene_shader.init(p_storage, defines);
|
||||||
}
|
}
|
||||||
|
|
||||||
render_list_thread_threshold = GLOBAL_GET("rendering/limits/forward_renderer/threaded_render_minimum_instances");
|
render_list_thread_threshold = GLOBAL_GET("rendering/limits/forward_renderer/threaded_render_minimum_instances");
|
||||||
|
|
|
@ -544,7 +544,7 @@ SceneShaderForwardClustered::~SceneShaderForwardClustered() {
|
||||||
storage->free(default_material);
|
storage->free(default_material);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const String p_defines, bool p_is_low_end) {
|
void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const String p_defines) {
|
||||||
storage = p_storage;
|
storage = p_storage;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -562,6 +562,7 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
|
||||||
shader_versions.push_back("\n#define MODE_MULTIPLE_RENDER_TARGETS\n#define USE_LIGHTMAP\n");
|
shader_versions.push_back("\n#define MODE_MULTIPLE_RENDER_TARGETS\n#define USE_LIGHTMAP\n");
|
||||||
shader.initialize(shader_versions, p_defines);
|
shader.initialize(shader_versions, p_defines);
|
||||||
|
|
||||||
|
/*
|
||||||
if (p_is_low_end) {
|
if (p_is_low_end) {
|
||||||
//disable the high end versions
|
//disable the high end versions
|
||||||
shader.set_variant_enabled(SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS, false);
|
shader.set_variant_enabled(SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS, false);
|
||||||
|
@ -571,6 +572,7 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
|
||||||
shader.set_variant_enabled(SHADER_VERSION_COLOR_PASS_WITH_SEPARATE_SPECULAR, false);
|
shader.set_variant_enabled(SHADER_VERSION_COLOR_PASS_WITH_SEPARATE_SPECULAR, false);
|
||||||
shader.set_variant_enabled(SHADER_VERSION_LIGHTMAP_COLOR_PASS_WITH_SEPARATE_SPECULAR, false);
|
shader.set_variant_enabled(SHADER_VERSION_LIGHTMAP_COLOR_PASS_WITH_SEPARATE_SPECULAR, false);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
storage->shader_set_data_request_function(RendererStorageRD::SHADER_TYPE_3D, _create_shader_funcs);
|
storage->shader_set_data_request_function(RendererStorageRD::SHADER_TYPE_3D, _create_shader_funcs);
|
||||||
|
@ -764,9 +766,7 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
|
||||||
|
|
||||||
MaterialData *md = (MaterialData *)storage->material_get_data(default_material, RendererStorageRD::SHADER_TYPE_3D);
|
MaterialData *md = (MaterialData *)storage->material_get_data(default_material, RendererStorageRD::SHADER_TYPE_3D);
|
||||||
default_shader_rd = shader.version_get_shader(md->shader_data->version, SHADER_VERSION_COLOR_PASS);
|
default_shader_rd = shader.version_get_shader(md->shader_data->version, SHADER_VERSION_COLOR_PASS);
|
||||||
if (!p_is_low_end) {
|
default_shader_sdfgi_rd = shader.version_get_shader(md->shader_data->version, SHADER_VERSION_DEPTH_PASS_WITH_SDF);
|
||||||
default_shader_sdfgi_rd = shader.version_get_shader(md->shader_data->version, SHADER_VERSION_DEPTH_PASS_WITH_SDF);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,7 +203,7 @@ public:
|
||||||
SceneShaderForwardClustered();
|
SceneShaderForwardClustered();
|
||||||
~SceneShaderForwardClustered();
|
~SceneShaderForwardClustered();
|
||||||
|
|
||||||
void init(RendererStorageRD *p_storage, const String p_defines, bool p_is_low_end);
|
void init(RendererStorageRD *p_storage, const String p_defines);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace RendererSceneRenderImplementation
|
} // namespace RendererSceneRenderImplementation
|
||||||
|
|
|
@ -317,7 +317,7 @@ void RendererSceneRenderRD::environment_set_sdfgi(RID p_env, bool p_enable, RS::
|
||||||
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
||||||
ERR_FAIL_COND(!env);
|
ERR_FAIL_COND(!env);
|
||||||
|
|
||||||
if (low_end) {
|
if (!is_dynamic_gi_supported()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ void RendererSceneRenderRD::environment_set_volumetric_fog(RID p_env, bool p_ena
|
||||||
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
||||||
ERR_FAIL_COND(!env);
|
ERR_FAIL_COND(!env);
|
||||||
|
|
||||||
if (low_end) {
|
if (!is_volumetric_supported()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,10 +410,6 @@ void RendererSceneRenderRD::environment_set_ssr(RID p_env, bool p_enable, int p_
|
||||||
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
||||||
ERR_FAIL_COND(!env);
|
ERR_FAIL_COND(!env);
|
||||||
|
|
||||||
if (low_end) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
env->set_ssr(p_enable, p_max_steps, p_fade_int, p_fade_out, p_depth_tolerance);
|
env->set_ssr(p_enable, p_max_steps, p_fade_int, p_fade_out, p_depth_tolerance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,10 +425,6 @@ void RendererSceneRenderRD::environment_set_ssao(RID p_env, bool p_enable, float
|
||||||
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
RendererSceneEnvironmentRD *env = environment_owner.getornull(p_env);
|
||||||
ERR_FAIL_COND(!env);
|
ERR_FAIL_COND(!env);
|
||||||
|
|
||||||
if (low_end) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
env->set_ssao(p_enable, p_radius, p_intensity, p_power, p_detail, p_horizon, p_sharpness, p_light_affect, p_ao_channel_affect);
|
env->set_ssao(p_enable, p_radius, p_intensity, p_power, p_detail, p_horizon, p_sharpness, p_light_affect, p_ao_channel_affect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1347,7 +1339,7 @@ void RendererSceneRenderRD::gi_probe_instance_set_transform_to_data(RID p_probe,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RendererSceneRenderRD::gi_probe_needs_update(RID p_probe) const {
|
bool RendererSceneRenderRD::gi_probe_needs_update(RID p_probe) const {
|
||||||
if (low_end) {
|
if (!is_dynamic_gi_supported()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1355,7 +1347,7 @@ bool RendererSceneRenderRD::gi_probe_needs_update(RID p_probe) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererSceneRenderRD::gi_probe_update(RID p_probe, bool p_update_light_instances, const Vector<RID> &p_light_instances, const PagedArray<GeometryInstance *> &p_dynamic_objects) {
|
void RendererSceneRenderRD::gi_probe_update(RID p_probe, bool p_update_light_instances, const Vector<RID> &p_light_instances, const PagedArray<GeometryInstance *> &p_dynamic_objects) {
|
||||||
if (low_end) {
|
if (!is_dynamic_gi_supported()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4091,11 +4083,6 @@ int RendererSceneRenderRD::get_max_directional_lights() const {
|
||||||
return cluster.max_directional_lights;
|
return cluster.max_directional_lights;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RendererSceneRenderRD::is_low_end() const {
|
|
||||||
// by default we switch this on this (may be ignored in some implementations)
|
|
||||||
return GLOBAL_GET("rendering/driver/rd_renderer/use_low_end_renderer");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RendererSceneRenderRD::is_dynamic_gi_supported() const {
|
bool RendererSceneRenderRD::is_dynamic_gi_supported() const {
|
||||||
// usable by default (unless low end = true)
|
// usable by default (unless low end = true)
|
||||||
return true;
|
return true;
|
||||||
|
@ -4120,21 +4107,13 @@ RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) {
|
||||||
directional_shadow.size = GLOBAL_GET("rendering/shadows/directional_shadow/size");
|
directional_shadow.size = GLOBAL_GET("rendering/shadows/directional_shadow/size");
|
||||||
directional_shadow.use_16_bits = GLOBAL_GET("rendering/shadows/directional_shadow/16_bits");
|
directional_shadow.use_16_bits = GLOBAL_GET("rendering/shadows/directional_shadow/16_bits");
|
||||||
|
|
||||||
uint32_t textures_per_stage = RD::get_singleton()->limit_get(RD::LIMIT_MAX_TEXTURES_PER_SHADER_STAGE);
|
|
||||||
|
|
||||||
low_end = is_low_end();
|
|
||||||
|
|
||||||
if (textures_per_stage < 48) {
|
|
||||||
low_end = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* SKY SHADER */
|
/* SKY SHADER */
|
||||||
|
|
||||||
sky.init(storage);
|
sky.init(storage);
|
||||||
|
|
||||||
/* GI */
|
/* GI */
|
||||||
|
|
||||||
if (!low_end && is_dynamic_gi_supported()) {
|
if (is_dynamic_gi_supported()) {
|
||||||
gi.init(storage, &sky);
|
gi.init(storage, &sky);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4172,7 +4151,7 @@ RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) {
|
||||||
cluster.directional_light_buffer = RD::get_singleton()->uniform_buffer_create(directional_light_buffer_size);
|
cluster.directional_light_buffer = RD::get_singleton()->uniform_buffer_create(directional_light_buffer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!low_end && is_volumetric_supported()) {
|
if (is_volumetric_supported()) {
|
||||||
String defines = "\n#define MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS " + itos(cluster.max_directional_lights) + "\n";
|
String defines = "\n#define MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS " + itos(cluster.max_directional_lights) + "\n";
|
||||||
Vector<String> volumetric_fog_modes;
|
Vector<String> volumetric_fog_modes;
|
||||||
volumetric_fog_modes.push_back("\n#define MODE_DENSITY\n");
|
volumetric_fog_modes.push_back("\n#define MODE_DENSITY\n");
|
||||||
|
@ -4230,7 +4209,7 @@ RendererSceneRenderRD::~RendererSceneRenderRD() {
|
||||||
RD::get_singleton()->free(sky.sky_scene_state.uniform_set);
|
RD::get_singleton()->free(sky.sky_scene_state.uniform_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!low_end) {
|
if (is_dynamic_gi_supported()) {
|
||||||
gi.free();
|
gi.free();
|
||||||
|
|
||||||
volumetric_fog.shader.version_free(volumetric_fog.shader_version);
|
volumetric_fog.shader.version_free(volumetric_fog.shader_version);
|
||||||
|
|
|
@ -51,7 +51,6 @@ protected:
|
||||||
RendererStorageRD *storage;
|
RendererStorageRD *storage;
|
||||||
double time;
|
double time;
|
||||||
double time_step = 0;
|
double time_step = 0;
|
||||||
bool low_end = false; // If true GI and Volumetric fog are disabled
|
|
||||||
|
|
||||||
struct RenderBufferData {
|
struct RenderBufferData {
|
||||||
virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa) = 0;
|
virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa) = 0;
|
||||||
|
@ -1190,8 +1189,6 @@ public:
|
||||||
|
|
||||||
void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir);
|
void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir);
|
||||||
|
|
||||||
virtual bool is_low_end() const;
|
|
||||||
|
|
||||||
virtual bool is_dynamic_gi_supported() const;
|
virtual bool is_dynamic_gi_supported() const;
|
||||||
virtual bool is_clustered_enabled() const;
|
virtual bool is_clustered_enabled() const;
|
||||||
virtual bool is_volumetric_supported() const;
|
virtual bool is_volumetric_supported() const;
|
||||||
|
|
|
@ -1735,8 +1735,6 @@ void sdfgi_process(uint cascade, vec3 cascade_pos, vec3 cam_pos, vec3 cam_normal
|
||||||
|
|
||||||
#ifndef MODE_RENDER_DEPTH
|
#ifndef MODE_RENDER_DEPTH
|
||||||
|
|
||||||
#ifndef LOW_END_MODE
|
|
||||||
|
|
||||||
vec4 volumetric_fog_process(vec2 screen_uv, float z) {
|
vec4 volumetric_fog_process(vec2 screen_uv, float z) {
|
||||||
vec3 fog_pos = vec3(screen_uv, z * scene_data.volumetric_fog_inv_length);
|
vec3 fog_pos = vec3(screen_uv, z * scene_data.volumetric_fog_inv_length);
|
||||||
if (fog_pos.z < 0.0) {
|
if (fog_pos.z < 0.0) {
|
||||||
|
@ -1747,7 +1745,6 @@ vec4 volumetric_fog_process(vec2 screen_uv, float z) {
|
||||||
|
|
||||||
return texture(sampler3D(volumetric_fog_texture, material_samplers[SAMPLER_LINEAR_CLAMP]), fog_pos);
|
return texture(sampler3D(volumetric_fog_texture, material_samplers[SAMPLER_LINEAR_CLAMP]), fog_pos);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
vec4 fog_process(vec3 vertex) {
|
vec4 fog_process(vec3 vertex) {
|
||||||
vec3 fog_color = scene_data.fog_light_color;
|
vec3 fog_color = scene_data.fog_light_color;
|
||||||
|
@ -2019,7 +2016,6 @@ FRAGMENT_SHADER_CODE
|
||||||
fog = fog_process(vertex);
|
fog = fog_process(vertex);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef LOW_END_MODE
|
|
||||||
if (scene_data.volumetric_fog_enabled) {
|
if (scene_data.volumetric_fog_enabled) {
|
||||||
vec4 volumetric_fog = volumetric_fog_process(screen_uv, -vertex.z);
|
vec4 volumetric_fog = volumetric_fog_process(screen_uv, -vertex.z);
|
||||||
if (scene_data.fog_enabled) {
|
if (scene_data.fog_enabled) {
|
||||||
|
@ -2037,7 +2033,6 @@ FRAGMENT_SHADER_CODE
|
||||||
fog = volumetric_fog;
|
fog = volumetric_fog;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //!LOW_END_MODE
|
|
||||||
#endif //!CUSTOM_FOG_USED
|
#endif //!CUSTOM_FOG_USED
|
||||||
|
|
||||||
uint fog_rg = packHalf2x16(fog.rg);
|
uint fog_rg = packHalf2x16(fog.rg);
|
||||||
|
@ -2377,7 +2372,7 @@ FRAGMENT_SHADER_CODE
|
||||||
specular_light = spec_accum.rgb;
|
specular_light = spec_accum.rgb;
|
||||||
ambient_light = amb_accum.rgb;
|
ambient_light = amb_accum.rgb;
|
||||||
}
|
}
|
||||||
#elif !defined(LOW_END_MODE)
|
#else
|
||||||
|
|
||||||
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_GI_BUFFERS)) { //use GI buffers
|
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_GI_BUFFERS)) { //use GI buffers
|
||||||
|
|
||||||
|
@ -2412,13 +2407,11 @@ FRAGMENT_SHADER_CODE
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LOW_END_MODE
|
|
||||||
if (scene_data.ssao_enabled) {
|
if (scene_data.ssao_enabled) {
|
||||||
float ssao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv).r;
|
float ssao = texture(sampler2D(ao_buffer, material_samplers[SAMPLER_LINEAR_CLAMP]), screen_uv).r;
|
||||||
ao = min(ao, ssao);
|
ao = min(ao, ssao);
|
||||||
ao_light_affect = mix(ao_light_affect, max(ao_light_affect, scene_data.ssao_light_affect), scene_data.ssao_ao_affect);
|
ao_light_affect = mix(ao_light_affect, max(ao_light_affect, scene_data.ssao_light_affect), scene_data.ssao_ao_affect);
|
||||||
}
|
}
|
||||||
#endif //LOW_END_MODE
|
|
||||||
|
|
||||||
{ // process reflections
|
{ // process reflections
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,6 @@ layout(set = 0, binding = 12, std430) restrict readonly buffer GlobalVariableDat
|
||||||
}
|
}
|
||||||
global_variables;
|
global_variables;
|
||||||
|
|
||||||
#ifndef LOW_END_MODE
|
|
||||||
|
|
||||||
struct SDFGIProbeCascadeData {
|
struct SDFGIProbeCascadeData {
|
||||||
vec3 position;
|
vec3 position;
|
||||||
float to_probe;
|
float to_probe;
|
||||||
|
@ -159,8 +157,6 @@ layout(set = 0, binding = 13, std140) uniform SDFGI {
|
||||||
}
|
}
|
||||||
sdfgi;
|
sdfgi;
|
||||||
|
|
||||||
#endif //LOW_END_MODE
|
|
||||||
|
|
||||||
/* Set 2: Render Pass (changes per render pass) */
|
/* Set 2: Render Pass (changes per render pass) */
|
||||||
|
|
||||||
layout(set = 1, binding = 0, std140) uniform SceneData {
|
layout(set = 1, binding = 0, std140) uniform SceneData {
|
||||||
|
@ -280,9 +276,7 @@ layout(set = 1, binding = 5) uniform texture2D directional_shadow_atlas;
|
||||||
|
|
||||||
layout(set = 1, binding = 6) uniform texture2DArray lightmap_textures[MAX_LIGHTMAP_TEXTURES];
|
layout(set = 1, binding = 6) uniform texture2DArray lightmap_textures[MAX_LIGHTMAP_TEXTURES];
|
||||||
|
|
||||||
#ifndef LOW_END_MOD
|
|
||||||
layout(set = 1, binding = 7) uniform texture3D gi_probe_textures[MAX_GI_PROBES];
|
layout(set = 1, binding = 7) uniform texture3D gi_probe_textures[MAX_GI_PROBES];
|
||||||
#endif
|
|
||||||
|
|
||||||
layout(set = 1, binding = 8, std430) buffer restrict readonly ClusterBuffer {
|
layout(set = 1, binding = 8, std430) buffer restrict readonly ClusterBuffer {
|
||||||
uint data[];
|
uint data[];
|
||||||
|
@ -306,8 +300,6 @@ layout(r32ui, set = 1, binding = 12) uniform restrict uimage3D geom_facing_grid;
|
||||||
layout(set = 1, binding = 9) uniform texture2D depth_buffer;
|
layout(set = 1, binding = 9) uniform texture2D depth_buffer;
|
||||||
layout(set = 1, binding = 10) uniform texture2D color_buffer;
|
layout(set = 1, binding = 10) uniform texture2D color_buffer;
|
||||||
|
|
||||||
#ifndef LOW_END_MODE
|
|
||||||
|
|
||||||
layout(set = 1, binding = 11) uniform texture2D normal_roughness_buffer;
|
layout(set = 1, binding = 11) uniform texture2D normal_roughness_buffer;
|
||||||
layout(set = 1, binding = 12) uniform texture2D ao_buffer;
|
layout(set = 1, binding = 12) uniform texture2D ao_buffer;
|
||||||
layout(set = 1, binding = 13) uniform texture2D ambient_buffer;
|
layout(set = 1, binding = 13) uniform texture2D ambient_buffer;
|
||||||
|
@ -338,8 +330,6 @@ gi_probes;
|
||||||
|
|
||||||
layout(set = 1, binding = 18) uniform texture3D volumetric_fog_texture;
|
layout(set = 1, binding = 18) uniform texture3D volumetric_fog_texture;
|
||||||
|
|
||||||
#endif // LOW_END_MODE
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set 2 Skeleton & Instancing (can change per item) */
|
/* Set 2 Skeleton & Instancing (can change per item) */
|
||||||
|
|
|
@ -241,8 +241,6 @@ public:
|
||||||
|
|
||||||
virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir) = 0;
|
virtual void sdfgi_set_debug_probe_select(const Vector3 &p_position, const Vector3 &p_dir) = 0;
|
||||||
|
|
||||||
virtual bool is_low_end() const = 0;
|
|
||||||
|
|
||||||
virtual void update() = 0;
|
virtual void update() = 0;
|
||||||
virtual ~RendererSceneRender() {}
|
virtual ~RendererSceneRender() {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue