Advertisement
Guest User

REPLACE UR ACCUM_SUN_NEAR.PS FILE WITH IT.

a guest
Feb 27th, 2022
1,469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #include "common.h"
  2. #include "lmodel.h"
  3. #include "screenspaceshadows.h"
  4.  
  5. #ifdef USE_MINMAX_SM
  6. #define SM_MINMAX
  7. #endif
  8.  
  9. #if SUN_QUALITY>2
  10. #define ULTRA_SHADOWS_ON
  11. #endif // SUN_QUALITY>2
  12.  
  13. #ifdef ULTRA_SHADOWS_ON
  14. #define USE_ULTRA_SHADOWS
  15. #endif
  16.  
  17. #include "shadow.h"
  18.  
  19. #ifdef USE_SUNFILTER
  20. #ifdef MSAA_OPTIMIZATION
  21. float4 main ( v2p_volume I, uint iSample : SV_SAMPLEINDEX ) : SV_Target
  22. #else
  23. float4 main ( v2p_volume I ) : SV_Target
  24. #endif
  25. {
  26. gbuffer_data gbd = gbuffer_load_data( GLD_P(I.tc, I.hpos, ISAMPLE) );
  27.  
  28.  
  29. float4 _P = float4( gbd.P, 1.0);
  30.  
  31. float4 PS = mul( m_shadow, _P );
  32.  
  33. float s = shadowtest_sun( PS, I.tcJ ) * sunmask( _P );
  34.  
  35. return s;
  36. }
  37. #else
  38. #ifdef MSAA_OPTIMIZATION
  39. float4 main ( v2p_volume I, uint iSample : SV_SAMPLEINDEX ) : SV_Target
  40. #else
  41. float4 main ( v2p_volume I ) : SV_Target
  42. #endif
  43. {
  44. gbuffer_data gbd = gbuffer_load_data( GLD_P(I.tc.xy/I.tc.w, I.hpos, ISAMPLE) );
  45.  
  46. float4 _P = float4( gbd.P, gbd.mtl );
  47. float4 _N = float4( gbd.N, gbd.hemi );
  48. float4 _C = float4( gbd.C, gbd.gloss );
  49.  
  50. // ----- light-model
  51. float m = xmaterial;
  52. #ifndef USE_R2_STATIC_SUN
  53. m = _P.w;
  54. #endif
  55. float4 light = plight_infinity ( m, _P, _N, _C, Ldynamic_dir );
  56.  
  57. // ----- shadow
  58. float4 P4 = float4( _P.x, _P.y, _P.z, 1.0);
  59. float4 PS = mul( m_shadow, P4 );
  60. float s = sunmask( P4 );
  61. s *= shadow( PS );
  62. s *= ScreenSpaceShadows(_P, I.tc, I.hpos, ISAMPLE);
  63.  
  64. return float4( SRGBToLinear(Ldynamic_color.rgb * s.xxx),1) * light;
  65. }
  66. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement