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了

相关推荐
郝学胜-神的一滴5 天前
中级OpenGL教程 020:巧用数组与循环实现多点点光源渲染,告别冗余代码重构方案
c++·unity·游戏引擎·godot·图形渲染·unreal
图扑软件5 天前
其域创新 × 图扑软件|3DGS 高斯泼溅智慧钢厂实景孪生
前端·低代码·3d·编辑器·图形渲染·可视化
ysu_03148 天前
07 | 全局缩放重构实录
c语言·重构·游戏程序·图形渲染
郝学胜-神的一滴9 天前
[简化版 GAMES 101] 计算机图形学 17:纹理技术从基础原理到多场景实战应用
c++·unity·游戏引擎·图形渲染·three.js·opengl·unreal
csdndenglu12 天前
Easy3D:一个轻量级、易用、高效的C++库,用于处理和渲染3D数据,无复杂要求时可替代VTK
开发语言·c++·图形渲染·3d渲染
郝学胜-神的一滴13 天前
中级OpenGL教程 013:渲染器类架构设计与逐帧渲染流程详解
开发语言·c++·unity·游戏引擎·图形渲染·opengl·unreal
XX風14 天前
VTK 策略模式详解:InteractorStyle、Mapper、Picker 与可替换算法
图形渲染·策略模式
叩码以求索14 天前
实时渲染插件:Enscape保姆级安装教程与下载步骤分享
图形渲染
郝学胜-神的一滴16 天前
[简化版 GAMES 101] 计算机图形学 16:纹理走样、Mipmap、三线性插值、各向异性过滤原理全解
unity·游戏引擎·godot·图形渲染·three.js·opengl·unreal
ZJU_fish199617 天前
全局光照/阴影的几个常见问题
游戏引擎·图形渲染