-
Notifications
You must be signed in to change notification settings - Fork 50
[DRAFT] Tartan #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[DRAFT] Tartan #133
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is cool! Thanks for submitting new shaders. We may adapt these or merge some as-is, but just wanted to let you know I don't know exactly when we will focus on that yet. It's great to see new ideas coming in though. |
@StephenHaney No worries, I completely understand. I've been using this as an opportunity to learn shaders more than anything. |
I've rebased this PR onto Some of the changes I've made to the Leva controls might be worth pulling out into their own PR and applying across the board:
Let me know if there's interest in applying any of these changes to the other shaders in the docs app and I'll get a PR together. |
Changes
Adds a new tartan shader.
The pattern adheres to the typical traditional tartan patterns where the "sett" is repeated in reverse and both the "warp" and the "weft" are the same. This is to say, the pattern is symmetrical both horizontally and vertically. See the Wikipedia article for details.
Work still to be done
uniform mat3 u_stripeWidths
withuniform float[9] u_stripeWidths
? This appears to be a limitation ofShaderMount
.colors
indocs/src/app/tartan/page.tsx
. These have been added because the return type of Leva'suseControls
appears to be typed incorrectly.Pixelation issues
The current sizing prevents the pattern from being aligned with the pixel grid (see images below). Two options to explore:
Shadertoy (using
vec2 uv = (fragCoord.xy - iResolution.xy * 0.5)
):Paper shaders (using
vec2 uv = v_patternUV * 100.0
):