Skip to content

Commit 4ac5bb3

Browse files
author
SkyLoader
committed
OpenGL: fixed tree normals - seems all normals look nice, fixed calculation of sky reflection on water
1 parent ca1b93b commit 4ac5bb3

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

res/gamedata/shaders/gl/deffer_tree_bump.vs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ v2p_bumped _main (v_tree I)
5353
float3 N = unpack_bx4(I.Nh); // just scale (assume normal in the -.5f, .5f)
5454
float3 T = unpack_bx4(I.T); //
5555
float3 B = unpack_bx4(I.B); //
56-
float3x3 xform = mul (float3x3(m_xform_v), float3x3(
57-
T.x,B.x,N.x,
58-
T.y,B.y,N.y,
59-
T.z,B.z,N.z
60-
));
56+
float3x3 xform = mul (float3x3(m_xform_v), float3x3(T,B,N));
6157

6258
// The pixel shader operates on the bump-map in [0..1] range
6359
// Remap this range in the matrix, anyway we are pixel-shader limited :)

res/gamedata/shaders/gl/iostructs/p_waterd.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
out vec4 SV_Target;
3+
#ifdef GBUFFER_OPTIMIZATION
34
in vec4 gl_FragCoord;
5+
#endif
46

57
struct v2p
68
{
@@ -10,7 +12,9 @@ struct v2p
1012
#if defined(USE_SOFT_WATER) && defined(NEED_SOFT_WATER)
1113
float4 tctexgen; // TEXCOORD3;
1214
#endif // defined(USE_SOFT_WATER) && defined(NEED_SOFT_WATER)
15+
#ifdef GBUFFER_OPTIMIZATION
1316
float4 hpos ; // SV_Position;
17+
#endif
1418
};
1519

1620
layout(location = TEXCOORD0) in float2 v2p_waterd_tbase ; // TEXCOORD0;
@@ -31,6 +35,8 @@ void main()
3135
#if defined(USE_SOFT_WATER) && defined(NEED_SOFT_WATER)
3236
I.tctexgen = v2p_waterd_tctexgen;
3337
#endif // defined(USE_SOFT_WATER) && defined(NEED_SOFT_WATER)
38+
#ifdef GBUFFER_OPTIMIZATION
3439
I.hpos = gl_FragCoord;
40+
#endif
3541
SV_Target = _main (I);
3642
}

res/gamedata/shaders/gl/water.ps

-22 Bytes
Binary file not shown.

res/gamedata/shaders/gl/waterd.vs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ uniform float4x4 m_texgen;
77

88
v2p _main (v_vert v)
99
{
10-
//v.N = unpack_D3DCOLOR(v.N);
11-
//v.T = unpack_D3DCOLOR(v.T);
12-
//v.B = unpack_D3DCOLOR(v.B);
13-
//v.color = unpack_D3DCOLOR(v.color);
10+
v.N = unpack_D3DCOLOR(v.N);
11+
v.T = unpack_D3DCOLOR(v.T);
12+
v.B = unpack_D3DCOLOR(v.B);
13+
v.color = unpack_D3DCOLOR(v.color);
1414

1515
v2p o;
1616

0 commit comments

Comments
 (0)