Skip to content

Commit

Permalink
docs: Volumetric Raymarching blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeHeckel committed Oct 31, 2023
1 parent ac0bfe0 commit 56aae25
Show file tree
Hide file tree
Showing 18 changed files with 4,868 additions and 7 deletions.
2 changes: 1 addition & 1 deletion content/framer-motion-layout-animations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ keywords:
]
slug: framer-motion-layout-animations
type: 'blogPost'
featured: true
featured: false
colorFeatured: 'linear-gradient(90deg,#2E83FF -10%,#EB7D9F 50%, #FFCBBE 100%)'
fontFeatured: '#E8E8FD'
---
Expand Down
898 changes: 898 additions & 0 deletions content/real-time-cloudscapes-with-volumetric-raymarching.mdx

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions core/components/BeforeAfterImage/BeforeAfterImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,25 @@ const BeforeAfterImage = (props: BeforeAfterImageProps) => {
onMouseMove={handleMouseMove}
onTouchMove={handleTouchMove}
style={{
width: width || '100%',
height: height || '100%',
// @ts-ignore
'--progress': `${wiggleMotion.get()}%`,
}}
>
<S.Image alt="Before" src={beforeSrc} />
<S.Image
alt="Before"
loading="eager"
src={beforeSrc}
width={width}
height={height}
/>
<S.Overlay>
<S.Image alt="After" src={afterSrc} />
<S.Image
alt="After"
loading="eager"
src={afterSrc}
width={width}
height={height}
/>
</S.Overlay>
<Slider />
</S.Wrapper>
Expand Down
7 changes: 7 additions & 0 deletions core/components/MDX/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
H3,
Strong,
} from '@maximeheckel/design-system';
import BeforeAfterImage from '@core/components/BeforeAfterImage';
import Callout from '@core/components/Callout';
import Code from '@core/components/Code';
import Fullbleed from '@core/components/Fullbleed';
Expand Down Expand Up @@ -185,6 +186,10 @@ const RaymarchingVisualizer = dynamic(
() => import('./Widgets/Raymarching/RaymarchingVisualizer')
);

const VolumetricRaymarchingVisualizer = dynamic(
() => import('./Widgets/Raymarching/VolumetricRaymarchingVisualizer')
);

const RefractionDispersionSandpack = dynamic(
() => import('./Widgets/RefractionDispersionReactThreeFiber/Sandpack')
);
Expand Down Expand Up @@ -257,6 +262,8 @@ const customComponents = {
DemoSearch,
DemoButton,
RaymarchingVisualizer,
VolumetricRaymarchingVisualizer,
BeforeAfterImage,
// Sandpacks
CSSCompositionSandpack,
ScrollSpySandpack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const fakeSphereSDF = (_x: number, _y: number, step: number) => {

const SIZE = 17;
const MAX_STEP = 13;
const FragmentShaderVisualizer = () => {

const RaymarchingVisualizer = () => {
const [step, setStep] = useState(0);

const emptyMatrix = useMemo(
Expand Down Expand Up @@ -811,4 +812,4 @@ const Diagram = (props: { step: number }) => {
);
};

export default FragmentShaderVisualizer;
export default RaymarchingVisualizer;
18 changes: 18 additions & 0 deletions core/components/MDX/Widgets/Raymarching/Sandpack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ import InfinitySpheres from './infinitySpheres';
import MengerFractal from './mengerFractal';
import NoiseDerivatives from './noiseDerivatives';
import MartianLandscape from './martianLandscape';
import VolumetricRaymarching from './volumetric';
import VolumetricRaymarchingWithFBM from './volumetricNoise';
import DirectionalDerivative from './directionalDerivative';
import MorphingCloud from './morphingCloud';
import BlueNoiseDithering from './bluenoiseDithering';
import BicubicFiltering from './bicubicFiltering';
import BeersLaw from './beersLaw';
import LightTransmittance from './lightTransmittance';
import Phase from './phase';

const CSSCode = `
html {
Expand Down Expand Up @@ -46,6 +55,15 @@ const RenderTargetsSandpack = (props: any) => {
scene8: MengerFractal,
scene9: NoiseDerivatives,
scene10: MartianLandscape,
scene11: VolumetricRaymarching,
scene12: VolumetricRaymarchingWithFBM,
scene13: DirectionalDerivative,
scene14: MorphingCloud,
scene15: BlueNoiseDithering,
scene16: BicubicFiltering,
scene17: BeersLaw,
scene18: LightTransmittance,
scene19: Phase,
};

return (
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './VolumetricRaymarchibgVisualizer';
Loading

0 comments on commit 56aae25

Please sign in to comment.