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 ) ,
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 );

View file

@ -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 );
};

View file

@ -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 ) ) );
}

View file

@ -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 ) {

View file

@ -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 ];