diff options
Diffstat (limited to 'scene/resources/sky_material.cpp')
-rw-r--r-- | scene/resources/sky_material.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index a0b6ab1e30..860673bee6 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -31,103 +31,83 @@ #include "sky_material.h" void ProceduralSkyMaterial::set_sky_top_color(const Color &p_sky_top) { - sky_top_color = p_sky_top; RS::get_singleton()->material_set_param(_get_material(), "sky_top_color", sky_top_color.to_linear()); } Color ProceduralSkyMaterial::get_sky_top_color() const { - return sky_top_color; } void ProceduralSkyMaterial::set_sky_horizon_color(const Color &p_sky_horizon) { - sky_horizon_color = p_sky_horizon; RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear()); } Color ProceduralSkyMaterial::get_sky_horizon_color() const { - return sky_horizon_color; } void ProceduralSkyMaterial::set_sky_curve(float p_curve) { - sky_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sky_curve", sky_curve); } float ProceduralSkyMaterial::get_sky_curve() const { - return sky_curve; } void ProceduralSkyMaterial::set_sky_energy(float p_energy) { - sky_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "sky_energy", sky_energy); } float ProceduralSkyMaterial::get_sky_energy() const { - return sky_energy; } void ProceduralSkyMaterial::set_ground_bottom_color(const Color &p_ground_bottom) { - ground_bottom_color = p_ground_bottom; RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear()); } Color ProceduralSkyMaterial::get_ground_bottom_color() const { - return ground_bottom_color; } void ProceduralSkyMaterial::set_ground_horizon_color(const Color &p_ground_horizon) { - ground_horizon_color = p_ground_horizon; RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear()); } Color ProceduralSkyMaterial::get_ground_horizon_color() const { - return ground_horizon_color; } void ProceduralSkyMaterial::set_ground_curve(float p_curve) { - ground_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "ground_curve", ground_curve); } float ProceduralSkyMaterial::get_ground_curve() const { - return ground_curve; } void ProceduralSkyMaterial::set_ground_energy(float p_energy) { - ground_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "ground_energy", ground_energy); } float ProceduralSkyMaterial::get_ground_energy() const { - return ground_energy; } void ProceduralSkyMaterial::set_sun_angle_max(float p_angle) { - sun_angle_max = p_angle; RS::get_singleton()->material_set_param(_get_material(), "sun_angle_max", Math::deg2rad(sun_angle_max)); } float ProceduralSkyMaterial::get_sun_angle_max() const { - return sun_angle_max; } void ProceduralSkyMaterial::set_sun_curve(float p_curve) { - sun_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sun_curve", sun_curve); } float ProceduralSkyMaterial::get_sun_curve() const { - return sun_curve; } @@ -136,17 +116,14 @@ bool ProceduralSkyMaterial::_can_do_next_pass() const { } Shader::Mode ProceduralSkyMaterial::get_shader_mode() const { - return Shader::MODE_SKY; } RID ProceduralSkyMaterial::get_shader_rid() const { - return shader; } void ProceduralSkyMaterial::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_sky_top_color", "color"), &ProceduralSkyMaterial::set_sky_top_color); ClassDB::bind_method(D_METHOD("get_sky_top_color"), &ProceduralSkyMaterial::get_sky_top_color); @@ -195,7 +172,6 @@ void ProceduralSkyMaterial::_bind_methods() { } ProceduralSkyMaterial::ProceduralSkyMaterial() { - String code = "shader_type sky;\n\n"; code += "uniform vec4 sky_top_color : hint_color = vec4(0.35, 0.46, 0.71, 1.0);\n"; @@ -285,13 +261,11 @@ ProceduralSkyMaterial::~ProceduralSkyMaterial() { /* PanoramaSkyMaterial */ void PanoramaSkyMaterial::set_panorama(const Ref<Texture2D> &p_panorama) { - panorama = p_panorama; RS::get_singleton()->material_set_param(_get_material(), "source_panorama", panorama); } Ref<Texture2D> PanoramaSkyMaterial::get_panorama() const { - return panorama; } @@ -300,17 +274,14 @@ bool PanoramaSkyMaterial::_can_do_next_pass() const { } Shader::Mode PanoramaSkyMaterial::get_shader_mode() const { - return Shader::MODE_SKY; } RID PanoramaSkyMaterial::get_shader_rid() const { - return shader; } void PanoramaSkyMaterial::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_panorama", "texture"), &PanoramaSkyMaterial::set_panorama); ClassDB::bind_method(D_METHOD("get_panorama"), &PanoramaSkyMaterial::get_panorama); @@ -340,47 +311,38 @@ PanoramaSkyMaterial::~PanoramaSkyMaterial() { /* PhysicalSkyMaterial */ void PhysicalSkyMaterial::set_rayleigh_coefficient(float p_rayleigh) { - rayleigh = p_rayleigh; RS::get_singleton()->material_set_param(_get_material(), "rayleigh", rayleigh); } float PhysicalSkyMaterial::get_rayleigh_coefficient() const { - return rayleigh; } void PhysicalSkyMaterial::set_rayleigh_color(Color p_rayleigh_color) { - rayleigh_color = p_rayleigh_color; RS::get_singleton()->material_set_param(_get_material(), "rayleigh_color", rayleigh_color); } Color PhysicalSkyMaterial::get_rayleigh_color() const { - return rayleigh_color; } void PhysicalSkyMaterial::set_mie_coefficient(float p_mie) { - mie = p_mie; RS::get_singleton()->material_set_param(_get_material(), "mie", mie); } float PhysicalSkyMaterial::get_mie_coefficient() const { - return mie; } void PhysicalSkyMaterial::set_mie_eccentricity(float p_eccentricity) { - mie_eccentricity = p_eccentricity; RS::get_singleton()->material_set_param(_get_material(), "mie_eccentricity", mie_eccentricity); } float PhysicalSkyMaterial::get_mie_eccentricity() const { - return mie_eccentricity; } void PhysicalSkyMaterial::set_mie_color(Color p_mie_color) { - mie_color = p_mie_color; RS::get_singleton()->material_set_param(_get_material(), "mie_color", mie_color); } @@ -389,52 +351,42 @@ Color PhysicalSkyMaterial::get_mie_color() const { } void PhysicalSkyMaterial::set_turbidity(float p_turbidity) { - turbidity = p_turbidity; RS::get_singleton()->material_set_param(_get_material(), "turbidity", turbidity); } float PhysicalSkyMaterial::get_turbidity() const { - return turbidity; } void PhysicalSkyMaterial::set_sun_disk_scale(float p_sun_disk_scale) { - sun_disk_scale = p_sun_disk_scale; RS::get_singleton()->material_set_param(_get_material(), "sun_disk_scale", sun_disk_scale); } float PhysicalSkyMaterial::get_sun_disk_scale() const { - return sun_disk_scale; } void PhysicalSkyMaterial::set_ground_color(Color p_ground_color) { - ground_color = p_ground_color; RS::get_singleton()->material_set_param(_get_material(), "ground_color", ground_color); } Color PhysicalSkyMaterial::get_ground_color() const { - return ground_color; } void PhysicalSkyMaterial::set_exposure(float p_exposure) { - exposure = p_exposure; RS::get_singleton()->material_set_param(_get_material(), "exposure", exposure); } float PhysicalSkyMaterial::get_exposure() const { - return exposure; } void PhysicalSkyMaterial::set_dither_strength(float p_dither_strength) { - dither_strength = p_dither_strength; RS::get_singleton()->material_set_param(_get_material(), "dither_strength", dither_strength); } float PhysicalSkyMaterial::get_dither_strength() const { - return dither_strength; } @@ -443,17 +395,14 @@ bool PhysicalSkyMaterial::_can_do_next_pass() const { } Shader::Mode PhysicalSkyMaterial::get_shader_mode() const { - return Shader::MODE_SKY; } RID PhysicalSkyMaterial::get_shader_rid() const { - return shader; } void PhysicalSkyMaterial::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_rayleigh_coefficient", "rayleigh"), &PhysicalSkyMaterial::set_rayleigh_coefficient); ClassDB::bind_method(D_METHOD("get_rayleigh_coefficient"), &PhysicalSkyMaterial::get_rayleigh_coefficient); |