mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-12 22:50:36 -06:00
Merge with latest master
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2019 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2019 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -86,8 +86,9 @@ Fragment getFragment() {
|
||||
|
||||
// to debug using colors use this if-statment.
|
||||
// float ep = 0.01;
|
||||
// if( fract(vertexID_f) < ep ){ //periodFraction < ep
|
||||
// frag.color = vec4(1, 0, 0, 1);
|
||||
// if (fract(vertexID_f) < ep) {
|
||||
// periodFraction < ep
|
||||
// frag.color = vec4(1, 0, 0, 1);
|
||||
// }
|
||||
|
||||
return frag;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2018 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2019 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2019 *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
|
||||
@@ -26,15 +26,18 @@
|
||||
#include "floatoperations.glsl"
|
||||
|
||||
// keep in sync with renderablestars.h:ColorOption enum
|
||||
const int COLOROPTION_COLOR = 0;
|
||||
const int COLOROPTION_VELOCITY = 1;
|
||||
const int COLOROPTION_SPEED = 2;
|
||||
const int COLOROPTION_COLOR = 0;
|
||||
const int COLOROPTION_VELOCITY = 1;
|
||||
const int COLOROPTION_SPEED = 2;
|
||||
const int COLOROPTION_OTHERDATA = 3;
|
||||
const int COLOROPTION_FIXEDCOLOR = 4;
|
||||
|
||||
uniform sampler1D colorTexture;
|
||||
uniform sampler2D psfTexture;
|
||||
uniform float alphaValue;
|
||||
|
||||
uniform vec4 fixedColor;
|
||||
|
||||
uniform int colorOption;
|
||||
|
||||
uniform sampler1D otherDataTexture;
|
||||
@@ -89,21 +92,28 @@ Fragment getFragment() {
|
||||
color = otherDataValue();
|
||||
}
|
||||
break;
|
||||
case COLOROPTION_FIXEDCOLOR:
|
||||
color = fixedColor;
|
||||
break;
|
||||
}
|
||||
|
||||
vec4 textureColor = texture(psfTexture, 0.5*psfCoords + 0.5);
|
||||
vec4 textureColor = texture(psfTexture, 0.5 * psfCoords + 0.5);
|
||||
vec4 fullColor = vec4(color.rgb, textureColor.a);
|
||||
fullColor.a *= alphaValue;
|
||||
|
||||
if (colorOption == COLOROPTION_FIXEDCOLOR) {
|
||||
fullColor.a *= fixedColor.a;
|
||||
}
|
||||
|
||||
if (fullColor.a == 0) {
|
||||
discard;
|
||||
}
|
||||
|
||||
Fragment frag;
|
||||
frag.color = fullColor;
|
||||
frag.depth = gs_screenSpaceDepth;
|
||||
frag.color = fullColor;
|
||||
frag.depth = gs_screenSpaceDepth;
|
||||
frag.gPosition = vs_position;
|
||||
frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
frag.disableLDR2HDR = true;
|
||||
|
||||
return frag;
|
||||
|
||||
Reference in New Issue
Block a user