cultmath: regenerate CultMath.glsl and glsl-parity.json (four band families appended)
Generated by CULTMATH_WRITE_GLSL=1 on Yggdrasil (dotnet/sdk:10.0) at 5ccbb094; the fixture
diff is additions only, every earlier family byte-identical. Builds.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ccbb09487
commit
369e5793a7
2 changed files with 1071 additions and 5 deletions
|
|
@ -877,7 +877,8 @@ vec4 cultmath_af_frustum_ball(vec2 centreSlope, float z0, float z1, float footpr
|
|||
// mirror. They follow the includes because the bounds read CULTMATH_SNOISE_LIPSCHITZ, _HESSIAN and _THIRD.
|
||||
// A shader caller builds a SpanStage itself (SpanStage(1.0, 1.0, vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0))
|
||||
// is the identity of math.SpanStage.Identity, which has no shader form); see math.span_stage's comments for
|
||||
// the span, the transform, the bounds and the allowances.
|
||||
// the span, the transform, the bounds and the allowances. cultmath_span_rounding and cultmath_span_slack
|
||||
// are math.span_rounding and math.span_slack, the owners of S_o and of the three allowances.
|
||||
struct SpanPath
|
||||
{
|
||||
vec3 midpoint;
|
||||
|
|
@ -904,6 +905,18 @@ struct SpanNoise
|
|||
float fold;
|
||||
};
|
||||
|
||||
float cultmath_span_rounding(float scale, vec3 mq, SpanStage stage, vec3 octaveShift, float nu, float halfLength)
|
||||
{
|
||||
return 9.5367431640625e-7 * (abs(scale) * (cultmath_csum(abs(mq)) + cultmath_csum(abs(stage.shift))) + cultmath_csum(abs(stage.offset)) + cultmath_csum(abs(octaveShift)) + 1.7320508 * nu * halfLength);
|
||||
}
|
||||
|
||||
vec3 cultmath_span_slack(float rounding)
|
||||
{
|
||||
return vec3(6.103515625e-5 + CULTMATH_SNOISE_LIPSCHITZ * rounding,
|
||||
2.44140625e-4 + CULTMATH_SNOISE_HESSIAN * rounding,
|
||||
9.765625e-4 + CULTMATH_SNOISE_THIRD * rounding);
|
||||
}
|
||||
|
||||
// The octave stage behind cultmath_span_fbm and cultmath_span_ridged, as math.span_stage is behind span_fbm
|
||||
// and span_ridged. The Frobenius norm of the Hessian is written out in C#'s order (GLSL has no _mRC member
|
||||
// access); the C# local named step is octaveShift here (it would shadow GLSL's step()).
|
||||
|
|
@ -946,10 +959,11 @@ SpanNoise cultmath_span_stage(bool ridged, SpanPath path, SpanStage stage, int o
|
|||
float weight = abs(amplitude);
|
||||
float factor = abs(scale) * norm;
|
||||
float nu = factor * path.speed;
|
||||
float rounding = 9.5367431640625e-7 * (abs(scale) * (cultmath_csum(abs(mq)) + cultmath_csum(abs(stage.shift))) + cultmath_csum(abs(stage.offset)) + cultmath_csum(abs(octaveShift)) + 1.7320508 * nu * halfLength);
|
||||
float valueSlack = 6.103515625e-5 + CULTMATH_SNOISE_LIPSCHITZ * rounding;
|
||||
float gradientSlack = 2.44140625e-4 + CULTMATH_SNOISE_HESSIAN * rounding;
|
||||
float hessianSlack = 9.765625e-4 + CULTMATH_SNOISE_THIRD * rounding;
|
||||
float rounding = cultmath_span_rounding(scale, mq, stage, octaveShift, nu, halfLength);
|
||||
vec3 slack = cultmath_span_slack(rounding);
|
||||
float valueSlack = slack.x;
|
||||
float gradientSlack = slack.y;
|
||||
float hessianSlack = slack.z;
|
||||
mat3 hm = cultmath_snoise_hessian(x);
|
||||
float frobenius = sqrt(hm[0][0] * hm[0][0] + hm[0][1] * hm[0][1] + hm[0][2] * hm[0][2] + hm[1][0] * hm[1][0] + hm[1][1] * hm[1][1] + hm[1][2] * hm[1][2]
|
||||
+ hm[2][0] * hm[2][0] + hm[2][1] * hm[2][1] + hm[2][2] * hm[2][2]);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue