-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5be10e
commit 6c34351
Showing
21 changed files
with
1,241 additions
and
282 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { FragmentShader } from "react-shader-fiber"; | ||
import circle from "../../lygia/draw/circle.glsl"; | ||
import { | ||
Assign, | ||
Call, | ||
Float, | ||
Input, | ||
Main, | ||
Output, | ||
Vec4, | ||
} from "@react-shader-fiber/stdlib"; | ||
import { useRef } from "react"; | ||
|
||
const Circle = () => { | ||
const fragColorRef = useRef(); | ||
const vCoordsRef = useRef(); | ||
|
||
return ( | ||
<FragmentShader prelude={[circle]}> | ||
<Output type={"vec4"} id={"fragColor"} ref={fragColorRef} /> | ||
|
||
<Input ref={vCoordsRef} type={"vec2"} id={"vCoords"} /> | ||
|
||
<Main> | ||
<Assign to={fragColorRef}> | ||
<Vec4 | ||
x={0} | ||
y={0} | ||
z={ | ||
<Call fn={"circle"} type={"float"}> | ||
{vCoordsRef} | ||
<Float value={0.5} /> | ||
</Call> | ||
} | ||
w={1} | ||
/> | ||
</Assign> | ||
</Main> | ||
</FragmentShader> | ||
); | ||
}; | ||
|
||
export default Circle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { FragmentShader } from "react-shader-fiber"; | ||
import circle from "../../lygia/draw/circle.glsl"; | ||
import { Assign, Input, Main, Output, Vec4 } from "@react-shader-fiber/stdlib"; | ||
import { useRef } from "react"; | ||
|
||
const Gradient = () => { | ||
const fragColorRef = useRef(); | ||
const vCoordsRef = useRef(); | ||
|
||
return ( | ||
<FragmentShader prelude={[circle]}> | ||
<Output type={"vec4"} id={"fragColor"} ref={fragColorRef} /> | ||
|
||
<Input ref={vCoordsRef} type={"vec2"} id={"vCoords"} /> | ||
|
||
<Main> | ||
<Assign to={fragColorRef}> | ||
<Vec4 x={0} y={0} z={0} w={1} /> | ||
</Assign> | ||
</Main> | ||
</FragmentShader> | ||
); | ||
}; | ||
|
||
export default Gradient; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.jsx' | ||
import './index.css' | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App.jsx"; | ||
import "@fontsource/inter"; | ||
import { CssBaseline, CssVarsProvider } from "@mui/joy"; | ||
|
||
ReactDOM.createRoot(document.getElementById('root')).render( | ||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<React.StrictMode> | ||
<App /> | ||
<CssVarsProvider> | ||
<CssBaseline /> | ||
<App /> | ||
</CssVarsProvider> | ||
</React.StrictMode>, | ||
) | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import FragColor from "./FragColor.tsx"; | ||
import VCoords from "./VCoords.tsx"; | ||
import X from "./X.tsx"; | ||
|
||
export { FragColor, VCoords, X }; | ||
export { FragColor, VCoords }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $w } from "@thi.ng/shader-ast"; | ||
import { Vec } from "../lit/Vec.tsx"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec | ReactElement[] | ReactElement; | ||
}> | ||
>(function W({ of }, ref) { | ||
return <Base ref={ref} gen={$w} args={[of]} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $x } from "@thi.ng/shader-ast"; | ||
import { Vec } from "../lit/Vec.tsx"; | ||
import normalizeVectorValue from "../../utils/normalizeVectorValue.ts"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec | ReactElement[] | ReactElement; | ||
}> | ||
>(function X({ of }, ref) { | ||
return <Base ref={ref} gen={$x} args={[normalizeVectorValue(of)]} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $xy } from "@thi.ng/shader-ast"; | ||
import { Vec2 } from "../lit/Vec2.tsx"; | ||
import { Vec3 } from "../lit/Vec3.tsx"; | ||
import { Vec4 } from "../lit/Vec4.tsx"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec2 | Vec3 | Vec4 | ReactElement[] | ReactElement; | ||
}> | ||
>(function XY({ of }, ref) { | ||
return <Base ref={ref} gen={$xy} args={[of]} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $xyz } from "@thi.ng/shader-ast"; | ||
import { Vec3 } from "../lit/Vec3.tsx"; | ||
import { Vec4 } from "../lit/Vec4.tsx"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec3 | Vec4 | ReactElement[] | ReactElement; | ||
}> | ||
>(function XYZ({ of }, ref) { | ||
return <Base ref={ref} gen={$xyz} args={[of]} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $y } from "@thi.ng/shader-ast"; | ||
import { Vec } from "../lit/Vec.tsx"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec | ReactElement[] | ReactElement; | ||
}> | ||
>(function Y({ of }, ref) { | ||
return <Base ref={ref} gen={$y} args={[of]} />; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Base from "../glsl/Base.tsx"; | ||
import { FC, forwardRef, PropsWithChildren, ReactElement } from "react"; | ||
import { $z } from "@thi.ng/shader-ast"; | ||
import { Vec4 } from "../lit/Vec4.tsx"; | ||
import { Vec3 } from "../lit/Vec3.tsx"; | ||
|
||
export default forwardRef< | ||
FC, | ||
PropsWithChildren<{ | ||
of: Vec3 | Vec4 | ReactElement | ReactElement[]; | ||
}> | ||
>(function Z({ of }, ref) { | ||
return <Base ref={ref} gen={$z} args={[of]} />; | ||
}); |
Oops, something went wrong.