Skip to content

Commit 26030ac

Browse files
committed
Make positionOffset more conservative to help with large scenes
1 parent be8f8fe commit 26030ac

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/pt/deferred_renderer_lighting_pass.wgsl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ fn rayIntersectTriangle(ray: Ray, tri: Positions, tmax: f32, hit: ptr<function,
386386
}
387387

388388
const ORIGIN = 1f / 32f;
389-
const FLOAT_SCALE = 1f / 65536f;
390-
const INT_SCALE = 256f;
389+
const FLOAT_SCALE = 1f / 16384f;
390+
const INT_SCALE = 1024;
391391

392392
@must_use
393393
fn offsetPosition(p: vec3f, n: vec3f) -> vec3f {

‎src/pt/shader_source.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,8 @@ fn rayIntersectTriangle(ray: Ray, tri: Positions, tmax: f32, hit: ptr<function,
11411141
}
11421142
11431143
const ORIGIN = 1f / 32f;
1144-
const FLOAT_SCALE = 1f / 65536f;
1145-
const INT_SCALE = 256f;
1144+
const FLOAT_SCALE = 1f / 16384f;
1145+
const INT_SCALE = 1024;
11461146
11471147
@must_use
11481148
fn offsetPosition(p: vec3f, n: vec3f) -> vec3f {

0 commit comments

Comments
 (0)