Get the latest Blender, older versions, or experimental builds.
Stay up-to-date with the new features in the latest Blender releases.
Access production assets and knowledge from the open movies.
Documentation on the usage and features in Blender.
Latest development updates, by Blender developers.
Guidelines, release notes and development docs.
A platform to collect and share results of the Blender Benchmark.
The yearly event that brings the community together.
Support core development with a monthly contribution.
Perform a single donation with more payment options available.
Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
void differentiate_texco(vec3 v, out vec3 df)
{
/* Implementation defined. */
df = v + dF_impl(v);
}
/* Overload for UVs which are loaded as generic attributes. */
void differentiate_texco(vec4 v, out vec3 df)
df = v.xyz + dF_impl(v.xyz);
void node_bump(
float strength, float dist, float height, vec3 N, vec2 dHd, float invert, out vec3 result)
N = normalize(N);
dist *= FrontFacing ? invert : -invert;
#ifdef GPU_FRAGMENT_SHADER
vec3 dPdx = dFdx(g_data.P);
vec3 dPdy = dFdy(g_data.P);
/* Get surface tangents from normal. */
vec3 Rx = cross(dPdy, N);
vec3 Ry = cross(N, dPdx);
/* Compute surface gradient and determinant. */
float det = dot(dPdx, Rx);
vec3 surfgrad = dHd.x * Rx + dHd.y * Ry;
strength = max(strength, 0.0);
result = normalize(abs(det) * N - dist * sign(det) * surfgrad);
result = normalize(mix(N, result, strength));
#else
result = N;
#endif