mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Add my point shaders before I lose them.
This commit is contained in:
parent
8fbc6221f7
commit
bfc743fdcd
2 changed files with 28 additions and 0 deletions
10
libs/video/renderer/glsl/quakepnt.frag
Normal file
10
libs/video/renderer/glsl/quakepnt.frag
Normal file
|
@ -0,0 +1,10 @@
|
|||
//precision mediump float;
|
||||
varying float color;
|
||||
|
||||
void
|
||||
main (void)
|
||||
{
|
||||
if (color == 1.0)
|
||||
discard;
|
||||
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
|
||||
}
|
18
libs/video/renderer/glsl/quakepnt.vert
Normal file
18
libs/video/renderer/glsl/quakepnt.vert
Normal file
|
@ -0,0 +1,18 @@
|
|||
uniform mat4 mvp_mat;
|
||||
/** Vertex position.
|
||||
|
||||
x, y, z, c
|
||||
|
||||
c is the color of the point.
|
||||
*/
|
||||
attribute vec4 vertex;
|
||||
|
||||
varying float color;
|
||||
|
||||
void
|
||||
main (void)
|
||||
{
|
||||
gl_Position = mvp_mat * vec4 (vertex.xyz, 1.0);
|
||||
gl_PointSize = max (1, 32768.0 * abs (1.0 / gl_Position.z));
|
||||
color = vertex.w;
|
||||
}
|
Loading…
Reference in a new issue