diff --git a/dof.cc b/dof.cc index 3b84319..416027b 100644 --- a/dof.cc +++ b/dof.cc @@ -23,7 +23,7 @@ T_DoFPass::T_DoFPass( E_TexType::RGB16F ) , rtPass1_( T_RendertargetSetup( ).add( txPass1_ ).create( ) ) , rtPass2_( T_RendertargetSetup( ).add( txOutput_ ).create( ) ) , - filterParams_{ 10 , 2 , 5 , 16 } , + filterParams_{ 15 , 25 , 100 , 16 } , nSamples_( 16 ) { txPass1_.wrap( E_TexWrap::CLAMP_EDGE ); diff --git a/raymarcher.hh b/raymarcher.hh index 5a70c21..3aff311 100644 --- a/raymarcher.hh +++ b/raymarcher.hh @@ -36,9 +36,9 @@ struct T_Raymarcher T_Texture txOutput_ , txDepth_; T_Rendertarget rtOutput_; - int rmIterations = 128; - float rmStep = .9; - float rmEpsilon = .000001; - float rmMaxDist = 50; + int rmIterations = 256; + float rmStep = 1.2; + float rmEpsilon = .001; + float rmMaxDist = 250; float epsLog = log( rmEpsilon ) / log( 10 ); }; diff --git a/shaders/map.glsl b/shaders/map.glsl index 92dd8bd..9eea478 100644 --- a/shaders/map.glsl +++ b/shaders/map.glsl @@ -2,7 +2,7 @@ #define USE_MAP_MATERIAL T_BPMaterial BPMaterials[1] = { - { vec3( 1 , 1 , 0 ) * .1 , vec3( .1 ) , 4 , .1 } + { vec3( 1 , 1 , .4 ) * .1 , vec3( 1 , 1 , .4 ) , 40 , .1 } }; T_PBRMaterialOld PBRMaterialsOld[1] = { @@ -19,14 +19,14 @@ T_PBRMaterial PBRMaterials[1] = { // Albedo color vec3( 1 , 1 , .4 ) , // Roughness , metallic , subsurface , anisotropy - .3 , .1 , 0 , .0 , + .4 , .7 , 1 , .1 , // Specular strength / tint% - 1 , 1 + .5 , .5 } }; vec3 Glow[1] = { - vec3( 0 , 0 , 0 ) + vec3( 2 , .4 , 5 ) * 4 }; void mapMaterial( @@ -36,12 +36,12 @@ void mapMaterial( out int glowIndex ) { if ( matIndex == 0 ) { - type = 0; glowIndex = -1; } else { - type = 1; + //type = 1; glowIndex = 0; } + type = 1; tIndex = 0; } @@ -49,6 +49,6 @@ vec2 map( vec3 pos ) { pos = pos - vec3( 0 , 0 , 0 ); vec3 q = pos; - //q.xy = mod( q.xy + 4. , 8. ) - 4.; + q.xy = mod( q.xy + 4. , 8. ) - 4.; return vec2( length( q ) - 1.8 , step( 0. , 1.9 - length( pos.xy ) ) ); } diff --git a/shaders/pbr.glsl b/shaders/pbr.glsl index 0add433..4937b2d 100644 --- a/shaders/pbr.glsl +++ b/shaders/pbr.glsl @@ -185,11 +185,9 @@ vec3 PBR_Shade( in T_PBRMaterial material , { float nDotL = dot( normal , lightDir ) , nDotV = dot( normal , camDir ); - if ( nDotL < 0 ) return vec3( 1 , 0 , 0 ); - if ( nDotV < 0 ) return vec3( 0 , -nDotV , 0 ); -// if ( nDotL < 0 || nDotV < 0 ) { -// return vec3( 0 ); -// } + if ( nDotL < 0 || nDotV < 0 ) { + return vec3( 0 ); + } vec3 tangent = cross( vec3( 0 , 1 , 0 ) , normal ); if ( length( tangent ) == 0 ) { diff --git a/shaders/raymarcher.glsl b/shaders/raymarcher.glsl index d28a147..d94d08f 100644 --- a/shaders/raymarcher.glsl +++ b/shaders/raymarcher.glsl @@ -102,7 +102,7 @@ void main( ) T_PBRPrecomputedOld precomputed = PBR_PrecomputeOld( material , rayDir , normal ); bc = PBR_ShadeOld( material , precomputed , - rayDir , normal , lightDir ); + -rayDir , normal , lightDir ); #else #if defined( USE_MAP_MATERIAL ) @@ -111,7 +111,7 @@ void main( ) mapMaterial( midx , mtype , mtidx , glowidx ); if ( mtype == 0 ) { bc = BP_Shade( BPMaterials[ mtidx ] , - rayDir , normal , lightDir ); + -rayDir , normal , lightDir ); } else { #if 0 T_PBRMaterialOld material = PBRMaterialsOld[ mtidx ];