Skip to content

Commit

Permalink
shaders: Add OpenGL stub shaders.
Browse files Browse the repository at this point in the history
With a new SV_Target variable for color buffer output.
  • Loading branch information
CrossVR committed Nov 28, 2015
1 parent c93680d commit d70bb4c
Show file tree
Hide file tree
Showing 41 changed files with 1,447 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

# Shaders are plain text
*.vs diff=astextplain
*.ps diff=astextplain
40 changes: 40 additions & 0 deletions res/gamedata/shaders/gl/.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--[[
function printf(fmt,...)
log(string.format(fmt,unpack(arg)))
end
]]--

--[[
t_point_att = "internal\\internal_light_attpoint"

function r1_lspot (shader, t_base, vs, aref)
shader:begin (vs,"add_spot")
: fog (false)
: zb (true,false)
: blend (true,blend.one,blend.one)
: aref (true,aref or 0)
shader:sampler ("s_base") :texture (t_base)
shader:sampler ("s_lmap") :texture ("internal\\internal_light_att")
: clamp ()
: f_linear ()
: project (true)
shader:sampler ("s_att") :texture ("internal\\internal_light_attclip")
: clamp ()
: f_linear ()
end

function r1_lpoint (shader, t_base, vs, aref)
shader:begin (vs,"add_point")
: fog (false)
: zb (true,false)
: blend (true,blend.one,blend.one)
: aref (true,aref or 0)
shader:sampler ("s_base") :texture (t_base)
shader:sampler ("s_lmap") :texture (t_point_att)
: clamp ()
: f_linear ()
shader:sampler ("s_att") :texture (t_point_att)
: clamp ()
: f_linear ()
end
]]--
21 changes: 21 additions & 0 deletions res/gamedata/shaders/gl/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef COMMON_H
#define COMMON_H

#include "shared\common.h"

//include "common_defines.h"
//include "common_policies.h"
#include "common_iostructs.h"
//include "common_samplers.h"
//include "common_cbuffers.h"
//include "common_functions.h"

// #define USE_SUPER_SPECULAR

#ifdef USE_R2_STATIC_SUN
# define xmaterial float(1.0f/4.fs)
#else
# define xmaterial float(L_material.w)
#endif

#endif
Loading

0 comments on commit d70bb4c

Please sign in to comment.