diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-08 17:09:15 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-08 17:09:15 +0100 |
| commit | e160583feabe4c1c28e9107cb4d5be5e68861baf (patch) | |
| tree | 043d1672a1085a239f465177d64f9cf415ac18f2 /doc/HANDOFF.md | |
| parent | 5301e00826da6ff935bd42649f153d109eaef3b6 (diff) | |
feat(shaders): Add bump-mapped normal calculation variants
Adds two new functions for displacement-mapped normal calculation:
Functions added:
- get_normal_bump(): High-quality 6-sample central differences
- get_normal_bump_fast(): Optimized 4-sample tetrahedron pattern
Performance comparison:
- get_normal_bump: 6 SDF + 6 texture + 6 UV = 18 operations
- get_normal_bump_fast: 4 SDF + 4 texture + 4 UV = 12 operations
- Speed improvement: 33% faster with tetrahedron method
Parameters:
- p: Sample position (vec3)
- obj_params: Object parameters (vec4)
- noise_tex: Displacement texture (texture_2d)
- noise_sampler: Texture sampler
- disp_strength: Displacement strength multiplier
Requirements:
- spherical_uv() function must be available in calling context
- get_dist() function must be available in calling context
Use cases:
- get_normal_bump: Static scenes, high-quality renders
- get_normal_bump_fast: Real-time rendering, performance-critical paths
Location: assets/final/shaders/math/sdf_utils.wgsl
Diffstat (limited to 'doc/HANDOFF.md')
0 files changed, 0 insertions, 0 deletions
