mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 03:04:33 +02:00
Fixed inverted particle rendering.
This commit is contained in:
parent
f82e5e2cd6
commit
864f00ee61
1 changed files with 6 additions and 4 deletions
|
@ -44,11 +44,12 @@ out vec4 varColor;
|
|||
out vec2 varTexcoord;
|
||||
|
||||
const int NUM_VERTICES_PER_PARTICLE = 4;
|
||||
// This ordering ensures that un-rotated particles render upright in the wiewer.
|
||||
const vec4 UNIT_QUAD[NUM_VERTICES_PER_PARTICLE] = vec4[NUM_VERTICES_PER_PARTICLE](
|
||||
vec4(-1.0, -1.0, 0.0, 0.0),
|
||||
vec4(1.0, -1.0, 0.0, 0.0),
|
||||
vec4(-1.0, 1.0, 0.0, 0.0),
|
||||
vec4(1.0, 1.0, 0.0, 0.0)
|
||||
vec4(-1.0, -1.0, 0.0, 0.0),
|
||||
vec4(1.0, 1.0, 0.0, 0.0),
|
||||
vec4(1.0, -1.0, 0.0, 0.0)
|
||||
);
|
||||
|
||||
float bezierInterpolate(float y1, float y2, float y3, float u) {
|
||||
|
@ -115,7 +116,8 @@ void main(void) {
|
|||
float seed = inColor.y;
|
||||
|
||||
// Pass the texcoord and the z texcoord is representing the texture icon
|
||||
varTexcoord = vec2((UNIT_QUAD[twoTriID].xy + 1.0) * 0.5);
|
||||
// Offset for corrected vertex ordering.
|
||||
varTexcoord = vec2((UNIT_QUAD[twoTriID].xy -1.0) * vec2(0.5, -0.5));
|
||||
varColor = interpolate3Vec4(particle.color.start, particle.color.middle, particle.color.finish, age);
|
||||
|
||||
// anchor point in eye space
|
||||
|
|
Loading…
Reference in a new issue