Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "common.h"
- #include "lmodel.h"
- #include "screenspaceshadows.h"
- #ifdef USE_MINMAX_SM
- #define SM_MINMAX
- #endif
- #if SUN_QUALITY>2
- #define ULTRA_SHADOWS_ON
- #endif // SUN_QUALITY>2
- #ifdef ULTRA_SHADOWS_ON
- #define USE_ULTRA_SHADOWS
- #endif
- #include "shadow.h"
- #ifdef USE_SUNFILTER
- #ifdef MSAA_OPTIMIZATION
- float4 main ( v2p_volume I, uint iSample : SV_SAMPLEINDEX ) : SV_Target
- #else
- float4 main ( v2p_volume I ) : SV_Target
- #endif
- {
- gbuffer_data gbd = gbuffer_load_data( GLD_P(I.tc, I.hpos, ISAMPLE) );
- float4 _P = float4( gbd.P, 1.0);
- float4 PS = mul( m_shadow, _P );
- float s = shadowtest_sun( PS, I.tcJ ) * sunmask( _P );
- return s;
- }
- #else
- #ifdef MSAA_OPTIMIZATION
- float4 main ( v2p_volume I, uint iSample : SV_SAMPLEINDEX ) : SV_Target
- #else
- float4 main ( v2p_volume I ) : SV_Target
- #endif
- {
- gbuffer_data gbd = gbuffer_load_data( GLD_P(I.tc.xy/I.tc.w, I.hpos, ISAMPLE) );
- float4 _P = float4( gbd.P, gbd.mtl );
- float4 _N = float4( gbd.N, gbd.hemi );
- float4 _C = float4( gbd.C, gbd.gloss );
- // ----- light-model
- float m = xmaterial;
- #ifndef USE_R2_STATIC_SUN
- m = _P.w;
- #endif
- float4 light = plight_infinity ( m, _P, _N, _C, Ldynamic_dir );
- // ----- shadow
- float4 P4 = float4( _P.x, _P.y, _P.z, 1.0);
- float4 PS = mul( m_shadow, P4 );
- float s = sunmask( P4 );
- s *= shadow( PS );
- s *= ScreenSpaceShadows(_P, I.tc, I.hpos, ISAMPLE);
- return float4( SRGBToLinear(Ldynamic_color.rgb * s.xxx),1) * light;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement