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.
#ifndef VOLUMETRICS
void node_wireframe(float size, vec2 barycentric, vec3 barycentric_dist, out float fac)
{
vec3 barys = barycentric.xyy;
barys.z = 1.0 - barycentric.x - barycentric.y;
size *= 0.5;
vec3 s = step(-size, -barys * barycentric_dist);
fac = max(s.x, max(s.y, s.z));
}
void node_wireframe_screenspace(float size, vec2 barycentric, out float fac)
size *= (1.0 / 3.0);
vec3 dx = dFdx(barys);
vec3 dy = dFdy(barys);
vec3 deltas = sqrt(dx * dx + dy * dy);
vec3 s = step(-deltas * size, -barys);
#else
/* Stub wireframe because it is not compatible with volumetrics. */
# define node_wireframe(a, b, c, d) (d = 0.0)
# define node_wireframe_screenspace(a, b, c) (c = 0.0)
#endif