Fucking around
This commit is contained in:
parent
1fb3fac7da
commit
f141a948ac
3 changed files with 10 additions and 10 deletions
|
@ -138,9 +138,8 @@ vec3 RM_ReduceDiscontinuity(
|
||||||
{
|
{
|
||||||
vec3 hitPos = origin + hitDist * rayDir;
|
vec3 hitPos = origin + hitDist * rayDir;
|
||||||
for ( int i = 0 ; i < iterations ; i ++ ) {
|
for ( int i = 0 ; i < iterations ; i ++ ) {
|
||||||
const float err = length( origin - hitPos ) * tanPhi;
|
|
||||||
hitPos = hitPos + rayDir * (
|
hitPos = hitPos + rayDir * (
|
||||||
RM_Map( hitPos ).x - tanPhi
|
RM_Map( hitPos ).x - tanPhi * length( origin - hitPos )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return hitPos;
|
return hitPos;
|
||||||
|
|
|
@ -128,7 +128,7 @@ vec3 PBR_Shade(
|
||||||
* mix( Fd , ss , material.subsurface )
|
* mix( Fd , ss , material.subsurface )
|
||||||
* material.cAlbedo /* + Fsheen */)
|
* material.cAlbedo /* + Fsheen */)
|
||||||
* pow( 1 - material.metallic , 3 )
|
* pow( 1 - material.metallic , 3 )
|
||||||
+ clamp( Gs , 0 , 1 ) * Fs * Ds );
|
+ Gs * Fs * Ds );
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 PBR_Shade(
|
vec3 PBR_Shade(
|
||||||
|
|
|
@ -18,7 +18,7 @@ T_PBRMaterial PBRMaterials[1] = {
|
||||||
// Albedo color
|
// Albedo color
|
||||||
vec3( .8 , 1 , .8 ) ,
|
vec3( .8 , 1 , .8 ) ,
|
||||||
// Roughness , metallic , subsurface , anisotropy
|
// Roughness , metallic , subsurface , anisotropy
|
||||||
.2 , .8 , .5 , .0 ,
|
.3 , .8 , .8 , .9 ,
|
||||||
// Specular strength / tint%
|
// Specular strength / tint%
|
||||||
.5 , .5
|
.5 , .5
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,10 @@ vec2 RM_Map( vec3 pos )
|
||||||
vec3 q = pos;
|
vec3 q = pos;
|
||||||
HG_pMod2( q.xy , vec2( 8. ) );
|
HG_pMod2( q.xy , vec2( 8. ) );
|
||||||
HG_pR( q.xz , 1 );
|
HG_pR( q.xz , 1 );
|
||||||
return vec2( HG_fOpUnionColumns(
|
return vec2( HG_fOpUnionStairs(
|
||||||
HG_fBox( q , vec3( 1.5 ) ) ,
|
HG_fBox( q , vec3( 2.3 ) ) ,
|
||||||
HG_fSphere( q , 1.5 ) ,
|
HG_fSphere( q , 2.6 ) ,
|
||||||
1. , 8 ) ,
|
1. , 4 ) ,
|
||||||
step( 0. , -HG_fSphere( pos , 3 ) ) );
|
step( 0. , -HG_fSphere( pos , 3 ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void main( )
|
||||||
|
|
||||||
vec3 r = RM_Advanced( u_CamPos , rayDir ,
|
vec3 r = RM_Advanced( u_CamPos , rayDir ,
|
||||||
int( u_Render.x ) , u_Render.y ,
|
int( u_Render.x ) , u_Render.y ,
|
||||||
/*u_Render.z */ tanPhi , .001 , u_Render.w );
|
tanPhi , .01 , u_Render.w );
|
||||||
const vec3 background = vec3( .005 );
|
const vec3 background = vec3( .005 );
|
||||||
|
|
||||||
vec3 bc = background;
|
vec3 bc = background;
|
||||||
|
@ -135,7 +135,8 @@ void main( )
|
||||||
if ( glowidx >= 0 ) {
|
if ( glowidx >= 0 ) {
|
||||||
bc += Glow[ glowidx ];
|
bc += Glow[ glowidx ];
|
||||||
}
|
}
|
||||||
bc = FOG_Apply( bc , r.x , u_FogAttenuation , background );
|
bc = FOG_Apply( bc , length( u_CamPos - hitPos ) ,
|
||||||
|
u_FogAttenuation , background );
|
||||||
}
|
}
|
||||||
|
|
||||||
o_Color = bc;
|
o_Color = bc;
|
||||||
|
|
Loading…
Reference in a new issue