summaryrefslogtreecommitdiff
path: root/workspaces/main
diff options
context:
space:
mode:
Diffstat (limited to 'workspaces/main')
-rw-r--r--workspaces/main/shaders/scene1.wgsl16
1 files changed, 3 insertions, 13 deletions
diff --git a/workspaces/main/shaders/scene1.wgsl b/workspaces/main/shaders/scene1.wgsl
index e98fae6..a47413b 100644
--- a/workspaces/main/shaders/scene1.wgsl
+++ b/workspaces/main/shaders/scene1.wgsl
@@ -26,8 +26,6 @@ fn rayPlane(ray: Ray, plane: vec4<f32>) -> f32 {
return -(dot(ray.origin, plane.xyz) + plane.w) / dot(ray.direction, plane.xyz);
}
-var<private> g_rot0: mat2x2<f32>;
-
fn render0(ray: Ray) -> vec3<f32> {
var col = vec3<f32>(0.0);
let y = abs(ray.direction.y);
@@ -54,11 +52,7 @@ const OBJ_CUBE: f32 = 1.0;
const OBJ_SPHERE: f32 = 2.0;
const OBJ_PLANE: f32 = 3.0;
-fn df(p_in: vec3<f32>) -> f32 {
- var p = p_in;
- p.x = p_in.x * g_rot0[0][0] + p_in.z * g_rot0[0][1];
- p.z = p_in.x * g_rot0[1][0] + p_in.z * g_rot0[1][1];
-
+fn df(p: vec3<f32>) -> f32 {
// Cube
var pc = p - vec3<f32>(-1.9, 0.0, 0.0);
let dCube = sdBox(pc, vec3<f32>(1.6));
@@ -77,11 +71,7 @@ fn df(p_in: vec3<f32>) -> f32 {
return d;
}
-fn dfWithID(p_in: vec3<f32>) -> RayMarchResult {
- var p = p_in;
- p.x = p_in.x * g_rot0[0][0] + p_in.z * g_rot0[0][1];
- p.z = p_in.x * g_rot0[1][0] + p_in.z * g_rot0[1][1];
-
+fn dfWithID(p: vec3<f32>) -> RayMarchResult {
// Cube
var pc = p - vec3<f32>(-1.9, 0.0, 0.0);
let dCube = sdBox(pc, vec3<f32>(1.6));
@@ -177,7 +167,7 @@ fn render1(ray: Ray) -> vec3<f32> {
}
fn effect(p: vec2<f32>) -> vec3<f32> {
- g_rot0 = rot(-0.2 * uniforms.time);
+// g_rot0 = rot(-0.2 * uniforms.time);
let ray = getCameraRay(camera, p);
return render1(ray);
}