diff --git a/shaders/lib/raymarching.glsl b/shaders/lib/raymarching.glsl index 21a574d..ff61320 100644 --- a/shaders/lib/raymarching.glsl +++ b/shaders/lib/raymarching.glsl @@ -102,17 +102,17 @@ float RM_TanPhi( // ... // ... // or we could just pass it as a fucking uniform - const float fov = PI * .5 - atan( u_NearPlane * .5 ); + const float hfov = ( PI * .5 - atan( u_NearPlane * .5 ) ) * .5; vec2 e = ( abs( uv.x ) > abs( uv.y ) ) ? vec2( uv.x < 0 ? -1 : 1 , 0 ) : vec2( 0 , uv.y < 0 ? -1 : 1 ); - vec3 d = normalize( vec3( uv , -1 / tan( fov ) ) ) , + vec3 d = normalize( vec3( uv , -1 / tan( hfov ) ) ) , a = vec3( ( e + e.yx ) * pixelRadius + uv , - -1 / tan( fov ) ) , + -1 / tan( hfov ) ) , b = vec3( ( e - e.yx ) * pixelRadius + uv , - -1 / tan( fov ) ) , + -1 / tan( hfov ) ) , p2ca = a / dot( a , d ) , p2cb = a / dot( b , d ) , diff = p2cb - p2ca , @@ -123,13 +123,6 @@ float RM_TanPhi( return sqrt( sinPhiSquared / ( 1 - sinPhiSquared ) ); } -float RM_ErrFunc( - in vec3 origin , - in vec3 pos ) -{ - return 0; // FIXME -} - vec3 RM_ReduceDiscontinuity( in vec3 origin , in vec3 rayDir ,