Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.79k stars 327 forks source link

HLSL Domain Warp Algorithms generate error: variable 'xr' used without having been completely initialized #55

Closed gaiastellar closed 4 years ago

gaiastellar commented 4 years ago

when using fnlDomainWarp2D(state, x, y); on any warp fractal settings, similar errors are generated from the warp fractal functions: variable 'xr' used without having been completely initialized variable 'yr' used without having been completely initialized

and other similar ones, depending on the warp fractal algorithm being used.

test code: (compute shader in Unity)

pragma kernel CSMain

include "Assets/FastNoiseLite.cginc"

RWStructuredBuffer Result;

[numthreads(64,1,1)] void CSMain (uint3 id : SV_DispatchThreadID) { fnl_state noiseA = fnlCreateState(1212); fnl_state noise = fnlCreateState(1212); noise.fractal_type = 1; noiseA.fractal_type = 4;

float x = id.x % 256;
float y = id.x / 256;

fnlDomainWarp2D(noiseA, x, y);

float thisnoise = Remap(fnlGetNoise2D(noise,x, y), -1, 1, 0, 1);
Result[id.x] = float4(thisnoise, thisnoise, thisnoise, 1.0f);

}