更新: | 2024-05-20 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
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 is Twigl's "geekest mode" so the code runs inside a "main" function. | |
// FC.xy is fragcoord | |
// r.xy is resolution | |
// t is time (in seconds I think) | |
// o.rgba is output color | |
// This is the original code, before any readability improvements: | |
/* | |
#define X(S,D)I=ivec3(S);D=fract(float(I.x^I.y^I.z)*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
// @zozuar さんのシェーダーが凄すぎたのでコードリーディング | |
// https://twitter.com/zozuar/status/1441384708441456651 | |
float i, // レイマーチングのループカウンター | |
e, // ボリュームの密度(値が小さいほど密度が濃くなる) | |
s, // fbmのループカウンター | |
g, // レイの進んだ距離(カメラのパースのためにも利用) | |
k = .01;// 0.01の定数 | |
// レイマーチングのループ |