This commit removes all EEVEE specific code from the `gpu_shader_material*.glsl` files. It defines a clear interface to evaluate the closure nodes leaving more flexibility to the render engine. Some of the long standing workaround are fixed: - bump mapping support is no longer duplicating a lot of node and is instead compiled into a function call. - bump rewiring to Normal socket is no longer needed as we now use a global `g_data.N` for that. Closure sampling with upstread weight eval is now supported if the engine needs it. This also makes all the material GLSL sources use `GPUSource` for better debugging experience. The `GPUFunction` parsing now happens in `GPUSource` creation. The whole `GPUCodegen` now uses the `ShaderCreateInfo` and is object type agnostic. Is has also been rewritten in C++. This patch changes a view behavior for EEVEE: - Mix shader node factor imput is now clamped. - Tangent Vector displacement behavior is now matching cycles. - The chosen BSDF used for SSR might change. - Hair shading may have very small changes on very large hairs when using hair polygon stripes. - ShaderToRGB node will remove any SSR and SSS form a shader. - SSS radius input now is no longer a scaling factor but defines an average radius. The SSS kernel "shape" (radii) are still defined by the socket default values. Appart from the listed changes no other regressions are expected.
52 lines
1.2 KiB
GLSL
52 lines
1.2 KiB
GLSL
#define EEVEE_AOV_HASH_COLOR_TYPE_MASK 1u
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
/** \name Resources
|
|
* \{ */
|
|
|
|
layout(std140) uniform renderpass_block
|
|
{
|
|
bool renderPassDiffuse;
|
|
bool renderPassDiffuseLight;
|
|
bool renderPassGlossy;
|
|
bool renderPassGlossyLight;
|
|
bool renderPassEmit;
|
|
bool renderPassSSSColor;
|
|
bool renderPassEnvironment;
|
|
bool renderPassAOV;
|
|
uint renderPassAOVActive;
|
|
};
|
|
|
|
/** \} */
|
|
|
|
/* ---------------------------------------------------------------------- */
|
|
/** \name Functions
|
|
* \{ */
|
|
|
|
vec3 render_pass_diffuse_mask(vec3 diffuse_light)
|
|
{
|
|
return renderPassDiffuse ? (renderPassDiffuseLight ? diffuse_light : vec3(1.0)) : vec3(0.0);
|
|
}
|
|
|
|
vec3 render_pass_glossy_mask(vec3 specular_light)
|
|
{
|
|
return renderPassGlossy ? (renderPassGlossyLight ? specular_light : vec3(1.0)) : vec3(0.0);
|
|
}
|
|
|
|
vec3 render_pass_emission_mask(vec3 emission_light)
|
|
{
|
|
return renderPassEmit ? emission_light : vec3(0.0);
|
|
}
|
|
|
|
bool render_pass_aov_is_color()
|
|
{
|
|
return (renderPassAOVActive & EEVEE_AOV_HASH_COLOR_TYPE_MASK) != 0u;
|
|
}
|
|
|
|
uint render_pass_aov_hash()
|
|
{
|
|
return renderPassAOVActive & ~EEVEE_AOV_HASH_COLOR_TYPE_MASK;
|
|
}
|
|
|
|
/** \} */
|