..using CustomShaderMaterial. Thrown together in typescript.
- Working version leaning heavily on https://github.com/bgolus/Normal-Mapping-for-a-Triplanar-Shader/blob/master/TriplanarUDN.shader
- Supports diffuse, normal, roughness maps for now
- clones a PBR THREE.MeshStandardMaterial
createTriplanarMaterial()
returns a triplanar material, checklib/triplanarMaterial.ts
for parametersyarn install
andyarn dev
to view test react-three-fiber scene (Scene.tsx
)
ToDo:
- World Space shader
- Extend to emissive, metalness etc
- Remove unnecessary samples when not all axes have separate textures supplied - use textureX on Y, Z
- different blend options (only YZ, for example)
- Clean up and separate material return function from test scene
- list as package?
Lots of info gleaned from
cheers!