godot/servers/rendering/renderer_rd/environment/sky.cpp

/**************************************************************************/
/*  sky.cpp                                                               */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "sky.h"
#include "core/config/project_settings.h"
#include "core/math/math_defs.h"
#include "servers/rendering/renderer_rd/effects/copy_effects.h"
#include "servers/rendering/renderer_rd/framebuffer_cache_rd.h"
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#include "servers/rendering/renderer_rd/renderer_scene_render_rd.h"
#include "servers/rendering/renderer_rd/storage_rd/material_storage.h"
#include "servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.h"
#include "servers/rendering/renderer_rd/storage_rd/texture_storage.h"
#include "servers/rendering/renderer_rd/uniform_set_cache_rd.h"
#include "servers/rendering/rendering_server_default.h"
#include "servers/rendering/rendering_server_globals.h"

usingnamespaceRendererRD;

#define RB_SCOPE_SKY
#define RB_HALF_TEXTURE
#define RB_QUARTER_TEXTURE

////////////////////////////////////////////////////////////////////////////////
// SKY SHADER

void SkyRD::SkyShaderData::set_code(const String &p_code) {}

bool SkyRD::SkyShaderData::is_animated() const {}

bool SkyRD::SkyShaderData::casts_shadows() const {}

RS::ShaderNativeSourceCode SkyRD::SkyShaderData::get_native_source_code() const {}

SkyRD::SkyShaderData::~SkyShaderData() {}

////////////////////////////////////////////////////////////////////////////////
// Sky material

bool SkyRD::SkyMaterialData::update_parameters(const HashMap<StringName, Variant> &p_parameters, bool p_uniform_dirty, bool p_textures_dirty) {}

SkyRD::SkyMaterialData::~SkyMaterialData() {}

////////////////////////////////////////////////////////////////////////////////
// Render sky

static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_basis, float *p_array) {}

void SkyRD::_render_sky(RD::DrawListID p_list, float p_time, RID p_fb, PipelineCacheRD *p_pipeline, RID p_uniform_set, RID p_texture_set, const Projection &p_projection, const Basis &p_orientation, const Vector3 &p_position, float p_luminance_multiplier) {}

////////////////////////////////////////////////////////////////////////////////
// ReflectionData

void SkyRD::ReflectionData::clear_reflection_data() {}

void SkyRD::ReflectionData::update_reflection_data(int p_size, int p_mipmaps, bool p_use_array, RID p_base_cube, int p_base_layer, bool p_low_quality, int p_roughness_layers, RD::DataFormat p_texture_format) {}

void SkyRD::ReflectionData::create_reflection_fast_filter(bool p_use_arrays) {}

void SkyRD::ReflectionData::create_reflection_importance_sample(bool p_use_arrays, int p_cube_side, int p_base_layer, uint32_t p_sky_ggx_samples_quality) {}

void SkyRD::ReflectionData::update_reflection_mipmaps(int p_start, int p_end) {}

////////////////////////////////////////////////////////////////////////////////
// SkyRD::Sky

void SkyRD::Sky::free() {}

RID SkyRD::Sky::get_textures(SkyTextureSetVersion p_version, RID p_default_shader_rd, Ref<RenderSceneBuffersRD> p_render_buffers) {}

bool SkyRD::Sky::set_radiance_size(int p_radiance_size) {}

bool SkyRD::Sky::set_mode(RS::SkyMode p_mode) {}

bool SkyRD::Sky::set_material(RID p_material) {}

Ref<Image> SkyRD::Sky::bake_panorama(float p_energy, int p_roughness_layers, const Size2i &p_size) {}

////////////////////////////////////////////////////////////////////////////////
// SkyRD

RendererRD::MaterialStorage::ShaderData *SkyRD::_create_sky_shader_func() {}

RendererRD::MaterialStorage::ShaderData *SkyRD::_create_sky_shader_funcs() {
	// !BAS! Why isn't _create_sky_shader_func not just static too?
	return static_cast<RendererSceneRenderRD *>(RendererSceneRenderRD::singleton)->sky._create_sky_shader_func();
};

RendererRD::MaterialStorage::MaterialData *SkyRD::_create_sky_material_func(SkyShaderData *p_shader) {}

RendererRD::MaterialStorage::MaterialData *SkyRD::_create_sky_material_funcs(RendererRD::MaterialStorage::ShaderData *p_shader) {
	// !BAS! same here, we could just make _create_sky_material_func static?
	return static_cast<RendererSceneRenderRD *>(RendererSceneRenderRD::singleton)->sky._create_sky_material_func(static_cast<SkyShaderData *>(p_shader));
};

SkyRD::SkyRD() {}

void SkyRD::init() {}

void SkyRD::set_texture_format(RD::DataFormat p_texture_format) {}

SkyRD::~SkyRD() {}

void SkyRD::setup_sky(RID p_env, Ref<RenderSceneBuffersRD> p_render_buffers, const PagedArray<RID> &p_lights, RID p_camera_attributes, uint32_t p_view_count, const Projection *p_view_projections, const Vector3 *p_view_eye_offsets, const Transform3D &p_cam_transform, const Projection &p_cam_projection, const Size2i p_screen_size, Vector2 p_jitter, RendererSceneRenderRD *p_scene_render) {}

void SkyRD::update_radiance_buffers(Ref<RenderSceneBuffersRD> p_render_buffers, RID p_env, const Vector3 &p_global_pos, double p_time, float p_luminance_multiplier) {}

void SkyRD::update_res_buffers(Ref<RenderSceneBuffersRD> p_render_buffers, RID p_env, double p_time, float p_luminance_multiplier) {}

void SkyRD::draw_sky(RD::DrawListID p_draw_list, Ref<RenderSceneBuffersRD> p_render_buffers, RID p_env, RID p_fb, double p_time, float p_luminance_multiplier) {}

void SkyRD::invalidate_sky(Sky *p_sky) {}

void SkyRD::update_dirty_skys() {}

RID SkyRD::sky_get_material(RID p_sky) const {}

float SkyRD::sky_get_baked_exposure(RID p_sky) const {}

RID SkyRD::allocate_sky_rid() {}

void SkyRD::initialize_sky_rid(RID p_rid) {}

SkyRD::Sky *SkyRD::get_sky(RID p_sky) const {}

void SkyRD::free_sky(RID p_sky) {}

void SkyRD::sky_set_radiance_size(RID p_sky, int p_radiance_size) {}

void SkyRD::sky_set_mode(RID p_sky, RS::SkyMode p_mode) {}

void SkyRD::sky_set_material(RID p_sky, RID p_material) {}

Ref<Image> SkyRD::sky_bake_panorama(RID p_sky, float p_energy, bool p_bake_irradiance, const Size2i &p_size) {}

RID SkyRD::sky_get_radiance_texture_rd(RID p_sky) const {}