Enhancements to breadcrumb trail

This commit is contained in:
2026-05-19 17:36:42 -04:00
parent 7235d756dc
commit 186d9f673a
16 changed files with 514 additions and 117 deletions

View File

@@ -1,12 +1,17 @@
#version 460 core
// Colors the trail geometry with a solid uniform tint.
#version 330 core
// Colors the trail geometry by age: newest samples are red and old samples
// fade toward brown before they expire from the CPU-side trail window.
out vec4 FragColor;
in vec3 FragPos;
in float TrailTimestamp;
uniform vec3 objectcolor;
uniform float currentTime;
uniform float maxAge;
uniform vec3 recentColor;
uniform vec3 oldColor;
void main()
{
FragColor = vec4(objectcolor, 1.0);
float ageRatio = clamp((currentTime - TrailTimestamp) / maxAge, 0.0, 1.0);
FragColor = vec4(mix(recentColor, oldColor, ageRatio), 1.0);
}