renderer_scene_render_forward.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /*************************************************************************/
  2. /* renderer_scene_render_forward.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef RENDERING_SERVER_SCENE_RENDER_FORWARD_H
  31. #define RENDERING_SERVER_SCENE_RENDER_FORWARD_H
  32. #include "servers/rendering/renderer_rd/pipeline_cache_rd.h"
  33. #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h"
  34. #include "servers/rendering/renderer_rd/renderer_storage_rd.h"
  35. #include "servers/rendering/renderer_rd/shaders/scene_forward.glsl.gen.h"
  36. class RendererSceneRenderForward : public RendererSceneRenderRD {
  37. enum {
  38. SCENE_UNIFORM_SET = 0,
  39. RENDER_PASS_UNIFORM_SET = 1,
  40. TRANSFORMS_UNIFORM_SET = 2,
  41. MATERIAL_UNIFORM_SET = 3
  42. };
  43. enum {
  44. SDFGI_MAX_CASCADES = 8,
  45. MAX_GI_PROBES = 8
  46. };
  47. /* Scene Shader */
  48. enum ShaderVersion {
  49. SHADER_VERSION_DEPTH_PASS,
  50. SHADER_VERSION_DEPTH_PASS_DP,
  51. SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS,
  52. SHADER_VERSION_DEPTH_PASS_WITH_NORMAL_AND_ROUGHNESS_AND_GIPROBE,
  53. SHADER_VERSION_DEPTH_PASS_WITH_MATERIAL,
  54. SHADER_VERSION_DEPTH_PASS_WITH_SDF,
  55. SHADER_VERSION_COLOR_PASS,
  56. SHADER_VERSION_COLOR_PASS_WITH_FORWARD_GI,
  57. SHADER_VERSION_COLOR_PASS_WITH_SEPARATE_SPECULAR,
  58. SHADER_VERSION_LIGHTMAP_COLOR_PASS,
  59. SHADER_VERSION_LIGHTMAP_COLOR_PASS_WITH_SEPARATE_SPECULAR,
  60. SHADER_VERSION_MAX
  61. };
  62. struct {
  63. SceneForwardShaderRD scene_shader;
  64. ShaderCompilerRD compiler;
  65. } shader;
  66. RendererStorageRD *storage;
  67. /* Material */
  68. struct ShaderData : public RendererStorageRD::ShaderData {
  69. enum BlendMode { //used internally
  70. BLEND_MODE_MIX,
  71. BLEND_MODE_ADD,
  72. BLEND_MODE_SUB,
  73. BLEND_MODE_MUL,
  74. BLEND_MODE_ALPHA_TO_COVERAGE
  75. };
  76. enum DepthDraw {
  77. DEPTH_DRAW_DISABLED,
  78. DEPTH_DRAW_OPAQUE,
  79. DEPTH_DRAW_ALWAYS
  80. };
  81. enum DepthTest {
  82. DEPTH_TEST_DISABLED,
  83. DEPTH_TEST_ENABLED
  84. };
  85. enum Cull {
  86. CULL_DISABLED,
  87. CULL_FRONT,
  88. CULL_BACK
  89. };
  90. enum CullVariant {
  91. CULL_VARIANT_NORMAL,
  92. CULL_VARIANT_REVERSED,
  93. CULL_VARIANT_DOUBLE_SIDED,
  94. CULL_VARIANT_MAX
  95. };
  96. enum AlphaAntiAliasing {
  97. ALPHA_ANTIALIASING_OFF,
  98. ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE,
  99. ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE
  100. };
  101. bool valid;
  102. RID version;
  103. uint32_t vertex_input_mask;
  104. PipelineCacheRD pipelines[CULL_VARIANT_MAX][RS::PRIMITIVE_MAX][SHADER_VERSION_MAX];
  105. String path;
  106. Map<StringName, ShaderLanguage::ShaderNode::Uniform> uniforms;
  107. Vector<ShaderCompilerRD::GeneratedCode::Texture> texture_uniforms;
  108. Vector<uint32_t> ubo_offsets;
  109. uint32_t ubo_size;
  110. String code;
  111. Map<StringName, RID> default_texture_params;
  112. DepthDraw depth_draw;
  113. DepthTest depth_test;
  114. bool uses_point_size;
  115. bool uses_alpha;
  116. bool uses_blend_alpha;
  117. bool uses_alpha_clip;
  118. bool uses_depth_pre_pass;
  119. bool uses_discard;
  120. bool uses_roughness;
  121. bool uses_normal;
  122. bool unshaded;
  123. bool uses_vertex;
  124. bool uses_sss;
  125. bool uses_transmittance;
  126. bool uses_screen_texture;
  127. bool uses_depth_texture;
  128. bool uses_normal_texture;
  129. bool uses_time;
  130. bool writes_modelview_or_projection;
  131. bool uses_world_coordinates;
  132. uint64_t last_pass = 0;
  133. uint32_t index = 0;
  134. virtual void set_code(const String &p_Code);
  135. virtual void set_default_texture_param(const StringName &p_name, RID p_texture);
  136. virtual void get_param_list(List<PropertyInfo> *p_param_list) const;
  137. void get_instance_param_list(List<RendererStorage::InstanceShaderParam> *p_param_list) const;
  138. virtual bool is_param_texture(const StringName &p_param) const;
  139. virtual bool is_animated() const;
  140. virtual bool casts_shadows() const;
  141. virtual Variant get_default_parameter(const StringName &p_parameter) const;
  142. ShaderData();
  143. virtual ~ShaderData();
  144. };
  145. RendererStorageRD::ShaderData *_create_shader_func();
  146. static RendererStorageRD::ShaderData *_create_shader_funcs() {
  147. return static_cast<RendererSceneRenderForward *>(singleton)->_create_shader_func();
  148. }
  149. struct MaterialData : public RendererStorageRD::MaterialData {
  150. uint64_t last_frame;
  151. ShaderData *shader_data;
  152. RID uniform_buffer;
  153. RID uniform_set;
  154. Vector<RID> texture_cache;
  155. Vector<uint8_t> ubo_data;
  156. uint64_t last_pass = 0;
  157. uint32_t index = 0;
  158. RID next_pass;
  159. uint8_t priority;
  160. virtual void set_render_priority(int p_priority);
  161. virtual void set_next_pass(RID p_pass);
  162. virtual void update_parameters(const Map<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty);
  163. virtual ~MaterialData();
  164. };
  165. RendererStorageRD::MaterialData *_create_material_func(ShaderData *p_shader);
  166. static RendererStorageRD::MaterialData *_create_material_funcs(RendererStorageRD::ShaderData *p_shader) {
  167. return static_cast<RendererSceneRenderForward *>(singleton)->_create_material_func(static_cast<ShaderData *>(p_shader));
  168. }
  169. /* Push Constant */
  170. struct PushConstant {
  171. uint32_t index;
  172. uint32_t pad;
  173. float bake_uv2_offset[2];
  174. };
  175. /* Framebuffer */
  176. struct RenderBufferDataForward : public RenderBufferData {
  177. //for rendering, may be MSAAd
  178. RID color;
  179. RID depth;
  180. RID specular;
  181. RID normal_roughness_buffer;
  182. RID giprobe_buffer;
  183. RID ambient_buffer;
  184. RID reflection_buffer;
  185. RS::ViewportMSAA msaa;
  186. RD::TextureSamples texture_samples;
  187. RID color_msaa;
  188. RID depth_msaa;
  189. RID specular_msaa;
  190. RID normal_roughness_buffer_msaa;
  191. RID roughness_buffer_msaa;
  192. RID giprobe_buffer_msaa;
  193. RID depth_fb;
  194. RID depth_normal_roughness_fb;
  195. RID depth_normal_roughness_giprobe_fb;
  196. RID color_fb;
  197. RID color_specular_fb;
  198. RID specular_only_fb;
  199. int width, height;
  200. RID render_sdfgi_uniform_set;
  201. void ensure_specular();
  202. void ensure_gi();
  203. void ensure_giprobe();
  204. void clear();
  205. virtual void configure(RID p_color_buffer, RID p_depth_buffer, int p_width, int p_height, RS::ViewportMSAA p_msaa);
  206. ~RenderBufferDataForward();
  207. };
  208. virtual RenderBufferData *_create_render_buffer_data();
  209. void _allocate_normal_roughness_texture(RenderBufferDataForward *rb);
  210. RID shadow_sampler;
  211. RID render_base_uniform_set;
  212. RID render_pass_uniform_set;
  213. RID sdfgi_pass_uniform_set;
  214. uint64_t lightmap_texture_array_version = 0xFFFFFFFF;
  215. virtual void _base_uniforms_changed();
  216. void _render_buffers_clear_uniform_set(RenderBufferDataForward *rb);
  217. virtual void _render_buffers_uniform_set_changed(RID p_render_buffers);
  218. virtual RID _render_buffers_get_normal_texture(RID p_render_buffers);
  219. virtual RID _render_buffers_get_ambient_texture(RID p_render_buffers);
  220. virtual RID _render_buffers_get_reflection_texture(RID p_render_buffers);
  221. void _update_render_base_uniform_set();
  222. RID _setup_sdfgi_render_pass_uniform_set(RID p_albedo_texture, RID p_emission_texture, RID p_emission_aniso_texture, RID p_geom_facing_texture);
  223. RID _setup_render_pass_uniform_set(RID p_render_buffers, RID p_radiance_texture, RID p_shadow_atlas, RID p_reflection_atlas, RID *p_gi_probe_cull_result, int p_gi_probe_cull_count);
  224. struct LightmapData {
  225. float normal_xform[12];
  226. };
  227. struct LightmapCaptureData {
  228. float sh[9 * 4];
  229. };
  230. enum {
  231. INSTANCE_DATA_FLAG_USE_GI_BUFFERS = 1 << 6,
  232. INSTANCE_DATA_FLAG_USE_SDFGI = 1 << 7,
  233. INSTANCE_DATA_FLAG_USE_LIGHTMAP_CAPTURE = 1 << 8,
  234. INSTANCE_DATA_FLAG_USE_LIGHTMAP = 1 << 9,
  235. INSTANCE_DATA_FLAG_USE_SH_LIGHTMAP = 1 << 10,
  236. INSTANCE_DATA_FLAG_USE_GIPROBE = 1 << 11,
  237. INSTANCE_DATA_FLAG_MULTIMESH = 1 << 12,
  238. INSTANCE_DATA_FLAG_MULTIMESH_FORMAT_2D = 1 << 13,
  239. INSTANCE_DATA_FLAG_MULTIMESH_HAS_COLOR = 1 << 14,
  240. INSTANCE_DATA_FLAG_MULTIMESH_HAS_CUSTOM_DATA = 1 << 15,
  241. INSTANCE_DATA_FLAGS_MULTIMESH_STRIDE_SHIFT = 16,
  242. INSTANCE_DATA_FLAGS_MULTIMESH_STRIDE_MASK = 0x7,
  243. INSTANCE_DATA_FLAG_SKELETON = 1 << 19,
  244. };
  245. struct InstanceData {
  246. float transform[16];
  247. float normal_transform[16];
  248. uint32_t flags;
  249. uint32_t instance_uniforms_ofs; //instance_offset in instancing/skeleton buffer
  250. uint32_t gi_offset; //GI information when using lightmapping (VCT or lightmap)
  251. uint32_t mask;
  252. float lightmap_uv_scale[4];
  253. };
  254. struct SceneState {
  255. struct UBO {
  256. float projection_matrix[16];
  257. float inv_projection_matrix[16];
  258. float camera_matrix[16];
  259. float inv_camera_matrix[16];
  260. float viewport_size[2];
  261. float screen_pixel_size[2];
  262. float directional_penumbra_shadow_kernel[128]; //32 vec4s
  263. float directional_soft_shadow_kernel[128];
  264. float penumbra_shadow_kernel[128];
  265. float soft_shadow_kernel[128];
  266. uint32_t directional_penumbra_shadow_samples;
  267. uint32_t directional_soft_shadow_samples;
  268. uint32_t penumbra_shadow_samples;
  269. uint32_t soft_shadow_samples;
  270. float ambient_light_color_energy[4];
  271. float ambient_color_sky_mix;
  272. uint32_t use_ambient_light;
  273. uint32_t use_ambient_cubemap;
  274. uint32_t use_reflection_cubemap;
  275. float radiance_inverse_xform[12];
  276. float shadow_atlas_pixel_size[2];
  277. float directional_shadow_pixel_size[2];
  278. uint32_t directional_light_count;
  279. float dual_paraboloid_side;
  280. float z_far;
  281. float z_near;
  282. uint32_t ssao_enabled;
  283. float ssao_light_affect;
  284. float ssao_ao_affect;
  285. uint32_t roughness_limiter_enabled;
  286. float roughness_limiter_amount;
  287. float roughness_limiter_limit;
  288. uint32_t roughness_limiter_pad[2];
  289. float ao_color[4];
  290. float sdf_to_bounds[16];
  291. int32_t sdf_offset[3];
  292. uint32_t material_uv2_mode;
  293. int32_t sdf_size[3];
  294. uint32_t gi_upscale_for_msaa;
  295. uint32_t volumetric_fog_enabled;
  296. float volumetric_fog_inv_length;
  297. float volumetric_fog_detail_spread;
  298. uint32_t volumetric_fog_pad;
  299. // Fog
  300. uint32_t fog_enabled;
  301. float fog_density;
  302. float fog_height;
  303. float fog_height_density;
  304. float fog_light_color[3];
  305. float fog_sun_scatter;
  306. float fog_aerial_perspective;
  307. float time;
  308. float reflection_multiplier;
  309. uint32_t pancake_shadows;
  310. };
  311. UBO ubo;
  312. RID uniform_buffer;
  313. LightmapData *lightmaps;
  314. uint32_t max_lightmaps;
  315. RID lightmap_buffer;
  316. LightmapCaptureData *lightmap_captures;
  317. uint32_t max_lightmap_captures;
  318. RID lightmap_capture_buffer;
  319. RID instance_buffer;
  320. InstanceData *instances;
  321. uint32_t max_instances;
  322. bool used_screen_texture = false;
  323. bool used_normal_texture = false;
  324. bool used_depth_texture = false;
  325. bool used_sss = false;
  326. uint32_t current_shader_index = 0;
  327. uint32_t current_material_index = 0;
  328. } scene_state;
  329. /* Render List */
  330. struct RenderList {
  331. int max_elements;
  332. struct Element {
  333. RendererSceneRender::InstanceBase *instance;
  334. MaterialData *material;
  335. union {
  336. struct {
  337. //from least significant to most significant in sort, TODO: should be endian swapped on big endian
  338. uint64_t geometry_index : 20;
  339. uint64_t material_index : 15;
  340. uint64_t shader_index : 12;
  341. uint64_t uses_instancing : 1;
  342. uint64_t uses_forward_gi : 1;
  343. uint64_t uses_lightmap : 1;
  344. uint64_t depth_layer : 4;
  345. uint64_t priority : 8;
  346. };
  347. uint64_t sort_key;
  348. };
  349. uint32_t surface_index;
  350. };
  351. Element *base_elements;
  352. Element **elements;
  353. int element_count;
  354. int alpha_element_count;
  355. void clear() {
  356. element_count = 0;
  357. alpha_element_count = 0;
  358. }
  359. //should eventually be replaced by radix
  360. struct SortByKey {
  361. _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
  362. return A->sort_key < B->sort_key;
  363. }
  364. };
  365. void sort_by_key(bool p_alpha) {
  366. SortArray<Element *, SortByKey> sorter;
  367. if (p_alpha) {
  368. sorter.sort(&elements[max_elements - alpha_element_count], alpha_element_count);
  369. } else {
  370. sorter.sort(elements, element_count);
  371. }
  372. }
  373. struct SortByDepth {
  374. _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
  375. return A->instance->depth < B->instance->depth;
  376. }
  377. };
  378. void sort_by_depth(bool p_alpha) { //used for shadows
  379. SortArray<Element *, SortByDepth> sorter;
  380. if (p_alpha) {
  381. sorter.sort(&elements[max_elements - alpha_element_count], alpha_element_count);
  382. } else {
  383. sorter.sort(elements, element_count);
  384. }
  385. }
  386. struct SortByReverseDepthAndPriority {
  387. _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const {
  388. uint32_t layer_A = uint32_t(A->priority);
  389. uint32_t layer_B = uint32_t(B->priority);
  390. if (layer_A == layer_B) {
  391. return A->instance->depth > B->instance->depth;
  392. } else {
  393. return layer_A < layer_B;
  394. }
  395. }
  396. };
  397. void sort_by_reverse_depth_and_priority(bool p_alpha) { //used for alpha
  398. SortArray<Element *, SortByReverseDepthAndPriority> sorter;
  399. if (p_alpha) {
  400. sorter.sort(&elements[max_elements - alpha_element_count], alpha_element_count);
  401. } else {
  402. sorter.sort(elements, element_count);
  403. }
  404. }
  405. _FORCE_INLINE_ Element *add_element() {
  406. if (element_count + alpha_element_count >= max_elements) {
  407. return nullptr;
  408. }
  409. elements[element_count] = &base_elements[element_count];
  410. return elements[element_count++];
  411. }
  412. _FORCE_INLINE_ Element *add_alpha_element() {
  413. if (element_count + alpha_element_count >= max_elements) {
  414. return nullptr;
  415. }
  416. int idx = max_elements - alpha_element_count - 1;
  417. elements[idx] = &base_elements[idx];
  418. alpha_element_count++;
  419. return elements[idx];
  420. }
  421. void init() {
  422. element_count = 0;
  423. alpha_element_count = 0;
  424. elements = memnew_arr(Element *, max_elements);
  425. base_elements = memnew_arr(Element, max_elements);
  426. for (int i = 0; i < max_elements; i++) {
  427. elements[i] = &base_elements[i]; // assign elements
  428. }
  429. }
  430. RenderList() {
  431. max_elements = 0;
  432. }
  433. ~RenderList() {
  434. memdelete_arr(elements);
  435. memdelete_arr(base_elements);
  436. }
  437. };
  438. RenderList render_list;
  439. static RendererSceneRenderForward *singleton;
  440. uint64_t render_pass;
  441. double time;
  442. RID default_shader;
  443. RID default_material;
  444. RID overdraw_material_shader;
  445. RID overdraw_material;
  446. RID wireframe_material_shader;
  447. RID wireframe_material;
  448. RID default_shader_rd;
  449. RID default_shader_sdfgi_rd;
  450. RID default_vec4_xform_buffer;
  451. RID default_vec4_xform_uniform_set;
  452. enum PassMode {
  453. PASS_MODE_COLOR,
  454. PASS_MODE_COLOR_SPECULAR,
  455. PASS_MODE_COLOR_TRANSPARENT,
  456. PASS_MODE_SHADOW,
  457. PASS_MODE_SHADOW_DP,
  458. PASS_MODE_DEPTH,
  459. PASS_MODE_DEPTH_NORMAL_ROUGHNESS,
  460. PASS_MODE_DEPTH_NORMAL_ROUGHNESS_GIPROBE,
  461. PASS_MODE_DEPTH_MATERIAL,
  462. PASS_MODE_SDF,
  463. };
  464. void _setup_environment(RID p_environment, RID p_render_buffers, const CameraMatrix &p_cam_projection, const Transform &p_cam_transform, RID p_reflection_probe, bool p_no_fog, const Size2 &p_screen_pixel_size, RID p_shadow_atlas, bool p_flip_y, const Color &p_default_bg_color, float p_znear, float p_zfar, bool p_opaque_render_buffers = false, bool p_pancake_shadows = false);
  465. void _setup_lightmaps(InstanceBase **p_lightmap_cull_result, int p_lightmap_cull_count, const Transform &p_cam_transform);
  466. void _fill_instances(RenderList::Element **p_elements, int p_element_count, bool p_for_depth, bool p_has_sdfgi = false, bool p_has_opaque_gi = false);
  467. void _render_list(RenderingDevice::DrawListID p_draw_list, RenderingDevice::FramebufferFormatID p_framebuffer_Format, RenderList::Element **p_elements, int p_element_count, bool p_reverse_cull, PassMode p_pass_mode, bool p_no_gi, RID p_render_pass_uniform_set, bool p_force_wireframe = false, const Vector2 &p_uv_offset = Vector2(), const Plane &p_lod_plane = Plane(), float p_lod_distance_multiplier = 0.0, float p_screen_lod_threshold = 0.0);
  468. _FORCE_INLINE_ void _add_geometry(InstanceBase *p_instance, uint32_t p_surface, RID p_material, PassMode p_pass_mode, uint32_t p_geometry_index, bool p_using_sdfgi = false);
  469. _FORCE_INLINE_ void _add_geometry_with_material(InstanceBase *p_instance, uint32_t p_surface, MaterialData *p_material, RID p_material_rid, PassMode p_pass_mode, uint32_t p_geometry_index, bool p_using_sdfgi = false);
  470. void _fill_render_list(InstanceBase **p_cull_result, int p_cull_count, PassMode p_pass_mode, bool p_using_sdfgi = false);
  471. Map<Size2i, RID> sdfgi_framebuffer_size_cache;
  472. bool low_end = false;
  473. protected:
  474. virtual void _render_scene(RID p_render_buffer, const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, int p_directional_light_count, RID *p_gi_probe_cull_result, int p_gi_probe_cull_count, InstanceBase **p_lightmap_cull_result, int p_lightmap_cull_count, RID p_environment, RID p_camera_effects, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, const Color &p_default_bg_color, float p_lod_threshold);
  475. virtual void _render_shadow(RID p_framebuffer, InstanceBase **p_cull_result, int p_cull_count, const CameraMatrix &p_projection, const Transform &p_transform, float p_zfar, float p_bias, float p_normal_bias, bool p_use_dp, bool p_use_dp_flip, bool p_use_pancake, const Plane &p_camera_plane = Plane(), float p_lod_distance_multiplier = 0, float p_screen_lod_threshold = 0.0);
  476. virtual void _render_material(const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID p_framebuffer, const Rect2i &p_region);
  477. virtual void _render_uv2(InstanceBase **p_cull_result, int p_cull_count, RID p_framebuffer, const Rect2i &p_region);
  478. virtual void _render_sdfgi(RID p_render_buffers, const Vector3i &p_from, const Vector3i &p_size, const AABB &p_bounds, InstanceBase **p_cull_result, int p_cull_count, const RID &p_albedo_texture, const RID &p_emission_texture, const RID &p_emission_aniso_texture, const RID &p_geom_facing_texture);
  479. virtual void _render_particle_collider_heightfield(RID p_fb, const Transform &p_cam_transform, const CameraMatrix &p_cam_projection, InstanceBase **p_cull_result, int p_cull_count);
  480. public:
  481. virtual void set_time(double p_time, double p_step);
  482. virtual bool free(RID p_rid);
  483. RendererSceneRenderForward(RendererStorageRD *p_storage);
  484. ~RendererSceneRenderForward();
  485. };
  486. #endif // RASTERIZER_SCENE_HIGHEND_RD_H