OpenGLat GAMEDEV
OpenGL - 暇つぶし2ch588:名前は開発中のものです。
23/02/21 20:05:43.11 uv3S8T1o.net
ChatGPTでglsl作成成功した人いる?
何度修正させても表示できん、、
shadertoyで表示させようとしてるんだけど
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// 画面の解像度を取得
vec2 resolution = iResolution.xy;
// 中心座標を計算
vec2 center = resolution * 0.5;
// 角丸四角形の描画
vec2 p = fragCoord.xy / resolution.xy;
float radius = 0.2;
float aspect = resolution.x / resolution.y;
vec2 size = vec2(aspect, 1.0);
float d = length(max(abs(p - 0.5 * size) - size * radius, 0.0));
float edgeWidth = resolution.y * 0.01;
float edge = smoothstep(0.0, edgeWidth, d);
vec3 color = vec3(edge);
// 上下に移動する速度を調整
float speed = 2.0;
float time = iTime * speed;
// バンドパターンを作成
float band = smoothstep(0.0, 1.0, abs(fragCoord.y + time - resolution.y * 0.5) / (resolution.y * 0.5));
// 色をバンドパターンでマスク
color *= band;
fragColor = vec4(color, 1.0);
}

589:名前は開発中のものです。
23/11/09 15:09:29.90 VPA6u9+2.net
てす

590:名前は開発中のものです。
24/02/03 19:44:35.40 r4LXJSb0.net
てすや


最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch