mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Enabled G-Buffer for Stars.
This commit is contained in:
@@ -36,6 +36,7 @@ uniform float alphaValue;
|
||||
uniform int colorOption;
|
||||
|
||||
in vec4 vs_position;
|
||||
in vec4 vs_gPosition;
|
||||
in vec3 ge_brightness;
|
||||
in vec3 ge_velocity;
|
||||
in float ge_speed;
|
||||
@@ -85,6 +86,13 @@ Fragment getFragment() {
|
||||
frag.color = fullColor;
|
||||
frag.depth = pscDepth(position);
|
||||
|
||||
// G-Buffer
|
||||
frag.gColor = fullColor;
|
||||
frag.gPosition = vs_gPosition;
|
||||
// There is no normal here
|
||||
// TODO: Add the correct normal (JCC)
|
||||
frag.gNormalReflectance = vec4(vec3(0.0), fullColor.a);
|
||||
|
||||
if (fullColor.a == 0) {
|
||||
discard;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,9 @@ in vec3 vs_brightness[];
|
||||
in vec3 vs_velocity[];
|
||||
in float vs_speed[];
|
||||
in vec4 cam_position[];
|
||||
|
||||
|
||||
out vec4 vs_position;
|
||||
out vec4 vs_gPosition;
|
||||
out vec3 ge_brightness;
|
||||
out vec3 ge_velocity;
|
||||
out float ge_speed;
|
||||
|
||||
@@ -38,6 +38,7 @@ out vec3 vs_brightness;
|
||||
out vec3 vs_velocity;
|
||||
out float vs_speed;
|
||||
out vec4 cam_position;
|
||||
out vec4 vs_gPosition;
|
||||
|
||||
#include "PowerScaling/powerScaling_vs.hglsl"
|
||||
|
||||
@@ -51,10 +52,11 @@ void main() {
|
||||
|
||||
vec4 tmp = p;
|
||||
vec4 position = pscTransform(tmp, mat4(1.0));
|
||||
vs_gPosition = position;
|
||||
// vec4 position = pscTransform(tmp, model);
|
||||
// psc_position = tmp;
|
||||
position = view * position;
|
||||
// position = ViewProjection * ModelTransform * position;
|
||||
// gl_Position = z_normalization(position);
|
||||
gl_Position = position;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user