Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ee60ed1
feat: add image liquid metal shader
itsdouges Sep 16, 2025
0f568e5
feat: add image shader
itsdouges Sep 16, 2025
dc824ea
feat: optional props
itsdouges Sep 16, 2025
d6e1f8f
chore: remove
itsdouges Sep 16, 2025
f6b0258
fix: time
itsdouges Sep 16, 2025
e6b9e9d
fix: use image shader preset
itsdouges Sep 17, 2025
f78c2c7
Merge remote-tracking branch 'origin/main' into port-liquid-metal
uuuulala Sep 24, 2025
fa1e55f
docs: image liquid metal docs, wip
verekia Sep 25, 2025
e625a99
docs: tweak image liquid metal value ranges
verekia Sep 25, 2025
2b07f23
Merge branch 'main' into port-liquid-metal
verekia Sep 26, 2025
ee4e3f8
docs: update image liquid metal to always use an image, cleanups
verekia Sep 26, 2025
c8fd16d
homepage sections (temporary, there must be a better way :D)
uuuulala Sep 27, 2025
6728589
align logo shader with LiquidMetal
uuuulala Sep 27, 2025
d1d9c83
Port liquid metal extended (#191)
uuuulala Sep 27, 2025
6845b5a
Port liquid metal extended
uuuulala Sep 27, 2025
de22114
homepage: image shaders on top fix margins
uuuulala Sep 27, 2025
e3172a8
Merge remote-tracking branch 'origin/port-liquid-metal' into port-liq…
uuuulala Sep 27, 2025
84627ed
homepage: image shaders on top fix margins
uuuulala Sep 27, 2025
ba910a5
animation speed matching logo website
uuuulala Sep 27, 2025
aa9a5f2
docs: hide suspendWhenProcessingImage on image-liquid-metal
verekia Sep 30, 2025
cc4ee2f
docs: fix heatmap and metal thumbnails by adding name in cache key
verekia Sep 30, 2025
efec2a4
docs: use diamond.webp in code sample of image liquid metal shader
verekia Sep 30, 2025
93f4ce4
docs: black background on the metal logo page
verekia Sep 30, 2025
de13f53
docs: homepage categories
verekia Sep 30, 2025
f3b8106
docs: fix image liquid metal colorBack when resetting to default
verekia Sep 30, 2025
86efc6d
edge off
uuuulala Oct 1, 2025
7fa1685
normal sampling + edge power to glsl + testing setup
uuuulala Oct 2, 2025
bba0f66
temporary background transparency via glsl (to check why can't set wi…
uuuulala Oct 2, 2025
0b94540
LM testing demo to share
uuuulala Oct 2, 2025
4ffe978
hiding defs to fix the build
uuuulala Oct 2, 2025
b8dde43
roundness added
uuuulala Oct 2, 2025
613aead
contourPower added
uuuulala Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/public/images/image-filters/apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/public/images/image-filters/paper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/shaders/image-liquid-metal.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/src/app/(shaders)/image-liquid-metal/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Metadata } from 'next';

export const metadata: Metadata = {
title: 'Liquid Metal Filter • Paper',
};

export default function Layout({ children }: { children: React.ReactNode }) {
return <>{children}</>;
}
77 changes: 77 additions & 0 deletions docs/src/app/(shaders)/image-liquid-metal/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
'use client';

import { ImageLiquidMetal, imageLiquidMetalPresets } from '@paper-design/shaders-react';
import { useControls, button, folder } from 'leva';
import { setParamsSafe, useResetLevaParams } from '@/helpers/use-reset-leva-params';
import { usePresetHighlight } from '@/helpers/use-preset-highlight';
import { cleanUpLevaParams } from '@/helpers/clean-up-leva-params';
import { ShaderFit } from '@paper-design/shaders';
import { levaImageButton } from '@/helpers/leva-image-button';
import { useState, Suspense } from 'react';
import { ShaderDetails } from '@/components/shader-details';
import { ShaderContainer } from '@/components/shader-container';
import { useUrlParams } from '@/helpers/use-url-params';
import { imageLiquidMetalDef } from '@/shader-defs/image-liquid-metal-def';
import { toHsla } from '@/helpers/color-utils';

// Override just for the docs, we keep it transparent in the preset
// imageLiquidMetalPresets[0].params.colorBack = '#000000';

const { worldWidth, worldHeight, ...defaults } = imageLiquidMetalPresets[0].params;

const ImageLiquidMetalWithControls = () => {
const [image, setImage] = useState<HTMLImageElement | string>('/images/image-filters/paper.svg');

const [params, setParams] = useControls(() => {
const presets = Object.fromEntries(
imageLiquidMetalPresets.map(({ name, params: { worldWidth, worldHeight, ...preset } }) => [
name,
button(() => setParamsSafe(params, setParams, preset)),
])
);
return {
colorBack: { value: toHsla(defaults.colorBack), order: 100 },
// colorTint: { value: toHsla(defaults.colorTint), order: 101 },
// repetition: { value: defaults.repetition, min: 1, max: 10, order: 200 },
// softness: { value: defaults.softness, min: 0, max: 1, order: 201 },
// shiftRed: { value: defaults.shiftRed, min: -1, max: 1, order: 202 },
// shiftBlue: { value: defaults.shiftBlue, min: -1, max: 1, order: 203 },
// distortion: { value: defaults.distortion, min: 0, max: 1, order: 204 },
useOriginalAlpha: { value: defaults.useOriginalAlpha, min: 0, max: 1, step: 1, order: 204 },
contourRoundness: { value: defaults.contourRoundness, min: 0, max: 1, order: 205 },
contourSoftness: { value: defaults.contourSoftness, min: 0, max: 1, order: 206 },
contourPower: { value: defaults.contourPower, min: 1, max: 3, order: 206 },
edgePower: { value: defaults.edgePower, min: 0, max: 4, order: 207 },
speed: { value: defaults.speed, min: 0, max: 4, order: 300 },
scale: { value: defaults.scale, min: 0.01, max: 4, order: 301 },
rotation: { value: defaults.rotation, min: 0, max: 360, order: 302 },
offsetX: { value: defaults.offsetX, min: -1, max: 1, order: 303 },
offsetY: { value: defaults.offsetY, min: -1, max: 1, order: 304 },
// fit: { value: defaults.fit, options: ['contain', 'cover'] as ShaderFit[], order: 305 },
Image: folder({
'Upload image': levaImageButton((img?: HTMLImageElement) => setImage(img ?? '')),
}),
Presets: folder(presets, { order: -1 }),
};
});

// Reset to defaults on mount, so that Leva doesn't show values from other
// shaders when navigating (if two shaders have a color1 param for example)
useResetLevaParams(params, setParams, defaults);
useUrlParams(params, setParams, imageLiquidMetalDef);
usePresetHighlight(imageLiquidMetalPresets, params);
cleanUpLevaParams(params);

return (
<>
<ShaderContainer shaderDef={imageLiquidMetalDef} currentParams={params}>
<Suspense fallback={null}>
<ImageLiquidMetal {...params} image={image} suspendWhenProcessingImage />
</Suspense>
</ShaderContainer>
<ShaderDetails shaderDef={imageLiquidMetalDef} currentParams={params} codeSampleImageName="diamond.webp" />
</>
);
};

export default ImageLiquidMetalWithControls;
Loading