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.
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ProjectionMatrix;
uniform float pixsize; /* rv3d->pixsize */
uniform int keep_size;
uniform float objscale;
uniform float pixfactor;
in vec3 pos;
in vec4 color;
in float thickness;
out vec4 finalColor;
out float finalThickness;
#define TRUE 1
float defaultpixsize = pixsize * (1000.0 / pixfactor);
void main(void)
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
finalColor = color;
if (keep_size == TRUE) {
finalThickness = thickness;
}
else {
float size = (ProjectionMatrix[3][3] == 0.0) ? (thickness / (gl_Position.z * defaultpixsize)) :
(thickness / defaultpixsize);
finalThickness = max(size * objscale, 1.0);