struct PbrMaterialParameters
{
vec4 base_color;
+ vec4 tint;
vec4 emission;
float metalness;
float roughness;
virtual vec4 get_base_color()
{
if(use_base_color_map)
- return texture(base_color_map, texcoord.xy);
+ return texture(base_color_map, texcoord.xy)*pbr_material.tint;
else
- return pbr_material.base_color;
+ return pbr_material.base_color*pbr_material.tint;
}
virtual float get_metalness_value()
color += cooktorrance_one_light_direct(normal, look, incoming.direction, base_color, metalness, roughness)*incoming.color*shadow;
}
- color += cooktorrance_environment(normal, look, base_color, metalness, roughness);
-
- color *= get_occlusion_value();
+ float occlusion = get_occlusion_value();
+ color += cooktorrance_environment(normal, look, base_color, metalness, roughness)*occlusion;
if(use_emission)
color += get_emission_color();