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.
26 lines
645 B
GLSL
26 lines
645 B
GLSL
void tangent_orco_x(vec3 orco_in, out vec3 orco_out)
|
|
{
|
|
orco_out = orco_in.xzy * vec3(0.0, -0.5, 0.5) + vec3(0.0, 0.25, -0.25);
|
|
}
|
|
|
|
void tangent_orco_y(vec3 orco_in, out vec3 orco_out)
|
|
{
|
|
orco_out = orco_in.zyx * vec3(-0.5, 0.0, 0.5) + vec3(0.25, 0.0, -0.25);
|
|
}
|
|
|
|
void tangent_orco_z(vec3 orco_in, out vec3 orco_out)
|
|
{
|
|
orco_out = orco_in.yxz * vec3(-0.5, 0.5, 0.0) + vec3(0.25, -0.25, 0.0);
|
|
}
|
|
|
|
void node_tangentmap(vec4 attr_tangent, out vec3 tangent)
|
|
{
|
|
tangent = normalize(attr_tangent.xyz);
|
|
}
|
|
|
|
void node_tangent(vec3 orco, out vec3 T)
|
|
{
|
|
T = transform_direction(ModelMatrix, orco);
|
|
T = cross(g_data.N, normalize(cross(T, g_data.N)));
|
|
}
|