Skip to content

Commit d70bb4c

Browse files
committed
shaders: Add OpenGL stub shaders.
With a new SV_Target variable for color buffer output.
1 parent c93680d commit d70bb4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1447
-0
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
*.PDF diff=astextplain
2121
*.rtf diff=astextplain
2222
*.RTF diff=astextplain
23+
24+
# Shaders are plain text
25+
*.vs diff=astextplain
26+
*.ps diff=astextplain

res/gamedata/shaders/gl/.s

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--[[
2+
function printf(fmt,...)
3+
log(string.format(fmt,unpack(arg)))
4+
end
5+
]]--
6+
7+
--[[
8+
t_point_att = "internal\\internal_light_attpoint"
9+
10+
function r1_lspot (shader, t_base, vs, aref)
11+
shader:begin (vs,"add_spot")
12+
: fog (false)
13+
: zb (true,false)
14+
: blend (true,blend.one,blend.one)
15+
: aref (true,aref or 0)
16+
shader:sampler ("s_base") :texture (t_base)
17+
shader:sampler ("s_lmap") :texture ("internal\\internal_light_att")
18+
: clamp ()
19+
: f_linear ()
20+
: project (true)
21+
shader:sampler ("s_att") :texture ("internal\\internal_light_attclip")
22+
: clamp ()
23+
: f_linear ()
24+
end
25+
26+
function r1_lpoint (shader, t_base, vs, aref)
27+
shader:begin (vs,"add_point")
28+
: fog (false)
29+
: zb (true,false)
30+
: blend (true,blend.one,blend.one)
31+
: aref (true,aref or 0)
32+
shader:sampler ("s_base") :texture (t_base)
33+
shader:sampler ("s_lmap") :texture (t_point_att)
34+
: clamp ()
35+
: f_linear ()
36+
shader:sampler ("s_att") :texture (t_point_att)
37+
: clamp ()
38+
: f_linear ()
39+
end
40+
]]--

res/gamedata/shaders/gl/common.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef COMMON_H
2+
#define COMMON_H
3+
4+
#include "shared\common.h"
5+
6+
//include "common_defines.h"
7+
//include "common_policies.h"
8+
#include "common_iostructs.h"
9+
//include "common_samplers.h"
10+
//include "common_cbuffers.h"
11+
//include "common_functions.h"
12+
13+
// #define USE_SUPER_SPECULAR
14+
15+
#ifdef USE_R2_STATIC_SUN
16+
# define xmaterial float(1.0f/4.fs)
17+
#else
18+
# define xmaterial float(L_material.w)
19+
#endif
20+
21+
#endif

0 commit comments

Comments
 (0)