Move CultMath into the CultLib monorepo
This commit is contained in:
commit
ea88cfcd05
98 changed files with 3574 additions and 4 deletions
29
packages/cultmath/docs/design.md
Normal file
29
packages/cultmath/docs/design.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Design
|
||||
|
||||
CultMath exists to make renderer math readable in every place it needs to live:
|
||||
Rust hot kernels, C# host code, and HLSL shader code.
|
||||
|
||||
## Rules
|
||||
|
||||
- Keep type names HLSL-shaped: `float2`, `float3`, `float4`, and `math`.
|
||||
- Keep Rust as the owner of native hot-path kernels and parity fixtures.
|
||||
- Keep C#, shader, and scripting surfaces as runtime wrappers, not competing
|
||||
math authorities.
|
||||
- Keep `shaders/CultMath.hlsl` as the canonical shader mirror for shared
|
||||
intrinsics. Project-local shader helpers should move here once more than one
|
||||
organ needs them or once CPU/GPU parity matters.
|
||||
- Implement public shader semantics directly; do not copy Unity.Mathematics.
|
||||
- Prefer small immutable value types.
|
||||
- Prefer component-wise overloads over clever generic machinery until the API
|
||||
earns that complexity.
|
||||
- Keep the surface boring and exact. Noise primitives are allowed when they are
|
||||
source-grounded, shader-shaped, and shared by more than one project. Matrices,
|
||||
quaternions, and packing helpers still need an owner before they enter.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Compiling C# to shaders.
|
||||
- Generating HLSL from Rust or Rust from HLSL.
|
||||
- Replacing `System.Numerics` for general .NET work.
|
||||
- Recreating every Unity.Mathematics type because a spreadsheet somewhere says
|
||||
“coverage.” That way lies decorative obesity.
|
||||
7
packages/cultmath/docs/design.md.meta
Normal file
7
packages/cultmath/docs/design.md.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 07021a8be816e3448a9490c10845b0aa
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue