diff options
author | clayjohn <claynjohn@gmail.com> | 2022-05-10 10:02:44 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2022-05-12 10:37:27 -0700 |
commit | 652adcd5bfc569b93d8da3d1539f9a030d065eb7 (patch) | |
tree | a6f211776d4c111a0c1247c5390fd9877ff301f5 /servers | |
parent | 2bf8831dd62c7ef4977a23e93cb58a9d1f929bd9 (diff) |
Basic 3D rendering
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/light_data_inc.glsl | 32 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 46 |
2 files changed, 40 insertions, 38 deletions
diff --git a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl index a3bfb59f92..61c8488a05 100644 --- a/servers/rendering/renderer_rd/shaders/light_data_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/light_data_inc.glsl @@ -50,4 +50,34 @@ struct ReflectionData { // notes: for ambientblend, use distance to edge to blend between already existing global environment }; -uv_scale1 +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; +}; diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 136664e333..c4aafcc22c 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2885,6 +2885,7 @@ RenderingServer::RenderingServer() { GLOBAL_DEF("rendering/shading/overrides/force_lambert_over_burley.mobile", true); GLOBAL_DEF("rendering/driver/depth_prepass/enable", true); + GLOBAL_DEF("rendering/driver/depth_prepass/disable_for_vendors", "PowerVR,Mali,Adreno,Apple"); GLOBAL_DEF_RST("rendering/textures/default_filters/use_nearest_mipmap_filter", false); GLOBAL_DEF_RST("rendering/textures/default_filters/anisotropic_filtering_level", 2); @@ -3002,44 +3003,15 @@ RenderingServer::RenderingServer() { GLOBAL_DEF("rendering/limits/cluster_builder/max_clustered_elements", 512); ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/cluster_builder/max_clustered_elements", PropertyInfo(Variant::FLOAT, "rendering/limits/cluster_builder/max_clustered_elements", PROPERTY_HINT_RANGE, "32,8192,1")); - GLOBAL_DEF_RST_BASIC("xr/shaders/enabled", false); + // OpenGL limits + GLOBAL_DEF_RST("rendering/limits/opengl/max_renderable_elements", 65536); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/opengl/max_renderable_elements", PropertyInfo(Variant::INT, "rendering/limits/opengl/max_renderable_elements", PROPERTY_HINT_RANGE, "1024,65536,1")); + GLOBAL_DEF_RST("rendering/limits/opengl/max_renderable_lights", 256); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/opengl/max_renderable_lights", PropertyInfo(Variant::INT, "rendering/limits/opengl/max_renderable_lights", PROPERTY_HINT_RANGE, "16,4096,1")); + GLOBAL_DEF_RST("rendering/limits/opengl/max_lights_per_object", 8); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/opengl/max_lights_per_object", PropertyInfo(Variant::INT, "rendering/limits/opengl/max_lights_per_object", PROPERTY_HINT_RANGE, "2,1024,1")); - GLOBAL_DEF_RST("rendering/2d/options/use_software_skinning", true); - GLOBAL_DEF_RST("rendering/2d/options/ninepatch_mode", 1); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/2d/options/ninepatch_mode", PropertyInfo(Variant::INT, "rendering/2d/options/ninepatch_mode", PROPERTY_HINT_ENUM, "Fixed,Scaling")); - - GLOBAL_DEF_RST("rendering/2d/opengl/batching_send_null", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/2d/opengl/batching_send_null", PropertyInfo(Variant::INT, "rendering/2d/opengl/batching_send_null", PROPERTY_HINT_ENUM, "Default (On),Off,On")); - GLOBAL_DEF_RST("rendering/2d/opengl/batching_stream", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/2d/opengl/batching_stream", PropertyInfo(Variant::INT, "rendering/2d/opengl/batching_stream", PROPERTY_HINT_ENUM, "Default (Off),Off,On")); - GLOBAL_DEF_RST("rendering/2d/opengl/legacy_orphan_buffers", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/2d/opengl/legacy_orphan_buffers", PropertyInfo(Variant::INT, "rendering/2d/opengl/legacy_orphan_buffers", PROPERTY_HINT_ENUM, "Default (On),Off,On")); - GLOBAL_DEF_RST("rendering/2d/opengl/legacy_stream", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/2d/opengl/legacy_stream", PropertyInfo(Variant::INT, "rendering/2d/opengl/legacy_stream", PROPERTY_HINT_ENUM, "Default (On),Off,On")); - - GLOBAL_DEF("rendering/batching/options/use_batching", false); - GLOBAL_DEF_RST("rendering/batching/options/use_batching_in_editor", false); - GLOBAL_DEF("rendering/batching/options/single_rect_fallback", false); - GLOBAL_DEF("rendering/batching/parameters/max_join_item_commands", 16); - GLOBAL_DEF("rendering/batching/parameters/colored_vertex_format_threshold", 0.25f); - GLOBAL_DEF("rendering/batching/lights/scissor_area_threshold", 1.0f); - GLOBAL_DEF("rendering/batching/lights/max_join_items", 32); - GLOBAL_DEF("rendering/batching/parameters/batch_buffer_size", 16384); - GLOBAL_DEF("rendering/batching/parameters/item_reordering_lookahead", 4); - GLOBAL_DEF("rendering/batching/debug/flash_batching", false); - GLOBAL_DEF("rendering/batching/debug/diagnose_frame", false); - GLOBAL_DEF("rendering/gles2/compatibility/disable_half_float", false); - GLOBAL_DEF("rendering/gles2/compatibility/enable_high_float.Android", false); - GLOBAL_DEF("rendering/batching/precision/uv_contract", false); - GLOBAL_DEF("rendering/batching/precision/uv_contract_amount", 100); - - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/parameters/max_join_item_commands", PropertyInfo(Variant::INT, "rendering/batching/parameters/max_join_item_commands", PROPERTY_HINT_RANGE, "0,65535")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/parameters/colored_vertex_format_threshold", PropertyInfo(Variant::FLOAT, "rendering/batching/parameters/colored_vertex_format_threshold", PROPERTY_HINT_RANGE, "0.0,1.0,0.01")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/parameters/batch_buffer_size", PropertyInfo(Variant::INT, "rendering/batching/parameters/batch_buffer_size", PROPERTY_HINT_RANGE, "1024,65535,1024")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/lights/scissor_area_threshold", PropertyInfo(Variant::FLOAT, "rendering/batching/lights/scissor_area_threshold", PROPERTY_HINT_RANGE, "0.0,1.0")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/lights/max_join_items", PropertyInfo(Variant::INT, "rendering/batching/lights/max_join_items", PROPERTY_HINT_RANGE, "0,512")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/parameters/item_reordering_lookahead", PropertyInfo(Variant::INT, "rendering/batching/parameters/item_reordering_lookahead", PROPERTY_HINT_RANGE, "0,256")); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/batching/precision/uv_contract_amount", PropertyInfo(Variant::INT, "rendering/batching/precision/uv_contract_amount", PROPERTY_HINT_RANGE, "0,10000")); + GLOBAL_DEF_RST_BASIC("xr/shaders/enabled", false); } RenderingServer::~RenderingServer() { |