Played with settings
This commit is contained in:
parent
6263999644
commit
ca7589da62
5 changed files with 17 additions and 19 deletions
|
@ -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 ) ) );
|
||||
}
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue