Files
2026-05-27 23:29:53 +01:00

1.9 KiB

OpenSpec Change: enterprise-gaming-r3f-shaders

  • Change ID: enterprise-gaming-r3f-shaders
  • Package: @suaveplan/r3f-shaders
  • Category: gaming/effects
  • Target path: gaming/effects/r3f-shaders
  • Status: PROPOSED
  • Date: 2026-04-24

Summary

Deliver @suaveplan/r3f-shaders on the genesis branch from scratch at enterprise quality. The package provides a library of custom shader effects and materials for React Three Fiber: hologram, dissolve, outline, rim-light, toon, heat-distortion, and x-ray materials; GLSL utility functions (noise, rotation, gamma correction); a ShaderMaterial factory with hot-reload support in dev mode. Each shader is a typed React component that accepts uniform props. Genesis adds structured errors, and 100% coverage.


Available workspace deps

@suaveplan/error, react, @react-three/fiber, @react-three/drei, three.


Public API surface

function HologramMaterial(props: HologramMaterialProps): JSX.Element
function DissolveMaterial(props: DissolveMaterialProps): JSX.Element
function OutlineMaterial(props: OutlineMaterialProps): JSX.Element
function ToonMaterial(props: ToonMaterialProps): JSX.Element
function RimLightMaterial(props: RimLightMaterialProps): JSX.Element

function createShaderMaterial(vert: string, frag: string, uniforms?: Record<string, unknown>): THREE.ShaderMaterial

File layout

gaming/effects/r3f-shaders/
  package.json / tsconfig.json / vitest.config.ts
  src/
    index.ts
    types/common.ts + md
    glsl/
      noise.glsl.ts
      utils.glsl.ts
    materials/
      hologram/ (tsx + md + test + stories + index)
      dissolve/ (tsx + md + test + stories + index)
      outline/ (tsx + md + test + stories + index)
      toon/ (tsx + md + test + stories + index)
      rim-light/ (tsx + md + test + stories + index)
    utils/
      shader-material-factory.ts + md + test
  tests/integration.test.ts