Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
178f03f
Replace 3D current textures with 2D ones
dligr Aug 8, 2025
e2b57bd
Improve the second noise texture
dligr Aug 8, 2025
e89c3e8
Enable particle trails
dligr Aug 8, 2025
4443712
Improve the main noise
dligr Aug 9, 2025
af1de61
Make particles fade in and fade out (instead of just disappearing)
dligr Aug 9, 2025
765ae46
Implement particle color option
dligr Aug 9, 2025
3c10bab
Yet another noise1 change
dligr Aug 10, 2025
0aba016
Only use trails in surface patches
dligr Aug 10, 2025
19bccf7
Yet another noise1 remake
dligr Aug 10, 2025
c32f208
Color some currents (not all yet)
dligr Aug 10, 2025
1c81564
More coloring, brightenss variance, light level-affected brightness
dligr Aug 11, 2025
495ab65
Improve currents shifting, increase trail length, make the velocity c…
dligr Aug 12, 2025
75fc891
Remove trails in ice shelf, add trails to mesopelagic, recolor some c…
dligr Aug 12, 2025
44fc358
Code style fix
dligr Aug 12, 2025
f081b3e
Partly fix currents disappearing if you go too quickly
dligr Aug 12, 2025
8be3197
Make the fluid current system work even when paused (so that trails d…
dligr Aug 12, 2025
1507860
Make the cutoff work, improve particle visibility in vents
dligr Aug 13, 2025
9aec730
Code style fix
dligr Aug 13, 2025
81df318
JSON formatting fix
dligr Aug 13, 2025
b4efdbd
Make variable naming more consistent, take `chaoticness` parameter in…
dligr Aug 13, 2025
54f3759
Remove redundant constants
dligr Aug 13, 2025
34c258d
Reset MicrobeStage.tscn
dligr Aug 14, 2025
c017222
Bring back aggressive inlining for GetPixel()
dligr Aug 14, 2025
d1c2e07
Reduce currents' change speed to avoid visual problems with trails
dligr Aug 14, 2025
89e667b
Add a safety check in the currents system code
dligr Aug 14, 2025
2ad2f12
Replace the fail check with an error print
dligr Aug 16, 2025
a47037a
Make it an error print instead of a normal print
dligr Aug 16, 2025
0a7b636
Fix the null comparison
dligr Aug 16, 2025
c594eae
Go back to the variant without the error print
dligr Aug 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/textures/CurrentsNoise1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/textures/CurrentsNoise1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://nf7opycrmbhf"
path="res://.godot/imported/CurrentsNoise1.png-58107ef5cf750e05da51f0b59591a322.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/textures/CurrentsNoise1.png"
dest_files=["res://.godot/imported/CurrentsNoise1.png-58107ef5cf750e05da51f0b59591a322.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
3 changes: 3 additions & 0 deletions assets/textures/CurrentsNoise2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/textures/CurrentsNoise2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cf25131bt7raj"
path="res://.godot/imported/CurrentsNoise2.png-8ef43f43a67c15804cdfc4dfd72cf4e5.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/textures/CurrentsNoise2.png"
dest_files=["res://.godot/imported/CurrentsNoise2.png-8ef43f43a67c15804cdfc4dfd72cf4e5.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
3 changes: 3 additions & 0 deletions assets/textures/TrailParticle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions assets/textures/TrailParticle.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dufk485jxbiin"
path.s3tc="res://.godot/imported/TrailParticle.png-5f501eb2997a563343275ee00dc94c86.s3tc.ctex"
path.etc2="res://.godot/imported/TrailParticle.png-5f501eb2997a563343275ee00dc94c86.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}

[deps]

source_file="res://assets/textures/TrailParticle.png"
dest_files=["res://.godot/imported/TrailParticle.png-5f501eb2997a563343275ee00dc94c86.s3tc.ctex", "res://.godot/imported/TrailParticle.png-5f501eb2997a563343275ee00dc94c86.etc2.ctex"]

[params]

compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
49 changes: 17 additions & 32 deletions shaders/CurrentsParticles.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ uniform sampler2D alphaCurve : repeat_disable;

uniform float gameTime;

uniform sampler3D noiseDisturbancesX;
uniform sampler3D noiseDisturbancesY;

uniform sampler3D noiseCurrentsX;
uniform sampler3D noiseCurrentsY;
uniform sampler2D noiseCurrents1;
uniform sampler2D noiseCurrents2;

uniform float speed;
uniform float chaoticness;
uniform float scale;
uniform float inverseScale;

uniform float brightness;

// The following constants should be the same as in FluidCurrentsSystem.cs
const float disturbanceTimescale = 1.0f;
const float currentsTimescale = 1.0f / 500.0f;
const float currentsStretchingMultiplier = 1.0f / 10.0f;
const float disturbanceToCurrentsRatio = 0.15f;
const float minCurrentIntensity = 0.25f;
const float currentsTimescale = 0.25f;
const float positionScaling = 0.9f;

// Generates a random float and modifies the seed
Expand Down Expand Up @@ -66,41 +59,32 @@ void start() {
TRANSFORM[0].xyz *= visibleScale;
TRANSFORM[1].xyz *= visibleScale;
TRANSFORM[2].xyz *= visibleScale;
CUSTOM.w = RandFromSeed(altSeed) * 0.2f + 0.8f;
}

void process() {
CUSTOM.y += DELTA;
float lifetimePercent = CUSTOM.y / LIFETIME;
float lifetimePercent = CUSTOM.y / (LIFETIME - 7.0f);
if (CUSTOM.y > LIFETIME) {
ACTIVE = false;
}

vec2 current;
{
// The following should strictly conform to the formula in FluidCurrentSystem.cs
vec2 position = TRANSFORM[3].xz * positionScaling * scale;

float disturbanceX = texture(noiseDisturbancesX,
vec3(position / 128.0f, gameTime * chaoticness * disturbanceTimescale / 64.0f)).r;
float disturbanceY = texture(noiseDisturbancesY,
vec3(position / 128.0f, gameTime * chaoticness * disturbanceTimescale / 64.0f)).r;

float currentX = texture(noiseCurrentsX,
vec3(position.x * currentsStretchingMultiplier / 128.0f, position.y / 128.0f,
gameTime * currentsTimescale * chaoticness / 64.0f)).r;
float currentY = texture(noiseCurrentsY,
vec3(position.x / 128.0f, position.y * currentsStretchingMultiplier / 128.0f,
gameTime * currentsTimescale * chaoticness / 64.0f)).r;
vec2 scaledPosition = TRANSFORM[3].xz * positionScaling * inverseScale;
float scaledTime = gameTime * currentsTimescale * chaoticness;

vec2 disturbances = vec2(disturbanceX, disturbanceY) * 2.0f - 1.0f;
vec2 currents = vec2(currentX, currentY) * 2.0f - 1.0f;
vec2 current1 = texture(noiseCurrents1,
vec2((scaledPosition.x + scaledTime) / 1024.0f,
(scaledPosition.y + scaledTime) / 1024.0f)).rg;
vec2 current2 = texture(noiseCurrents2,
vec2((scaledPosition.x - scaledTime) / 1024.0f,
(scaledPosition.y - scaledTime) / 1024.0f)).rg;

if (pow(currents.x, 2) + pow(currents.y, 2) < minCurrentIntensity)
{
currents = vec2(0.0f);
}
current = current1 * 2.0f - 1.0f;
current *= current2;

current = mix(currents, disturbances, disturbanceToCurrentsRatio);
current *= 10.0f * speed;
}

Expand All @@ -109,6 +93,7 @@ void process() {
TRANSFORM[3].xyz += VELOCITY * DELTA;

vec4 finalColor = colorValue;
finalColor.rgb *= CUSTOM.w;
finalColor.a *= texture(alphaCurve, vec2(lifetimePercent)).r;
if (speed != 0.0)
{
Expand Down
2 changes: 2 additions & 0 deletions simulation_parameters/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ public static class Constants
/// </summary>
public const float CURRENT_FORCE_CELL_MULTIPLIER = 15;

public const float CURRENT_COMPOUND_CLOUD_ADVECT_THRESHOLD = 0.15f;

public const int TRANSLATION_VERY_INCOMPLETE_THRESHOLD = 30;
public const int TRANSLATION_INCOMPLETE_THRESHOLD = 70;

Expand Down
Loading