Enhancements to breadcrumb trail
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user