From 4679fe1c5f92e80fcd1bff29be25f15844147f1e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 9 Apr 2013 12:19:02 -0700 Subject: Add shaders from sauerbraten. The app mostly uses ARB programs, so there's not much here. --- shaders/sauerbraten/11.shader_test | 16 ++++++++++++++++ shaders/sauerbraten/2.shader_test | 10 ++++++++++ shaders/sauerbraten/5.shader_test | 16 ++++++++++++++++ shaders/sauerbraten/8.shader_test | 23 +++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 shaders/sauerbraten/11.shader_test create mode 100644 shaders/sauerbraten/2.shader_test create mode 100644 shaders/sauerbraten/5.shader_test create mode 100644 shaders/sauerbraten/8.shader_test (limited to 'shaders') diff --git a/shaders/sauerbraten/11.shader_test b/shaders/sauerbraten/11.shader_test new file mode 100644 index 0000000..4359954 --- /dev/null +++ b/shaders/sauerbraten/11.shader_test @@ -0,0 +1,16 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main() {} + +init: world +init: sound +init: cfg +init: mainloop +read map packages/base/mpsp9a.ogz (0.4 seconds) +Private Stan Sauer: Run & Gun Part I by MitaMAN +game mode is SP +[vertex shader] +void main() { gl_Position = ftransform(); } + diff --git a/shaders/sauerbraten/2.shader_test b/shaders/sauerbraten/2.shader_test new file mode 100644 index 0000000..4b0a354 --- /dev/null +++ b/shaders/sauerbraten/2.shader_test @@ -0,0 +1,10 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main(void) { + gl_FragColor = vec4(0.0); +} + +Rendering using the OpenGL assembly/GLSL shader path. + diff --git a/shaders/sauerbraten/5.shader_test b/shaders/sauerbraten/5.shader_test new file mode 100644 index 0000000..ce27109 --- /dev/null +++ b/shaders/sauerbraten/5.shader_test @@ -0,0 +1,16 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main(void) + { + gl_FragColor = gl_Color; + } + +[vertex shader] +void main(void) + { + gl_Position = ftransform(); + gl_FrontColor = gl_Color; + } + diff --git a/shaders/sauerbraten/8.shader_test b/shaders/sauerbraten/8.shader_test new file mode 100644 index 0000000..85fda5d --- /dev/null +++ b/shaders/sauerbraten/8.shader_test @@ -0,0 +1,23 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main(void) + { + gl_FragColor = gl_Color; + +#define FOG_COLOR gl_Fog.color +gl_FragColor.rgb = mix((FOG_COLOR).rgb, gl_FragColor.rgb, clamp((gl_Fog.end - gl_FogFragCoord) * gl_Fog.scale, 0.0, 1.0)); +} + +[vertex shader] +#pragma CUBE2_fog + void main(void) + { + gl_Position = ftransform(); + gl_FrontColor = gl_Color; + +#define FOG_COORD gl_Vertex +gl_FogFragCoord = -dot((FOG_COORD), gl_ModelViewMatrixTranspose[2]); +} + -- cgit v1.2.3