Skip to content

Commit

Permalink
Update shaders with Ascii's Shaders update 17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yohjimane committed Aug 7, 2023
1 parent 1cff91a commit 836cbd7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
33 changes: 4 additions & 29 deletions res/gamedata/shaders/r3/deffer_tree_branch_flat.vs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define USE_TDETAIL
#include "common.h"

float4 benders_pos[32];
Expand Down Expand Up @@ -34,9 +33,7 @@ v2p_flat main (v_tree I)
float4 f_pos = float4(pos.x+result.x, pos.y, pos.z+result.y, 1);
float2 tc = (I.tc * consts).xy;



// INTERACTIVE GRASS ( Bushes ) - SSS Update 15.4
// INTERACTIVE GRASS ( Bushes ) - SSS Update 17.1
// https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders/
#if SSFX_INT_GRASS > 0
for (int b = 0; b < SSFX_INT_GRASS + 1; b++)
Expand Down Expand Up @@ -67,36 +64,14 @@ v2p_flat main (v_tree I)
}
#endif

//Normal mapping
float3 N = unpack_bx2(I.Nh);
float3 sphereOffset = float3(0.0, 1.0, 0.0);
float3 sphereScale = float3(1.0, 2.0, 1.0);
float3 sphereN = normalize(sphereScale * I.P.xyz + sphereOffset); //Spherical normals trick
float3 flatN = (float3(0, 1, 0));
/*
float3 camFacingN = normalize((f_pos - eye_position.xyz) * float3(-1,0,-1));
sphereN = lerp(camFacingN, sphereN, saturate(H)); //roots face the camera, the tips face the sky
sphereN.xz *= 0.5;
sphereN.y = sqrt(1 - saturate(dot(sphereN.xz, sphereN.xz)));
sphereN = normalize(sphereN);
*/
//foliage
float foliageMat = 0.5; //foliage
//float foliageMask = saturate(abs(xmaterial-foliageMat)-0.02); //foliage
float foliageMask = (abs(xmaterial-foliageMat) >= 0.2) ? 1 : 0; //foliage
//float foliageMask = 1; //foliage
N = normalize(lerp(N, sphereN, foliageMask)); //blend to foliage normals

// Final xform(s)
// Final xform
float3 Pe = mul (m_V, f_pos );
//float3 Pe = mul(m_V, float4(pos.xyz,1));
float hemi = I.Nh.w*c_scale.w + c_bias.w;
//float hemi = I.Nh.w;
o.hpos = mul (m_VP, f_pos );
o.N = mul((float3x3)m_xform_v, N);
o.tcdh = float4 ((I.tc * consts).xyyy );
o.N = normalize(mul((float3x3)m_xform_v, I.P.xyz));
o.tcdh = float4 (tc.xyyy );
o.position = float4 (Pe, hemi );

#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
Expand All @@ -110,4 +85,4 @@ v2p_flat main (v_tree I)

return o;
}
FXVS;
FXVS;
Binary file modified res/gamedata/shaders/r3/effects_rain.ps
Binary file not shown.
4 changes: 2 additions & 2 deletions res/gamedata/shaders/r3/settings_screenspace_FLORA.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// [ SETTINGS ] [ FLORA FIXES ]

#define G_TREES_SPECULAR 2.0f // Trees specular intensity
#define G_GRASS_SPECULAR 3.0f // Grass specular intensity
#define G_TREES_SPECULAR 1.0f // Trees specular intensity
#define G_GRASS_SPECULAR 1.0f // Grass specular intensity
#define G_SSS_INTENSITY 0.5f // Subsurface Scattering intensity

0 comments on commit 836cbd7

Please sign in to comment.