Skip to content

Commit 4ee1202

Browse files
committed
shaders: Add samplers.
1 parent 75ce80f commit 4ee1202

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

res/gamedata/shaders/gl/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//include "common_defines.h"
77
//include "common_policies.h"
88
#include "common_iostructs.h"
9-
//include "common_samplers.h"
9+
#include "common_samplers.h"
1010
//include "common_cbuffers.h"
1111
//include "common_functions.h"
1212

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#ifndef common_samplers_h_included
2+
#define common_samplers_h_included
3+
4+
#define Texture2D uniform sampler2D
5+
#define Texture3D uniform sampler3D
6+
#define Texture2DMS uniform sampler2DMS
7+
#define TextureCube uniform samplerCube​
8+
9+
//////////////////////////////////////////////////////////////////////////////////////////
10+
// Geometry phase / deferring //
11+
12+
//sampler smp_nofilter; // Use D3DTADDRESS_CLAMP, D3DTEXF_POINT, D3DTEXF_NONE, D3DTEXF_POINT
13+
//sampler smp_rtlinear; // Use D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE, D3DTEXF_LINEAR
14+
//sampler smp_linear; // Use D3DTADDRESS_WRAP, D3DTEXF_LINEAR, D3DTEXF_LINEAR, D3DTEXF_LINEAR
15+
//sampler smp_base; // Use D3DTADDRESS_WRAP, D3DTEXF_ANISOTROPIC, D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC
16+
17+
Texture2D s_base; // smp_base
18+
#ifdef USE_MSAA
19+
Texture2DMS s_generic; // smp_generic
20+
#else
21+
Texture2D s_generic;
22+
#endif
23+
Texture2D s_bump; //
24+
Texture2D s_bumpX; //
25+
Texture2D s_detail; //
26+
Texture2D s_detailBump; //
27+
Texture2D s_detailBumpX; // Error for bump detail
28+
//Texture2D s_bumpD; //
29+
Texture2D s_hemi; //
30+
31+
Texture2D s_mask; //
32+
33+
Texture2D s_dt_r; //
34+
Texture2D s_dt_g; //
35+
Texture2D s_dt_b; //
36+
Texture2D s_dt_a; //
37+
38+
Texture2D s_dn_r; //
39+
Texture2D s_dn_g; //
40+
Texture2D s_dn_b; //
41+
Texture2D s_dn_a; //
42+
43+
//////////////////////////////////////////////////////////////////////////////////////////
44+
// Lighting/shadowing phase //
45+
46+
//sampler smp_material;
47+
48+
//uniform sampler2D s_depth; //
49+
#ifdef USE_MSAA
50+
Texture2DMS s_position; // smp_nofilter or Load
51+
Texture2DMS s_normal; // smp_nofilter or Load
52+
#else
53+
Texture2D s_position; // smp_nofilter or Load
54+
Texture2D s_normal; // smp_nofilter or Load
55+
#endif
56+
Texture2D s_lmap; // 2D/???cube projector lightmap
57+
Texture3D s_material; // smp_material
58+
//uniform sampler1D s_attenuate; //
59+
60+
61+
//////////////////////////////////////////////////////////////////////////////////////////
62+
// Combine phase //
63+
#ifdef USE_MSAA
64+
Texture2DMS s_diffuse; // rgb.a = diffuse.gloss
65+
Texture2DMS s_accumulator; // rgb.a = diffuse.specular
66+
#else
67+
Texture2D s_diffuse; // rgb.a = diffuse.gloss
68+
Texture2D s_accumulator; // rgb.a = diffuse.specular
69+
#endif
70+
//uniform sampler2D s_generic; //
71+
Texture2D s_bloom; //
72+
Texture2D s_image; // used in various post-processing
73+
Texture2D s_tonemap; // actually MidleGray / exp(Lw + eps)
74+
75+
76+
#endif // #ifndef common_samplers_h_included

res/gamedata/shaders/gl/shared/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ void sincos(float x, out float s, out float c) { s = sin(x); c = cos(x); }
4242
#define tex2Dlod(s,t) textureLod(s,t.xy,t.w)
4343
#define tex3D texture
4444
#define texCUBE texture
45-
#define samplerCUBE samplerCube
4645

4746
// Semantics assignment, maximum 16 slots
4847
#define COLOR 0

0 commit comments

Comments
 (0)