Skip to content

Commit

Permalink
shaders: Add samplers.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 29, 2015
1 parent 75ce80f commit 4ee1202
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion res/gamedata/shaders/gl/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//include "common_defines.h"
//include "common_policies.h"
#include "common_iostructs.h"
//include "common_samplers.h"
#include "common_samplers.h"
//include "common_cbuffers.h"
//include "common_functions.h"

Expand Down
76 changes: 76 additions & 0 deletions res/gamedata/shaders/gl/common_samplers.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#ifndef common_samplers_h_included
#define common_samplers_h_included

#define Texture2D uniform sampler2D
#define Texture3D uniform sampler3D
#define Texture2DMS uniform sampler2DMS
#define TextureCube uniform samplerCube​

//////////////////////////////////////////////////////////////////////////////////////////
// Geometry phase / deferring //

//sampler smp_nofilter; // Use D3DTADDRESS_CLAMP, D3DTEXF_POINT, D3DTEXF_NONE, D3DTEXF_POINT
//sampler smp_rtlinear; // Use D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE, D3DTEXF_LINEAR
//sampler smp_linear; // Use D3DTADDRESS_WRAP, D3DTEXF_LINEAR, D3DTEXF_LINEAR, D3DTEXF_LINEAR
//sampler smp_base; // Use D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC, D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC

Texture2D s_base; // smp_base
#ifdef USE_MSAA
Texture2DMS s_generic; // smp_generic
#else
Texture2D s_generic;
#endif
Texture2D s_bump; //
Texture2D s_bumpX; //
Texture2D s_detail; //
Texture2D s_detailBump; //
Texture2D s_detailBumpX; // Error for bump detail
//Texture2D s_bumpD; //
Texture2D s_hemi; //

Texture2D s_mask; //

Texture2D s_dt_r; //
Texture2D s_dt_g; //
Texture2D s_dt_b; //
Texture2D s_dt_a; //

Texture2D s_dn_r; //
Texture2D s_dn_g; //
Texture2D s_dn_b; //
Texture2D s_dn_a; //

//////////////////////////////////////////////////////////////////////////////////////////
// Lighting/shadowing phase //

//sampler smp_material;

//uniform sampler2D s_depth; //
#ifdef USE_MSAA
Texture2DMS s_position; // smp_nofilter or Load
Texture2DMS s_normal; // smp_nofilter or Load
#else
Texture2D s_position; // smp_nofilter or Load
Texture2D s_normal; // smp_nofilter or Load
#endif
Texture2D s_lmap; // 2D/???cube projector lightmap
Texture3D s_material; // smp_material
//uniform sampler1D s_attenuate; //


//////////////////////////////////////////////////////////////////////////////////////////
// Combine phase //
#ifdef USE_MSAA
Texture2DMS s_diffuse; // rgb.a = diffuse.gloss
Texture2DMS s_accumulator; // rgb.a = diffuse.specular
#else
Texture2D s_diffuse; // rgb.a = diffuse.gloss
Texture2D s_accumulator; // rgb.a = diffuse.specular
#endif
//uniform sampler2D s_generic; //
Texture2D s_bloom; //
Texture2D s_image; // used in various post-processing
Texture2D s_tonemap; // actually MidleGray / exp(Lw + eps)


#endif // #ifndef common_samplers_h_included
1 change: 0 additions & 1 deletion res/gamedata/shaders/gl/shared/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void sincos(float x, out float s, out float c) { s = sin(x); c = cos(x); }
#define tex2Dlod(s,t) textureLod(s,t.xy,t.w)
#define tex3D texture
#define texCUBE texture
#define samplerCUBE samplerCube

// Semantics assignment, maximum 16 slots
#define COLOR 0
Expand Down

0 comments on commit 4ee1202

Please sign in to comment.