| Filename | Latest commit message | Latest commit date |
|---|---|---|
Each edit is legal HLSL that computes the same bits, and closes one dialect gap the GLSL lowering would otherwise have to special-case: - snoise and snoise_grad: step(h, 0.0) -> step(h, float4(0.0, 0.0, 0.0, 0.0)); GLSL has no step(genType, float). - pcg: (state >> 28) + 4 -> + 4u; GLSL has no implicit int -> uint. - cellular and phacelle jitter, cellular id: (float)((uint)hash.x >> 8) before the float multiply; GLSL has no implicit uint -> float. - damp (float2/3/4): the scalar amount is splatted explicitly; GLSL has no lerp(vecN, vecN, float) promotion. - pcg3d(float3) is defined before pcg3d(float2), which calls it; GLSL needs a declaration before use. Both tracked copies; the C# mirror stays green, FXC cs_5_0 compiles both copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| .. | ||
| Runtime | ||
| Shaders | ||
| CHANGELOG.md | ||
| CHANGELOG.md.meta | ||
| LICENSE.md | ||
| LICENSE.md.meta | ||
| package.json | ||
| package.json.meta | ||
| README.md | ||
| README.md.meta | ||
| Runtime.meta | ||
| Shaders.meta | ||
| THIRD-PARTY-NOTICES.md | ||
| THIRD-PARTY-NOTICES.md.meta | ||
CultMath for Unity
This is CultMath's Unity 2021.3-compatible Git-UPM surface. It contains the
precompiled CultMath.dll, portable symbols, the numeric
Shaders/CultMath.hlsl mirror (with its CultMath.Phacelle.hlsl include), and the CultMath.UnityBridge assembly.
CultMath.UnityBridge is the only C# source Unity compiles here. It holds the
UnityEngine conversions the engine-free core cannot declare: ToCultMath() on
Vector2/3/4, Vector2Int/3Int, Quaternion, and Color; ToUnity() on
float2/3/4, int2/3, and quaternion; ToColor() on float4. C# only
admits conversion operators on the source or target type, so these are
extension methods rather than implicit casts. Import CultMath.UnityBridge to
use them.
Unity does not compile CultMath's repository source tree. That source uses the
current C# language and remains owned by the normal .NET project. The package
imports only the tracked auto-referenced precompiled assembly, so consumers do
not need csc.rsp language overrides or an asmdef propagation shim.
Build and inspect the package from the repository root:
.\scripts\build-unity-package.ps1
The builder fresh-builds CultMath for netstandard2.1, verifies the tracked
DLL/PDB and stable Unity metadata, and stages an inspectable package under
artifacts/unity/org.gamecult.cultmath.
Consume the repository package with:
"org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath"
Production consumers should pin that URL to a commit or release tag.