View polykite-tiling-explorer.py
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
""" | |
Polykite Tiling Explorer | |
Author: OpenAI GPT-4 | |
Description: | |
This script explores the tiling properties of polykites, specifically those with 8 components. | |
It generates all possible polykites with 8 components, canonicalizes them to avoid duplicate | |
analysis, and then computes their isohedral numbers to identify interesting candidates for further | |
mathematical exploration. |
View docprompt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fix-app-icons.sh
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
#!/bin/bash | |
# http://superuser.com/a/1068709/55113 | |
for file in ~/.local/share/applications/*.desktop; do | |
CLASS="`grep '^StartupWMClass=' "$file" | cut -d= -f2`" | |
if [ -n "$CLASS" ] && ! grep -q xdotool "$file"; then | |
EXEC="`grep '^Exec=' "$file"`" | |
EXEC="$EXEC \\&\\& xdotool search --sync --classname $CLASS set_window --class $CLASS" | |
sed -i~ "s!^Exec=.*!$EXEC!" "$file" | |
fi | |
done |
View buddhabrot.wgsl
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
// 2022 David A Roberts <https://davidar.io/> | |
// https://www.jcgt.org/published/0009/03/02/ | |
// https://www.pcg-random.org/ | |
fn pcg(seed: ptr<function, uint>) -> float { | |
*seed = *seed * 747796405u + 2891336453u; | |
let word = ((*seed >> ((*seed >> 28u) + 4u)) ^ *seed) * 277803737u; | |
return float((word >> 22u) ^ word) / float(0xffffffffu); | |
} |
View demofox-path-tracing.wgsl
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
// Based on the path tracing tutorial series by demofox: | |
// https://blog.demofox.org/2020/05/25/casual-shadertoy-path-tracing-1-basic-camera-diffuse-emissive/ | |
let MINIMUM_RAY_HIT_TIME = .1; | |
let FAR_PLANE = 1e4; | |
let FOV_DEGREES = 90.; | |
let NUM_BOUNCES = 8; | |
let RAY_POS_NORMAL_NUDGE = .01; | |
let NUM_RENDERS_PER_FRAME = 100; | |
let EXPOSURE = .5; |
View caustics.wgsl
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
// 2022 David A Roberts <https://davidar.io/> | |
// https://www.shadertoy.com/view/4djSRW | |
fn hash44(p: float4) -> float4 { | |
var p4 = fract(p * float4(.1031, .1030, .0973, .1099)); | |
p4 = p4 + dot(p4, p4.wzxy+33.33); | |
return fract((p4.xxyz+p4.yzzw)*p4.zywx); | |
} | |
let dt = 1.; |
View assert.wgsl
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
fn isfinite(x: f32) -> bool { | |
return clamp(x, -3.4e38, 3.4e38) == x; | |
} | |
fn hash12(p: float2) -> float { | |
var p3 = fract(float3(p.xyx) * .1031); | |
p3 += dot(p3, p3.yzx + 33.33); | |
return fract((p3.x + p3.y) * p3.z); | |
} |
View pbrt.wgsl
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
/* Partial port of PBRT v3 <https://github.com/mmp/pbrt-v3> to WGSL. | |
BSD 2-Clause License | |
Copyright (c) 1998-2015, Matt Pharr, Greg Humphreys, and Wenzel Jakob | |
Copyright (c) 2022, David A Roberts <https://davidar.io/> | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
View importance-sampling.wgsl
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
fn pcg_random(seed: ptr<function, uint>) -> float { | |
*seed = *seed * 747796405u + 2891336453u; | |
let word = ((*seed >> ((*seed >> 28u) + 4u)) ^ *seed) * 277803737u; | |
return float((word >> 22u) ^ word) / float(0xffffffffu); | |
} | |
// weighted coin flip (bernoulli) | |
fn flip(state: ptr<function, uint>, p: float) -> bool { | |
return pcg_random(state) <= p; | |
} |
View LICENSE
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
MIT License | |
Copyright (c) 2013 Inigo Quilez <https://iquilezles.org/> | |
Copyright (c) 2013 Nikita Miropolskiy | |
Copyright (c) 2022 David A Roberts <https://davidar.io/> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
NewerOlder