FunTechInc/use-shader-fx

White Paper for v2

takuma-hmng8 opened this issue · 0 comments

Material

FxMaterial , FxBasicFxMaterial , FxSamplingFxMaterial

BasicFx

Color correction and basic fx. like layer styles in photoshop

  • mixSrc
  • mixDst
  • duotone
  • vignette
  • grain
  • hsv
  • contrast
  • gamma
  • colorOverlay
  • gradationOverlay

SamplingFx

srcをsamplingすることが可能なmaterialに適用されるfx

  • rgbShift
  • pixelate
  • edge

Hooks

const {render,setValues,texture,material,scene,camera,renderTarget} = useSomeFx({size,dpr,...HooksProps,...FxValues,...BasicFxValues});

FXs

  • useBlur
  • useTexture | useSamplingFx | useFxTexture
  • useFluid
  • useNoise
  • useBloom
  • useBrush
  • useRipple
  • useCloth
  • useRawBlank
  • useBlank

Concept

  • Mutable objects such as scenes and materials should be non-reactive.
  • The fboAutoSetSize should be optional, as the resolution is updated to reactive but the render result is reset when renderTarget is setSize.

Materials

  • createMaterialImpl

And the Material of almost all hooks is also exported

import {  NoiseMaterial } from "@funtech-inc/use-shader-fx";
import { extend } from "@react-three/fiber";

extend({ NoiseMaterial });

~~~
<mesh>
 <planeGeometry args={[2, 2]} />
 <noiseMaterial ref={ref} scale={0.01} />
</mesh>