This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/engines/eevee/shaders/default_frag.glsl
Clément Foucault d35c24f87b Eevee: Transparency: Add support for blend ADD and MULTIPLY.
This introduces a new transparency pass.
It bypass the radial distance encoding in alpha for the transparent shaders.
2017-07-11 12:39:35 +02:00

21 lines
520 B
GLSL

uniform vec3 basecol;
uniform float metallic;
uniform float specular;
uniform float roughness;
out vec4 FragColor;
void main()
{
vec3 dielectric = vec3(0.034) * specular * 2.0;
vec3 diffuse = mix(basecol, vec3(0.0), metallic);
vec3 f0 = mix(dielectric, basecol, metallic);
vec3 radiance = eevee_surface_lit((gl_FrontFacing) ? worldNormal : -worldNormal, diffuse, f0, roughness, 1.0);
#if defined(USE_ALPHA_BLEND)
FragColor = vec4(radiance, 1.0);
#else
FragColor = vec4(radiance, length(viewPosition));
#endif
}