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 taichi as ti | |
ti.init(arch=ti.gpu) | |
res = 256 | |
fbm_octaves = 8 | |
warp_freq = 8.0 | |
noise_mag = 2.0 | |
start_freq = 4.0 | |
noise_h = 0.7 |
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 taichi as ti | |
ti.init(ti.gpu) | |
res = 512 | |
pixels = ti.field(ti.f32, (res, res)) | |
@ti.func | |
def fract(x): | |
return x - ti.floor(x) |
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 taichi as ti | |
ti.init(ti.gpu) | |
res = 512 | |
pixels = ti.field(ti.f32, (res, res)) | |
@ti.func | |
def fract(x): | |
return x - ti.floor(x) |
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 taichi as ti | |
ti.init(arch=ti.gpu) | |
res = 512 | |
pixels = ti.field(dtype=float, shape=(res, res)) | |
@ti.kernel | |
def gradient(): | |
for i, j in pixels: |
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 time import time | |
import math | |
import taichi as ti | |
import taichi_glsl as ts | |
from PIL import Image | |
import numpy as np | |
ti.init(arch=ti.cuda, kernel_profiler=True) | |
res = 512 |
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
# TressFX with taichi | |
# author: info@ma-yidong.com | |
# some code adopted from https://github.com/lyd405121/OpenClothPy | |
import taichi as ti | |
ti.init(arch=ti.gpu, kernel_profiler=True) | |
steps = 1 | |
# strand params |
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 taichi as ti | |
import numpy as np | |
import math | |
import time | |
ti.init(arch=ti.cpu) | |
screen_res = (512, 512) | |
# grey-scott paramters | |
d_a = 1 | |
d_b = 0.25 |