// Toon shader using per-pixel lighting. Based on the glsl
// tutorial from lighthouse 3D:
// https://Lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/
#version 330 core
#define PROCESSING_LIGHT_SHADER
precision mediump float;
uniform vec3 lightNormal[8];
uniform mat4 transform;
uniform mat3 normalMatrix;
in vec4 vertex;
in vec3 normal;
out vec3 vertNormal, vertLightDir;
void main() {
// Vertex in clip coordinates.
gl_Position = transform * vertex;
// Normal the vector if eye coordinates are passed
// to the fragment shader.
vertNormal = normalize(normalMatrix * normal);
// Assuming that there is only one directional light,
// its normal vector is passed to the fragment shader
// in order to perform per-pixel lighting calculation.
vertLightDir = -lightNormal[0];
}
The PyPI sdf-fork situation is specially awkward…
UPDATE: I’m trying sdfcad now instead of sdf-fork, it looks like it is actively maintained at Yann Büchau / sdfCAD · GitLab
I should mention that pip install trimesh[easy] will install other optional but useful stuff, specially mapox-earcut without which you get some nasty exceptions when triangulating polys.
Personally I’m moving all my stuff from os.path to pathlib.Path
Sure, os.path works fine in this case and in many cases, very straight forward!
I just wanted to tell you how much I’m enjoying pathlib.Path for some other more complex stuff. I really like stuff like .parent, .name, the / operator for concatenating paths, lot’s of stuff. iterdir() can return complete paths…
Also, sadly, I think a path object breaks the trimesh/sdf load/save functions