Fixed some shaders for Intel HD Graphics compatibility.

parent 71cf711c
......@@ -25,7 +25,7 @@
#include "tools/shading.frag"
#include "tools/transferfunction.frag"
in vec3 ex_Velocity;
in vec3 ex_Direction;
in float ex_Transparency;
out vec4 out_Color; ///< outgoing fragment color
......@@ -46,14 +46,14 @@ void main() {
out_Color = lookupTF(_transferFunction, _transferFunctionParams, ex_Transparency);
break;
case 1: // velocity
float f = length(ex_Velocity);
float f = length(ex_Direction);
f -= _threshold.x;
f /= (_threshold.y - _threshold.x);
f *= _scale;
out_Color = lookupTF(_transferFunction, _transferFunctionParams, f);
break;
case 2: // direction
out_Color = vec4(normalize(abs(ex_Velocity)), 1.0);
out_Color = vec4(normalize(abs(ex_Direction)), 1.0);
break;
default:
discard;
......
......@@ -36,6 +36,7 @@ out vec3 ex_Position;
out vec3 ex_Velocity;
out float ex_StartTime;
out vec3 ex_Direction;
out float ex_Transparency;
/// Matrix defining model-to-world transformation
......@@ -109,6 +110,7 @@ void render() {
//vec4 normalTmp = (normalMatrix * vec4(in_Normal, 0.0));
// ex_Normal = normalize((normalTmp).xyz);
ex_Direction = in_Velocity;
}
void main() {
......
......@@ -39,6 +39,6 @@ void main() {
out_Color = lookupTF(_transferFunction, _transferFunctionParams, intensity);
// don't write fragment if fully transparent (in particular don't write to depth buffer!)
if (out_Color == 0.0)
if (out_Color.a == 0.0)
discard;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment