From b6c428d6827a63710ee931c4c317196cc9bc8038 Mon Sep 17 00:00:00 2001 From: Nibu Date: Wed, 11 Nov 2026 12:08:15 +0000 Subject: [PATCH] Shaders: GalaxyMap, Clouds, SimplexBrush and Lightning.compute call cultmath_snoise The previous commit deleted the GPU Noise includes; this one carries the call-site edits it described. Release map notes Background's remaining 2D gradient copy. Co-Authored-By: Claude Sonnet 5.5 --- Assets/Shaders/Brushes/SimplexBrush.shader | 4 ++-- Assets/Shaders/Clouds.shader | 6 +++--- Assets/Shaders/Compute/Lightning/Lightning.compute | 4 ++-- Assets/Shaders/GalaxyMap.shader | 6 +++--- docs/aetheria-release-map.md | 4 +++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Assets/Shaders/Brushes/SimplexBrush.shader b/Assets/Shaders/Brushes/SimplexBrush.shader index 3a6bf56e5..af54035b2 100644 --- a/Assets/Shaders/Brushes/SimplexBrush.shader +++ b/Assets/Shaders/Brushes/SimplexBrush.shader @@ -25,7 +25,7 @@ Category { #pragma target 2.0 #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise3D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" float _Depth; float _Power; @@ -68,7 +68,7 @@ Category { fixed4 frag (v2f i) : SV_Target { float dist = length(i.texcoord - float2(.5,.5)); - return powerPulse(dist * 2,_Power) * (_Depth * abs(snoise(float3(i.texcoord1.xy*_Frequency,_Time.y*_Speed)))+_Constant); + return powerPulse(dist * 2,_Power) * (_Depth * abs(cultmath_snoise(float3(i.texcoord1.xy*_Frequency,_Time.y*_Speed)))+_Constant); } ENDCG } diff --git a/Assets/Shaders/Clouds.shader b/Assets/Shaders/Clouds.shader index 11e3fe0a3..ccbda8835 100644 --- a/Assets/Shaders/Clouds.shader +++ b/Assets/Shaders/Clouds.shader @@ -29,7 +29,7 @@ #pragma fragment frag #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise3D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct appdata { @@ -64,7 +64,7 @@ float sum = 0; for(int i = 0; i < 6; i++) { - sum += snoise(p * freq + Parallax * ParallaxDirection) * amp; + sum += cultmath_snoise(p * freq + Parallax * ParallaxDirection) * amp; parallax /= ParallaxLacunarity; freq *= NoiseLacunarity; amp *= NoiseGain; @@ -83,7 +83,7 @@ fixed4 frag (v2f i) : SV_Target { float3 p = float3(i.uv,_Time.x*Speed); - float noise = saturate((1-abs(snoise(p*NoiseFrequency/2))) * fbm(p)); + float noise = saturate((1-abs(cultmath_snoise(p*NoiseFrequency/2))) * fbm(p)); return noise * _Color * (1-length(i.uv)/FadeDistance); } ENDCG diff --git a/Assets/Shaders/Compute/Lightning/Lightning.compute b/Assets/Shaders/Compute/Lightning/Lightning.compute index 0750006b9..7edd707d4 100644 --- a/Assets/Shaders/Compute/Lightning/Lightning.compute +++ b/Assets/Shaders/Compute/Lightning/Lightning.compute @@ -5,7 +5,7 @@ #define NUM_THREAD_X 64 #include "LightningVertex.cginc" -#include "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc" +#include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct Node { @@ -46,7 +46,7 @@ float fbm(float2 p) float sum = 0; for(int i = 0; i < 4; i++) { - sum += snoise(p * freq) * amp; + sum += cultmath_snoise(p * freq) * amp; freq *= _NoiseLacunarity; amp *= _NoiseGain; } diff --git a/Assets/Shaders/GalaxyMap.shader b/Assets/Shaders/GalaxyMap.shader index 567396a35..109cd96d0 100644 --- a/Assets/Shaders/GalaxyMap.shader +++ b/Assets/Shaders/GalaxyMap.shader @@ -36,7 +36,7 @@ Shader "Unlit/GalaxyMap" #pragma fragment frag #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct appdata { @@ -86,8 +86,8 @@ Shader "Unlit/GalaxyMap" for(int i = 0; i < octaves; i++) { if(i<4) - sum += (1-abs(snoise(p * freq))) * amp; - else sum += abs(snoise(p * freq)) * amp; + sum += (1-abs(cultmath_snoise(p * freq))) * amp; + else sum += abs(cultmath_snoise(p * freq)) * amp; freq *= NoiseLacunarity; amp *= NoiseGain; } diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index 18f9b6941..72e96f22e 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -7459,7 +7459,9 @@ That file's Cut 4 (AI heading planner) and Cut 5 (combat facing) are carried as is `stage.Generated("Djinni")`, `EvasionTermTests.cs:520`, so the target's fit follows the galaxy). The cause is 0.3.0's breaking `snoise` kernel (its CHANGELOG), read in C# by `Settings.cs:72-73` (galaxy cloud density), `GlobalData.cs:30` and `Environment.cs:132,144`. Shaders use the GPU Noise plugin, not - CultMath (`Background.shader:39`), so nothing on the GPU moves. Every other DemoTerminus test passes. + CultMath (`Background.shader:39`), so nothing on the GPU moved at 0.3.0. GalaxyMap, Clouds, SimplexBrush and + Lightning.compute now include `CultMath.hlsl`; Background keeps its 2D gradient copy because CultMath has no 2D + `snoise_grad`. Every other DemoTerminus test passes. Between the tags CultMath also adds `phacelle` (MPL-2.0 files), `cellular`, `smin_grad`, the `*_grad` noises and `BoundedLeastSquares`; no existing signature changes. - **TA9. The pin guard.** `Directory.Build.targets:21` conditions `VerifyCultLibRevision` on a