Played with settings

This commit is contained in:
Emmanuel BENOîT 2017-10-03 09:29:04 +02:00
parent 6263999644
commit ca7589da62
5 changed files with 17 additions and 19 deletions

2
dof.cc
View file

@ -23,7 +23,7 @@ T_DoFPass::T_DoFPass(
E_TexType::RGB16F ) , E_TexType::RGB16F ) ,
rtPass1_( T_RendertargetSetup( ).add( txPass1_ ).create( ) ) , rtPass1_( T_RendertargetSetup( ).add( txPass1_ ).create( ) ) ,
rtPass2_( T_RendertargetSetup( ).add( txOutput_ ).create( ) ) , rtPass2_( T_RendertargetSetup( ).add( txOutput_ ).create( ) ) ,
filterParams_{ 10 , 2 , 5 , 16 } , filterParams_{ 15 , 25 , 100 , 16 } ,
nSamples_( 16 ) nSamples_( 16 )
{ {
txPass1_.wrap( E_TexWrap::CLAMP_EDGE ); txPass1_.wrap( E_TexWrap::CLAMP_EDGE );

View file

@ -36,9 +36,9 @@ struct T_Raymarcher
T_Texture txOutput_ , txDepth_; T_Texture txOutput_ , txDepth_;
T_Rendertarget rtOutput_; T_Rendertarget rtOutput_;
int rmIterations = 128; int rmIterations = 256;
float rmStep = .9; float rmStep = 1.2;
float rmEpsilon = .000001; float rmEpsilon = .001;
float rmMaxDist = 50; float rmMaxDist = 250;
float epsLog = log( rmEpsilon ) / log( 10 ); float epsLog = log( rmEpsilon ) / log( 10 );
}; };

View file

@ -2,7 +2,7 @@
#define USE_MAP_MATERIAL #define USE_MAP_MATERIAL
T_BPMaterial BPMaterials[1] = { 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] = { T_PBRMaterialOld PBRMaterialsOld[1] = {
@ -19,14 +19,14 @@ T_PBRMaterial PBRMaterials[1] = {
// Albedo color // Albedo color
vec3( 1 , 1 , .4 ) , vec3( 1 , 1 , .4 ) ,
// Roughness , metallic , subsurface , anisotropy // Roughness , metallic , subsurface , anisotropy
.3 , .1 , 0 , .0 , .4 , .7 , 1 , .1 ,
// Specular strength / tint% // Specular strength / tint%
1 , 1 .5 , .5
} }
}; };
vec3 Glow[1] = { vec3 Glow[1] = {
vec3( 0 , 0 , 0 ) vec3( 2 , .4 , 5 ) * 4
}; };
void mapMaterial( void mapMaterial(
@ -36,12 +36,12 @@ void mapMaterial(
out int glowIndex ) out int glowIndex )
{ {
if ( matIndex == 0 ) { if ( matIndex == 0 ) {
type = 0;
glowIndex = -1; glowIndex = -1;
} else { } else {
type = 1; //type = 1;
glowIndex = 0; glowIndex = 0;
} }
type = 1;
tIndex = 0; tIndex = 0;
} }
@ -49,6 +49,6 @@ vec2 map( vec3 pos )
{ {
pos = pos - vec3( 0 , 0 , 0 ); pos = pos - vec3( 0 , 0 , 0 );
vec3 q = pos; 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 ) ) ); return vec2( length( q ) - 1.8 , step( 0. , 1.9 - length( pos.xy ) ) );
} }

View file

@ -185,11 +185,9 @@ vec3 PBR_Shade( in T_PBRMaterial material ,
{ {
float nDotL = dot( normal , lightDir ) , float nDotL = dot( normal , lightDir ) ,
nDotV = dot( normal , camDir ); nDotV = dot( normal , camDir );
if ( nDotL < 0 ) return vec3( 1 , 0 , 0 ); if ( nDotL < 0 || nDotV < 0 ) {
if ( nDotV < 0 ) return vec3( 0 , -nDotV , 0 ); return vec3( 0 );
// if ( nDotL < 0 || nDotV < 0 ) { }
// return vec3( 0 );
// }
vec3 tangent = cross( vec3( 0 , 1 , 0 ) , normal ); vec3 tangent = cross( vec3( 0 , 1 , 0 ) , normal );
if ( length( tangent ) == 0 ) { if ( length( tangent ) == 0 ) {

View file

@ -102,7 +102,7 @@ void main( )
T_PBRPrecomputedOld precomputed = PBR_PrecomputeOld( T_PBRPrecomputedOld precomputed = PBR_PrecomputeOld(
material , rayDir , normal ); material , rayDir , normal );
bc = PBR_ShadeOld( material , precomputed , bc = PBR_ShadeOld( material , precomputed ,
rayDir , normal , lightDir ); -rayDir , normal , lightDir );
#else #else
#if defined( USE_MAP_MATERIAL ) #if defined( USE_MAP_MATERIAL )
@ -111,7 +111,7 @@ void main( )
mapMaterial( midx , mtype , mtidx , glowidx ); mapMaterial( midx , mtype , mtidx , glowidx );
if ( mtype == 0 ) { if ( mtype == 0 ) {
bc = BP_Shade( BPMaterials[ mtidx ] , bc = BP_Shade( BPMaterials[ mtidx ] ,
rayDir , normal , lightDir ); -rayDir , normal , lightDir );
} else { } else {
#if 0 #if 0
T_PBRMaterialOld material = PBRMaterialsOld[ mtidx ]; T_PBRMaterialOld material = PBRMaterialsOld[ mtidx ];