demotool/shaders/map.glsl

55 lines
975 B
Text
Raw Normal View History

#define USE_GLOW
#define USE_MAP_MATERIAL
T_BPMaterial BPMaterials[1] = {
2017-10-03 09:29:04 +02:00
{ vec3( 1 , 1 , .4 ) * .1 , vec3( 1 , 1 , .4 ) , 40 , .1 }
};
2017-10-03 10:06:26 +02:00
T_PBRMaterialOld PBRMaterialsOld[1] = {
{
// Albedo / specular colors
2017-10-03 10:06:26 +02:00
vec3( 1 , 1 , 0 ) , vec3( 1 , 1 , .4 ) * .1 ,
// Roughness , anisotropy , subsurface , metallic
2017-10-03 10:06:26 +02:00
.8 , .8 , .1 , .9
}
};
T_PBRMaterial PBRMaterials[1] = {
{
// Albedo color
vec3( 1 , 1 , .4 ) ,
// Roughness , metallic , subsurface , anisotropy
2017-10-03 09:29:04 +02:00
.4 , .7 , 1 , .1 ,
2017-10-03 10:06:26 +02:00
// Specular strength / tint%
2017-10-03 09:29:04 +02:00
.5 , .5
}
};
vec3 Glow[1] = {
2017-10-03 09:29:04 +02:00
vec3( 2 , .4 , 5 ) * 4
};
void mapMaterial(
in int matIndex ,
out int type ,
out int tIndex ,
out int glowIndex )
{
if ( matIndex == 0 ) {
2017-10-03 10:06:26 +02:00
glowIndex = -1;
} else {
2017-10-03 09:29:04 +02:00
//type = 1;
2017-10-03 10:06:26 +02:00
glowIndex = 0;
}
2017-10-03 09:29:04 +02:00
type = 1;
tIndex = 0;
}
2017-09-30 11:23:14 +02:00
vec2 map( vec3 pos )
{
2017-10-03 10:06:26 +02:00
pos = pos - vec3( 0 , 0 , 0 );
2017-09-30 12:08:18 +02:00
vec3 q = pos;
2017-10-03 09:29:04 +02:00
q.xy = mod( q.xy + 4. , 8. ) - 4.;
return vec2( length( q ) - 1.8 , step( 0. , 1.9 - length( pos.xy ) ) );
2017-09-30 11:23:14 +02:00
}