-
vite-glsl: Using this Vite plugin to import local dependencies, or load inline shaders. Github Repo by Ustym Ukhman.
-
glslfy: Node module based, combined with babel-parse-glsl allows to inject shaders with dependencies declared on the package.json. Commonly used in three.js & react-three-fiber. Github Repo part of the Stack.gl project.
-
glslify-loader: glslify loader module for webpack. Commonly used with React-based frameworks like Next.js. Github Repo.
-
html script: via scrip tag with x-script attribute. Common among old three.js articles. Demo: Minimal three.js shader example by Kyle McDonald.
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
from dotenv import load_dotenv | |
import os | |
from array import array | |
from PIL import Image, ImageDraw | |
import sys | |
import time | |
from matplotlib import pyplot as plt | |
import numpy as np | |
# import namespaces |
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
import { Plane } from '@react-three/drei'; | |
import { useMemo } from 'react'; | |
export const Border = () => { | |
const uniforms = useMemo( | |
() => ({ | |
u_color: { | |
value: [0.129, 0.129, 0.129] //same color as my background | |
}, | |
u_outline_color: { |
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
import bpy | |
# Function to check if OptiX is available | |
def is_optix_available(): | |
prefs = bpy.context.preferences | |
cprefs = prefs.addons['cycles'].preferences | |
cprefs.get_devices() | |
for device in cprefs.devices: | |
if 'OPTIX' in device.type: | |
return True |
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
/* Numerics for Doyle spirals. | |
* Robin Houston, 2013 | |
*/ | |
(function() { | |
var pow = Math.pow, | |
sin = Math.sin, | |
cos = Math.cos, | |
pi = Math.PI; | |
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
/* Numerics for Doyle spirals. | |
* Robin Houston, 2013 | |
*/ | |
(function() { | |
var pow = Math.pow, | |
sin = Math.sin, | |
cos = Math.cos, | |
pi = Math.PI; | |
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
/* Numerics for Doyle spirals. | |
* Robin Houston, 2013 | |
*/ | |
(function() { | |
var pow = Math.pow, | |
sin = Math.sin, | |
cos = Math.cos, | |
pi = Math.PI; | |
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
import { OrbitControls, useFBO } from "@react-three/drei"; | |
import { Canvas, useFrame } from "@react-three/fiber"; | |
import { useMemo, useRef } from "react"; | |
import * as THREE from "three"; | |
import { v4 as uuidv4 } from "uuid"; | |
import "./scene.css"; | |
import vertexShader from "./vertexShader"; | |
import fragmentShader from "./fragmentShader"; |
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
// NOTE: This expects a few things to be stored in a .env file: | |
// FBKEY=xxxxxxxxx | |
// FIGMAPERSONALTOKEN=xxxxxxxxxxx | |
// GOOGLE_APPLICATION_CREDENTIALS=/users/your.name/googlekeys/firebase-storage.json | |
const axios = require('axios'); | |
const dotenv = require('dotenv'); | |
const Storage = require('@google-cloud/storage'); |
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
{"glyphs":{"0":{"ha":897,"x_min":0,"x_max":0,"o":"m 449 -17 b 78 505 215 -16 78 174 b 449 1024 79 834 217 1024 b 819 505 680 1024 819 833 b 449 -17 819 174 682 -17 m 449 115 b 667 505 585 115 667 252 b 449 895 667 756 584 895 b 230 505 313 895 230 756 b 449 115 230 252 312 115 "},"1":{"ha":656,"x_min":0,"x_max":0,"o":"m 480 0 l 327 0 l 327 857 l 322 857 l 80 699 l 80 845 l 332 1010 l 480 1010 "},"2":{"ha":852,"x_min":0,"x_max":0,"o":"m 97 110 l 439 465 b 601 733 547 580 601 644 b 420 897 601 834 523 897 b 242 717 311 897 241 826 l 96 717 b 423 1024 96 902 234 1024 b 746 737 614 1024 746 900 b 508 348 746 624 693 535 l 307 138 l 307 131 l 762 131 l 762 0 l 97 0 "},"3":{"ha":895,"x_min":0,"x_max":0,"o":"m 449 -14 b 92 263 245 -14 99 99 l 247 263 b 448 117 253 174 338 117 b 652 282 567 117 652 184 b 431 455 652 384 571 455 l 346 455 l 346 579 l 431 579 b 621 741 543 579 621 643 b 451 897 621 834 554 897 b 261 748 352 897 264 840 l 113 748 b 453 1024 118 912 267 1024 b 768 749 647 1024 769 897 b 595 525 769 635 7 |
NewerOlder