16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-09-01 16:19:19 +02:00

opengl 3.3 renderer shaders

This commit is contained in:
tmj-fstate
2020-02-21 22:50:52 +01:00
parent 7ba6383c75
commit 6b1ab6c125
47 changed files with 1620 additions and 0 deletions

28
shaders/mat_stars.frag Normal file
View File

@@ -0,0 +1,28 @@
#include <common>
#include <tonemapping.glsl>
flat in vec3 f_normal_raw;
layout(location = 0) out vec4 out_color;
#if MOTIONBLUR_ENABLED
layout(location = 1) out vec4 out_motion;
#endif
void main()
{
float x = (gl_PointCoord.x - 0.5f) * 2.0f;
float y = (gl_PointCoord.y - 0.5f) * 2.0f;
float dist2 = abs(x * x + y * y);
if (dist2 > 0.5f * 0.5f)
discard;
// color data space is shared with normals, ugh
vec4 color = vec4(pow(f_normal_raw.rgb, vec3(2.2)), 1.0f);
#if POSTFX_ENABLED
out_color = color;
#else
out_color = tonemap(color);
#endif
#if MOTIONBLUR_ENABLED
out_motion = vec4(0.0f);
#endif
}