Shader Image

Paul Henschel’s scroll-velocity vertex bend and RGB-channel split, extracted as a texture plane that accepts your own scroll ref.

Exact preview of Shader Image
Type
Component
Category
WebGL
Source license
MIT
Collection
Open Source Experiences

View source in the repository

Usage

// Place this example in vendor/experiences/substance/src/example.jsx.
// Use that project's isolated dependencies and Vite setup (see its README).
// Rebuild the included native runtimes with: npm run build:experiences

import { useRef, Suspense } from 'react';
import { Canvas, useLoader } from '@react-three/fiber';
import { TextureLoader } from 'three';
import { ShaderImage } from './parts/ShaderImage';
import { ScrollSceneProvider } from './parts/ParallaxBlock';

function Picture({ scroll }) {
  const map = useLoader(TextureLoader, '/your-image.jpg');
  return <ShaderImage map={map} args={[1, 1, 32, 32]} scale={[6, 4, 1]} shift={75} scrollRef={scroll} pages={2} />;
}
export function DistortedImage() {
  const scroll = useRef(0);
  return <div onWheel={event => { scroll.current += event.deltaY; }} style={{ height: 500 }}>
    <Canvas orthographic camera={{ zoom: 75, position: [0, 0, 20] }}>
      <Suspense fallback={null}><ScrollSceneProvider scrollRef={scroll} pages={2} sections={2}>
        <Picture scroll={scroll} />
      </ScrollSceneProvider></Suspense>
    </Canvas>
  </div>;
}

License and credits

The Substance by Paul Henschel. Original upstream source

Read the original MIT license

Credits and asset notices

Third-party assets and dependencies

Diamond by RBG_illustrations (https://sketchfab.com/StarkIndustries), CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Source: https://sketchfab.com/3d-models/diamond-7acd98d5c8df4e04a73ea5d5a81c8911. Original GLB retained; centered/scaled in runtime.

Photo credits: Barry Marsh (field-01/02), author-released public domain; Cornettesax (field-03), Kleseus (field-04), NonNerd (field-05), CC0. Source and license links: /experiences/substance/photo-credits.json.

Helvetiker Bold copyright 2004 MAGENTA Ltd.; full permissive font notice included at /experiences/substance/FONT-LICENSE.txt. Original MOONGET font and unclear photographs omitted.

Keep the original source and media notices with your copy.

Explore more

  • Liquid FormExact preview of Liquid Form

    A centered silver ray-marched liquid form with authored studio reflections and pointer-responsive camera drift.

  • Boarding PassExact preview of Boarding Pass

    A live flight pass whose changed gate and times roll over like a departures board.

  • Aurora TextExact preview of Aurora Text

    Multi-colour aurora motion within a large type specimen.

Frontfield homepage