Skip to content

Commit 1c7893d

Browse files
committed
Апдейт шейдеров [skip ci]
1 parent 0c6d7b9 commit 1c7893d

Some content is hidden

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

43 files changed

+102
-149
lines changed

Game/Resources_SoC_1.0006/gamedata/shaders/r3/Gauss.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#ifndef GAUSSBLUR_H_INCLUDED
22
#define GAUSSBLUR_H_INCLUDED
33

4-
uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)
5-
64
float4 Gauss(Texture2D t2d, float2 texCoord, int factor, bool optimize)
75
{
86
float4 outColor = 0.f;
Binary file not shown.
Binary file not shown.
Binary file not shown.

Game/Resources_SoC_1.0006/gamedata/shaders/r3/common.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "common_cbuffers.h"
1111
#include "common_functions.h"
1212

13-
// #define USE_SUPER_SPECULAR
1413
#define USE_SUNMASK
1514

1615
#ifdef USE_R2_STATIC_SUN
@@ -29,7 +28,6 @@
2928
// #define DBG_TEST_LIGHT
3029
// #define DBG_TEST_LIGHT_SPEC
3130
32-
// #define USE_GAMMA_22
3331
// #define USE_SJITTER
3432
// #define USE_SUNFILTER
3533
// #define USE_FETCH4
@@ -48,7 +46,6 @@
4846
// #define USE_LM_HEMI //- shader defined
4947
// #define USE_DISTORT //- shader defined
5048
// #define USE_SUNMASK //- shader defined
51-
// #define DBG_TMAPPING
5249
//////////////////////////////////////////////////////////////////////////////////////////
5350
5451
uniform float4 J_direct [6];

Game/Resources_SoC_1.0006/gamedata/shaders/r3/common_functions.h

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -91,50 +91,20 @@ float3 calc_reflection(float3 pos_w, float3 norm_w) { return reflect(normalize(p
9191
#define USABLE_BIT_15 uint(0x80000000)
9292
#define MUST_BE_SET uint(0x40000000) // This flag *must* be stored in the floating-point representation of the bit flag to store
9393

94-
/*
95-
float2 gbuf_pack_normal( float3 norm )
94+
// RainbowZerg: use spheremap transform (Crytek's implementation) for normals packing
95+
float2 gbuf_pack_normal(float3 N)
9696
{
97-
float2 res;
98-
99-
res = 0.5 * ( norm.xy + float2( 1, 1 ) ) ;
100-
res.x *= ( norm.z < 0 ? -1.0 : 1.0 );
101-
102-
return res;
103-
}
104-
105-
float3 gbuf_unpack_normal( float2 norm )
106-
{
107-
float3 res;
108-
109-
res.xy = ( 2.0 * abs( norm ) ) - float2(1,1);
110-
111-
res.z = ( norm.x < 0 ? -1.0 : 1.0 ) * sqrt( abs( 1 - res.x * res.x - res.y * res.y ) );
112-
113-
return res;
97+
return normalize(N.xy) * sqrt(N.z * 0.5 + 0.5);
98+
;
11499
}
115-
*/
116100

117-
// Holger Gruen AMD - I change normal packing and unpacking to make sure N.z is accessible without ALU cost
118-
// this help the HDAO compute shader to run more efficiently
119-
float2 gbuf_pack_normal(float3 norm)
120-
{
121-
float2 res;
122-
123-
res.x = norm.z;
124-
res.y = 0.5f * (norm.x + 1.0f);
125-
res.y *= (norm.y < 0.0f ? -1.0f : 1.0f);
126-
127-
return res;
128-
}
129-
130-
float3 gbuf_unpack_normal(float2 norm)
101+
float3 gbuf_unpack_normal(float2 enc)
131102
{
103+
// Spheremap transform
132104
float3 res;
133-
134-
res.z = norm.x;
135-
res.x = (2.0f * abs(norm.y)) - 1.0f;
136-
res.y = (norm.y < 0 ? -1.0 : 1.0) * sqrt(abs(1 - res.x * res.x - res.z * res.z));
137-
105+
float l = length(enc.xy);
106+
res.z = l * l * 2.0 - 1.0;
107+
res.xy = normalize(enc.xy) * sqrt(1.0 - res.z * res.z);
138108
return res;
139109
}
140110

Game/Resources_SoC_1.0006/gamedata/shaders/r3/effects_water.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function normal (shader, t_base, t_second, t_detail)
2626
shader:dx10texture ("s_env0", tex_env0)
2727
shader:dx10texture ("s_env1", tex_env1)
2828
shader:dx10texture ("s_position", "$user$position")
29-
shader:dx10texture ("s_image", "$user$generic0_temp")
29+
shader:dx10texture ("s_last_frame", "$user$generic0_temp")
3030
shader:dx10texture ("s_leaves", tex_leaves)
3131

3232
shader:dx10sampler ("smp_base")

Game/Resources_SoC_1.0006/gamedata/shaders/r3/effects_waterryaska.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function normal (shader, t_base, t_second, t_detail)
2626
shader:dx10texture ("s_env0", tex_env0)
2727
shader:dx10texture ("s_env1", tex_env1)
2828
shader:dx10texture ("s_position", "$user$position")
29-
shader:dx10texture ("s_image", "$user$generic0_temp")
29+
shader:dx10texture ("s_last_frame", "$user$generic0_temp")
3030
shader:dx10texture ("s_leaves", tex_leaves)
3131

3232
shader:dx10sampler ("smp_base")

Game/Resources_SoC_1.0006/gamedata/shaders/r3/effects_waterstuden.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function normal (shader, t_base, t_second, t_detail)
2626
shader:dx10texture ("s_env0", tex_env0)
2727
shader:dx10texture ("s_env1", tex_env1)
2828
shader:dx10texture ("s_position", "$user$position")
29-
shader:dx10texture ("s_image", "$user$generic0_temp")
29+
shader:dx10texture ("s_last_frame", "$user$generic0_temp")
3030
shader:dx10texture ("s_leaves", tex_leaves)
3131

3232
shader:dx10sampler ("smp_base")

Game/Resources_SoC_1.0006/gamedata/shaders/r3/hud_crosshair.vs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#include "common_iostructs.h"
2-
//#include "common.h"
3-
4-
uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution)
1+
#include "common.h"
52

63
//////////////////////////////////////////////////////////////////////////////////////////
74
// Vertex

0 commit comments

Comments
 (0)