Files
jak-project/game/graphics/opengl_renderer/shaders/depth_cue.vert
T
Ethan Lafrenais bb323c2ebe Depth Cue (#1676)
* Initial depth-cue implementation

* Oops

* Finish merge + fix issues with letterboxing

* Fix alpha blending

* Add some debug options + profiler stats

* More debug options + respect xyoffset GS register

* Clean up GOAL code

* Disable depth-cue by default

* typo

* very important typo

* depth-cue disable, but better
2022-07-19 18:34:30 -04:00

28 lines
556 B
GLSL

#version 430 core
layout (location = 0) in vec2 xy;
layout (location = 1) in vec2 st;
uniform vec4 u_color;
uniform float u_depth;
out flat vec4 fragment_color;
out vec2 tex_coord;
void main() {
// Calculate color
vec4 color = u_color;
color *= 2; // correct
fragment_color = color;
// Pass on texture coord
tex_coord = st;
// Calculate vertex position
vec4 position = vec4(xy.x, xy.y, u_depth, 1.0);
position.xyz = (position.xyz * 2) - 1.0; // convert from [0,1] to clip-space
gl_Position = position;
}