Mandelbulb-style iterative kernel
Ray marching with a surface hit condition
Finite-difference normal estimation
Diffuse and specular lighting
3D 分形
3D 分形 Volume Shader 中的「Preset overview」重点说明:Interactive 3D fractal with complex mathematical patterns. 这部分适合用来判断 shader 复杂度、浏览器图形路径和 GPU 稳定性。
实际测试时,请固定浏览器、预设、窗口大小、电源模式和热状态;如果页面变得卡顿或设备发热明显,应降低复杂度或停止运行。
性能因素
Nested iterations
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
Normal estimation
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
Long runs
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
可编辑参数
MAXITER
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
Ray step distance
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
Lighting samples
比较 Volume Shader BM 结果时,应固定浏览器、预设、窗口大小、电源模式和热状态;这些条件变化会直接影响 FPS 与 frame time。
#version 300 es
precision highp float;
out vec4 outColor;
in vec2 v_uv;
uniform float u_time;
uniform vec2 u_resolution;
#define PI 3.14159265358979324
#define MAXITER 5
#define MAXDIST 6.0
float fractalKernel(vec3 ver) {
vec3 a = ver;
float b, c, d, e;
for(int i = 0; i < MAXITER; i++) {
b = length(a);
if(b > MAXDIST) break;
c = atan(a.y, a.x) * 8.0;
d = acos(clamp(a.z / b, -1.0, 1.0)) * 8.0;
b = pow(b, 8.0);
a = vec3(