AI帮我忙之webgpu实时路径追踪

最近体验了VIBE CODING

做了个webgpu的仿cycles的demo

pingpong + bvh + software pathtracing + textureArray< atlas > 非常有趣(:

并且经过验证 AI可以直接写wgsl shader

clike 复制代码
const rayAABBIntersectFn = wgslFn(`
					fn rayAABBIntersect(
						rayOrigin: vec3f,
						rayDir: vec3f,
						rayInvDir: vec3f,
						aabbMin: vec3f,
						aabbMax: vec3f
					) -> bool {
						// Expand AABB to handle triangles that span across split planes
						// Must match epsilon used in BVH construction
						let epsilon = 0.01;
						let expandedMin = aabbMin - vec3f(epsilon);
						let expandedMax = aabbMax + vec3f(epsilon);
						
						let t1 = (expandedMin - rayOrigin) * rayInvDir;
						let t2 = (expandedMax - rayOrigin) * rayInvDir;
						
						let tmin = min(t1, t2);
						let tmax = max(t1, t2);
						
						let tNear = max(max(tmin.x, tmin.y), tmin.z);
						let tFar = min(min(tmax.x, tmax.y), tmax.z);
						
						return tNear <= tFar && tFar > 0.001;
					}
				`);

由于工作是2D,可能下一步要玩的就是vector font了

相关推荐
Cx330❀2 天前
Qt 常用控件属性与底层机制详解:从窗口半透明、浮点数陷阱到 QSS 与焦点策略
qt·ui·图形渲染
Cx330❀2 天前
Qt 常用 UI 控件详解:从QPushButton到QLabel 核心用法解析
qt·ui·图形渲染
玖玥拾5 天前
Unity Shader 基础与图形学(一)
unity·图形渲染·图形学·shader
GR9010 天前
光线追踪-2:光线照射到物体表面后,反射的Radiance怎么求
图形渲染
yyt36304584115 天前
KLineChartQuant:GLSL 的精度问题及 RTC 解法
前端·vue.js·react.js·交互·图形渲染·webgl·数据可视化
cpolar技术支持16 天前
浏览器也能跑本地 AI:用 Transformers.js + WebGPU 做一个最小推理 Demo,cpolar 给同事远程体验
前端·ai·cpolar·webgpu·transformers.js
拿我格子衫来17 天前
Beam Studio:矢量图与位图如何变成 G-code
图像处理·图形渲染
maybeyaluokenai17 天前
unity build in渲染管线概述
unity·图形渲染
DolitD17 天前
实时云渲染多应用并发:CELL容器技术突破3D隔离瓶颈
云原生·容器·实时互动·图形渲染·数据可视化
hele_two19 天前
C++模拟蚁群(二)
c++·算法·数学建模·图形渲染