Color grading stuff - test (hardcoded)

This commit is contained in:
Emmanuel BENOîT 2017-10-05 11:47:33 +02:00
parent 942a4fea21
commit af2e8eb05c
3 changed files with 12 additions and 6 deletions

View file

@ -41,6 +41,12 @@ void main( void )
}
o_Color = o_Color + bloom / 2.2;
// Color grading test
vec3 uColorGain = vec3( .95 , 1.1 , 1.4 ) ,
uColorLift = vec3( 0 , 0 , .003 ) ,
uColorGamma = vec3( -.2 , 0.1 , .1 );
o_Color = ( o_Color * ( uColorGain - uColorLift ) ) + uColorLift;
// Vignette
vec2 vShape = pow( abs( pos * 2 - 1 ) * uVigShapeMul ,
vec2( uVigShapePow ) );
@ -54,5 +60,5 @@ void main( void )
o_Color = o_Color / ( o_Color + 1. );
// Gamma
o_Color = pow( o_Color , vec3( 1.0 / 2.2 ) );
o_Color = pow( o_Color , vec3( 1 ) / ( uColorGamma + 2.2 ) );
}

View file

@ -19,7 +19,7 @@ float M_Hash(
float M_Luminosity(
in vec3 color )
{
return dot( color , vec3( .3 , .6 , .1 ) );
return dot( color , vec3( .299 , .587 , .114 ) );
}
vec3 M_NormalizeColor(

View file

@ -14,16 +14,16 @@ T_BPMaterial BPMaterials[1] = {
T_PBRMaterial PBRMaterials[1] = {
{
// Albedo color
vec3( 1 , 1 , .4 ) ,
vec3( 1 , 1 , 1 ) ,
// Roughness , metallic , subsurface , anisotropy
.4 , .7 , 1 , .1 ,
.5 , .5 , 0 , 0 ,
// Specular strength / tint%
.5 , .5
}
};
vec3 Glow[1] = {
vec3( 2 , .4 , 5 ) * 4
vec3( .95 , .8 , 1 ) * 5
};
void mapMaterial(
@ -65,7 +65,7 @@ void main( )
int( u_Render.x ) , u_Render.y ,
u_Render.z , .001 , u_Render.w );
vec3 hitPos = u_CamPos + rayDir * r.x;
const vec3 background = vec3( .01 );
const vec3 background = vec3( .005 );
vec3 bc = background;
if ( r.y >= 0. ) {