feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
from misc.utility.scons_hints import *
|
||||
|
||||
Import("env")
|
||||
Import("env_modules")
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@
|
|||
Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the same value.
|
||||
</constant>
|
||||
<constant name="TYPE_SIMPLEX" value="0" enum="NoiseType">
|
||||
As opposed to [constant TYPE_PERLIN], gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts.
|
||||
As opposed to [constant TYPE_PERLIN], gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts. Internally uses FastNoiseLite's OpenSimplex2 noise type.
|
||||
</constant>
|
||||
<constant name="TYPE_SIMPLEX_SMOOTH" value="1" enum="NoiseType">
|
||||
Modified, higher quality version of [constant TYPE_SIMPLEX], but slower.
|
||||
Modified, higher quality version of [constant TYPE_SIMPLEX], but slower. Internally uses FastNoiseLite's OpenSimplex2S noise type.
|
||||
</constant>
|
||||
<constant name="FRACTAL_NONE" value="0" enum="FractalType">
|
||||
No fractal noise.
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
Manhattan distance (taxicab metric) to the nearest point.
|
||||
</constant>
|
||||
<constant name="DISTANCE_HYBRID" value="3" enum="CellularDistanceFunction">
|
||||
Blend of [constant DISTANCE_EUCLIDEAN] and [constant DISTANCE_MANHATTAN] to give curved cell boundaries
|
||||
Blend of [constant DISTANCE_EUCLIDEAN] and [constant DISTANCE_MANHATTAN] to give curved cell boundaries.
|
||||
</constant>
|
||||
<constant name="RETURN_CELL_VALUE" value="0" enum="CellularReturnType">
|
||||
The cellular distance function will return the same value for all points within a cell.
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public:
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
String NoiseEditorPlugin::get_name() const {
|
||||
String NoiseEditorPlugin::get_plugin_name() const {
|
||||
return Noise::get_class_static();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class NoiseEditorPlugin : public EditorPlugin {
|
|||
GDCLASS(NoiseEditorPlugin, EditorPlugin)
|
||||
|
||||
public:
|
||||
String get_name() const override;
|
||||
String get_plugin_name() const override;
|
||||
|
||||
NoiseEditorPlugin();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,11 +33,7 @@
|
|||
|
||||
#include "noise.h"
|
||||
|
||||
#include "core/io/image.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "scene/resources/gradient.h"
|
||||
|
||||
#include <thirdparty/noise/FastNoiseLite.h>
|
||||
#include "thirdparty/misc/FastNoiseLite.h"
|
||||
|
||||
typedef fastnoiselite::FastNoiseLite _FastNoiseLite;
|
||||
|
||||
|
|
|
|||
|
|
@ -194,6 +194,9 @@ Ref<Image> NoiseTexture2D::_modulate_with_gradient(Ref<Image> p_image, Ref<Gradi
|
|||
|
||||
void NoiseTexture2D::_update_texture() {
|
||||
bool use_thread = true;
|
||||
#ifndef THREADS_ENABLED
|
||||
use_thread = false;
|
||||
#endif
|
||||
if (first_time) {
|
||||
use_thread = false;
|
||||
first_time = false;
|
||||
|
|
|
|||
|
|
@ -187,6 +187,9 @@ Ref<Image> NoiseTexture3D::_modulate_with_gradient(Ref<Image> p_image, Ref<Gradi
|
|||
|
||||
void NoiseTexture3D::_update_texture() {
|
||||
bool use_thread = true;
|
||||
#ifndef THREADS_ENABLED
|
||||
use_thread = false;
|
||||
#endif
|
||||
if (first_time) {
|
||||
use_thread = false;
|
||||
first_time = false;
|
||||
|
|
@ -331,6 +334,10 @@ int NoiseTexture3D::get_depth() const {
|
|||
return depth;
|
||||
}
|
||||
|
||||
bool NoiseTexture3D::has_mipmaps() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
RID NoiseTexture3D::get_rid() const {
|
||||
if (!texture.is_valid()) {
|
||||
texture = RS::get_singleton()->texture_3d_placeholder_create();
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ public:
|
|||
virtual int get_height() const override;
|
||||
virtual int get_depth() const override;
|
||||
|
||||
virtual bool has_mipmaps() const override;
|
||||
|
||||
virtual RID get_rid() const override;
|
||||
|
||||
virtual Vector<Ref<Image>> get_data() const override;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class NoiseTextureTester : public RefCounted {
|
|||
|
||||
public:
|
||||
NoiseTextureTester(const NoiseTexture2D *const p_texture) :
|
||||
texture{ p_texture } {};
|
||||
texture{ p_texture } {}
|
||||
|
||||
Color compute_average_color(const Ref<Image> &p_noise_image) {
|
||||
Color r_avg_color{};
|
||||
|
|
@ -135,7 +135,7 @@ TEST_CASE("[NoiseTexture][SceneTree] Getter and setter") {
|
|||
noise_texture->set_noise(noise);
|
||||
CHECK(noise_texture->get_noise() == noise);
|
||||
noise_texture->set_noise(nullptr);
|
||||
CHECK(noise_texture->get_noise() == nullptr);
|
||||
CHECK(noise_texture->get_noise().is_null());
|
||||
|
||||
noise_texture->set_width(8);
|
||||
noise_texture->set_height(4);
|
||||
|
|
@ -190,7 +190,7 @@ TEST_CASE("[NoiseTexture][SceneTree] Getter and setter") {
|
|||
noise_texture->set_color_ramp(gradient);
|
||||
CHECK(noise_texture->get_color_ramp() == gradient);
|
||||
noise_texture->set_color_ramp(nullptr);
|
||||
CHECK(noise_texture->get_color_ramp() == nullptr);
|
||||
CHECK(noise_texture->get_color_ramp().is_null());
|
||||
}
|
||||
|
||||
TEST_CASE("[NoiseTexture2D][SceneTree] Generating a basic noise texture with mipmaps and color ramp modulation") {
|
||||
|
|
@ -200,10 +200,11 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a basic noise texture with mip
|
|||
noise_texture->set_noise(noise);
|
||||
|
||||
Ref<Gradient> gradient = memnew(Gradient);
|
||||
Vector<Gradient::Point> points;
|
||||
points.push_back({ 0.0, Color(1, 0, 0) });
|
||||
points.push_back({ 1.0, Color(0, 0, 1) });
|
||||
gradient->set_points(points);
|
||||
Vector<float> offsets = { 0.0, 1.0 };
|
||||
Vector<Color> colors = { Color(1, 0, 0), Color(0, 0, 1) };
|
||||
gradient->set_offsets(offsets);
|
||||
gradient->set_colors(colors);
|
||||
|
||||
noise_texture->set_color_ramp(gradient);
|
||||
noise_texture->set_width(16);
|
||||
noise_texture->set_height(16);
|
||||
|
|
@ -251,10 +252,12 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a seamless noise texture") {
|
|||
|
||||
SUBCASE("16x16 modulated with default (transparent)black and white gradient (RGBA8), with seamless blend skirt of 1.0") {
|
||||
Ref<Gradient> gradient = memnew(Gradient);
|
||||
Vector<Gradient::Point> points;
|
||||
points.push_back({ 0.0, Color(0, 0, 0, 0) });
|
||||
points.push_back({ 1.0, Color(1, 1, 1, 1) });
|
||||
gradient->set_points(points);
|
||||
|
||||
Vector<float> offsets = { 0.0, 1.0 };
|
||||
Vector<Color> colors = { Color(0, 0, 0, 0), Color(1, 1, 1, 1) };
|
||||
gradient->set_offsets(offsets);
|
||||
gradient->set_colors(colors);
|
||||
|
||||
noise_texture->set_color_ramp(gradient);
|
||||
noise_texture->set_seamless_blend_skirt(1.0);
|
||||
noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_rgba));
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class NoiseTexture3DTester : public RefCounted {
|
|||
|
||||
public:
|
||||
NoiseTexture3DTester(const NoiseTexture3D *const p_texture) :
|
||||
texture{ p_texture } {};
|
||||
texture{ p_texture } {}
|
||||
|
||||
Color compute_average_color(const Ref<Image> &p_noise_image) {
|
||||
Color r_avg_color{};
|
||||
|
|
@ -133,7 +133,7 @@ TEST_CASE("[NoiseTexture][SceneTree] Getter and setter") {
|
|||
noise_texture->set_noise(noise);
|
||||
CHECK(noise_texture->get_noise() == noise);
|
||||
noise_texture->set_noise(nullptr);
|
||||
CHECK(noise_texture->get_noise() == nullptr);
|
||||
CHECK(noise_texture->get_noise().is_null());
|
||||
|
||||
noise_texture->set_width(8);
|
||||
noise_texture->set_height(4);
|
||||
|
|
@ -174,7 +174,7 @@ TEST_CASE("[NoiseTexture][SceneTree] Getter and setter") {
|
|||
noise_texture->set_color_ramp(gradient);
|
||||
CHECK(noise_texture->get_color_ramp() == gradient);
|
||||
noise_texture->set_color_ramp(nullptr);
|
||||
CHECK(noise_texture->get_color_ramp() == nullptr);
|
||||
CHECK(noise_texture->get_color_ramp().is_null());
|
||||
}
|
||||
|
||||
TEST_CASE("[NoiseTexture3D][SceneTree] Generating a basic noise texture with mipmaps and color ramp modulation") {
|
||||
|
|
@ -184,10 +184,11 @@ TEST_CASE("[NoiseTexture3D][SceneTree] Generating a basic noise texture with mip
|
|||
noise_texture->set_noise(noise);
|
||||
|
||||
Ref<Gradient> gradient = memnew(Gradient);
|
||||
Vector<Gradient::Point> points;
|
||||
points.push_back({ 0.0, Color(1, 0, 0) });
|
||||
points.push_back({ 1.0, Color(0, 0, 1) });
|
||||
gradient->set_points(points);
|
||||
Vector<float> offsets = { 0.0, 1.0 };
|
||||
Vector<Color> colors = { Color(1, 0, 0), Color(0, 0, 1) };
|
||||
gradient->set_offsets(offsets);
|
||||
gradient->set_colors(colors);
|
||||
|
||||
noise_texture->set_color_ramp(gradient);
|
||||
noise_texture->set_width(16);
|
||||
noise_texture->set_height(16);
|
||||
|
|
@ -219,10 +220,12 @@ TEST_CASE("[NoiseTexture3D][SceneTree] Generating a seamless noise texture") {
|
|||
|
||||
SUBCASE("16x16x16 modulated with default (transparent)black and white gradient (RGBA8), with seamless blend skirt of 1.0") {
|
||||
Ref<Gradient> gradient = memnew(Gradient);
|
||||
Vector<Gradient::Point> points;
|
||||
points.push_back({ 0.0, Color(0, 0, 0, 0) });
|
||||
points.push_back({ 1.0, Color(1, 1, 1, 1) });
|
||||
gradient->set_points(points);
|
||||
|
||||
Vector<float> offsets = { 0.0, 1.0 };
|
||||
Vector<Color> colors = { Color(0, 0, 0, 0), Color(1, 1, 1, 1) };
|
||||
gradient->set_offsets(offsets);
|
||||
gradient->set_colors(colors);
|
||||
|
||||
noise_texture->set_color_ramp(gradient);
|
||||
noise_texture->set_seamless_blend_skirt(1.0);
|
||||
noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTexture3DTester::check_seamless_texture_rgba));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue