Guest User

Untitled

a guest
Jul 22nd, 2018
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.06 KB | None | 0 0
  1. //////////////////////////////////////////////////////////////////
  2. // STALKER Shaders MAX 1.05 - By Kingo64, Sky4CE, Meltac, JJ Walker
  3. #ifndef SSM_Mount
  4. #define SSM_Mount
  5. //////////////////////////////////////////////////////////////////
  6. //Feature Enable/Disable: Comment a feature (Add the //) to disable, or uncomment (Remove the //) to enable.
  7. //////////////////////////////////////////////////////////////////
  8. // Comments with a '#' are my notes
  9. //////////////////////////////////////////////////////////////////
  10.  
  11. //World effects
  12. //#define DEPTH_OF_FIELD // Enables Depth Of Field # Blurs objects in the distance
  13. #define PARALLAX_OCCLUSION // Enables Parallax Occlusion Mapping # Makes surfaces look bumpy and 3d at the cost of fps. Worth it
  14. #define SSAO // Enables Screen Space Ambient Occlusion # Looks good if you are stuck on Object Dynamic Lighting
  15. #define SUN_SHAFTS // Enables Sun Shafts (god rays) # Only noticable on Full Dynamic Lighting, looks very nice but causes poor performance on some computers. Also makes the environment much brighter and natural.
  16. #define USE_SJITTER // Uses shadow jittering, a modern method of smoothing out shadow edges. Applies to flashlight, and to world if SUN_FILTER is enabled.
  17. #define USE_SUNMASK // Enables sun shadow masking # Seems to be the line that produces shadows based on sun orientation. I am not sure if F32 needs or it should avoid it
  18.  
  19. //Screen Space effects
  20. #define USE_MBLUR // Enables Motion Blur # This forces Motion Blur on like -mblur. Adjust the blur amount with MBLUR_COEF later in this script.
  21. #define IMPROVED_MBLUR // Use distance-depending Motion Blur - Adjust START_DIST and FINAL_DIST to your needs.
  22. //#define SKY4CE_MBLUR // # Seems to break Motion Blur and Anti-Aliasing altogether
  23. #define SATURATION_FILTER // Enables Saturation Filter, giving a grey like appearance to areas which are "unsafe".
  24. #define CONTRAST_FILTER // Enables Contrast Filter, giving a grey like appearance to areas which are "unsafe".
  25.  
  26.  
  27. //Other
  28. //#define USE_F32 // Enables Float32 mod. Breaks saturation and contrast filters. # If you are using Panoramic Mod 2.1 FINAL from Argus make sure you have a // at the start of this line
  29. //#define USE_F32_FOG // Enables Float32 style fog. Requires Float32 to be enabled.
  30. #define CUSTOM_SHADOW_RESOLUTION int(2048) // Use a custom shadow size. Default is 1024 (1024x1024).
  31.  
  32. //////////////////////////////////////////////////////////////
  33. //Depth Of Field
  34. //////////////////////////////////////////////////////////////
  35.  
  36. //Basic options:
  37. #define DOF_QUALITY int(12) //Amount of DOF samples. Maximum value is 12.
  38.  
  39. //Distance Options:
  40. #define MINDIST float(15.0) // Minimum distance DOF starts. Default is 0.4. // TWILIGHT KET USES 15
  41. #define MAXDIST float(275) // Distance at which DOF stops rendering. Default is 375
  42. #define MAXCOF float(4.0) // Blur amount - if using DDOF, this should not differ too much from DDOF_MAXCOF (I use same value)
  43.  
  44. // Meltac: Total DOF Extensions
  45. //
  46. // Blur methods - enable at least one; can be combined/applied together,
  47. // however in my experience the overall effect was worse in combination;
  48. // use r2_aa_kernel to adjust the mix, 0.3 = full classic; 0.7 = full gaussian
  49. #define DOF_CLASSIC // Use classic blur algorithm, as implemented by Sky4Ace
  50. #define DOF_GAUSSIAN // Use simple gaussian blur algorithm (blurs stronger with same MAXCOF value)
  51. #define DOF_CORRECTION float (6.0) // Factor to equalize the amount of gaussian to classic blur. Don't change this unless you know what you're doing.
  52.  
  53. // Oversampling for better quality (not really improving much, but making game startup slower - use at your own risk)
  54. #define DOF_OVERSAMPLING int(1) // oversampling ratio. Default is 1.
  55.  
  56. // Near Field DOF (see also Dynamic DOF, because the effects are interfering!)
  57. #define MAXNEAR float(0.7) // Distance at which Near Field DOF starts. Default is 0.7. Larger values will blur your weapon more, and not only its near part.
  58. #define MINNEAR float(0.0) // Distance at which Near Field DOF stops. Default is 0.0
  59. #define MAXCOF_NEAR float(15.0) // Near Field blur amount. Interferes heavily with DDOF. Default is value 7.0 without, 15.0 with DDOF.
  60.  
  61. // Zoom DOF
  62. #define ZOOM_MINDIST float(15.0) // Minimum distance (radius) from screen center where DOF starts.
  63. #define ZOOM_MAXDIST float(260.0) // Distance radius from screen center at which DOF stops rendering (beyond that value - full blur).
  64. #define ZOOM_MAXCOF float(80.0) // Blur amount at the screen border while zooming.
  65. #define ZOOM_FACTOR float(10.0) // The stepness of the blur amount raising from center to border. Good values are 10-12.
  66. #define ZOOM_BARRIER float (20.0) // (DEBUG) Distance from the screen center at which blurring starts, in relative pixels.
  67.  
  68. // Dynamic DOF
  69. //#define DDOF // Enable/disable Dynamic DOF (blurring coefficient is MAXCOF)
  70. #define DDOF_MINDIST_ADD float(0.7) // Added to view distance, at this distance begins blurring
  71. #define DDOF_MAXDIST_FACTOR float(4.0) // Mindist times factor = maxdist
  72. #define DDOF_MINDIST float(0.0) // Minimum distance DDOF starts.
  73. #define DDOF_MAXDIST float(10.0) // Distance at which DOF stops rendering. Beyond this view distance, only minor DDOF
  74. #define DDOF_MAXCOF float(4.0) // DDOF blur factor - good balanced is value 2.0 - 5.0 - see also MAXCOF
  75.  
  76. // End Meltac
  77.  
  78. /////////////////////////////////////////////////////////////////////////////////////////////////////
  79. //Anti-Aliasing (does not really work well, use at your own risk; at the moment, non-zoom mode only)
  80. /////////////////////////////////////////////////////////////////////////////////////////////////////
  81.  
  82. // Basic options:
  83. //#define AA // Enable Anti-Aliasing
  84. #define AA_KERNEL float(100.0) // PS: 0.5
  85.  
  86. #define AA_BARRIER_X float(0.800000)
  87. #define AA_BARRIER_Y float(0.500000)
  88. #define AA_BARRIER_Z float(0.000000)
  89.  
  90. #define AA_WEIGHTS_X float(0.250000)
  91. #define AA_WEIGHTS_Y float(0.250000)
  92. #define AA_WEIGHTS_Z float(0.000000)
  93.  
  94. //////////////////////////////////////////////////////////////
  95. //Parallax Occlusion Mapping
  96. //////////////////////////////////////////////////////////////
  97.  
  98. //Basic Options:
  99. #define MAX_SAMPLES int(40) //Maximum amount of samples done to a texture.
  100. #define MIN_SAMPLES int(4) //Minimum amount of samples done to a texture.
  101. #define PARALLAX_OFFSET float(0.015) //Height of surface per sample.
  102. #define FINAL_INTERSECTION_LOOPS int(5) //Amount of additional samples to increase accuracy.
  103.  
  104. //Performance Options:
  105. //#define PARALLAX_FADE //Parllax textures fade back to regular normals with distance; increases FPS and fixes anisotropic filtering. #Disabling this strangely gave me a much higher FPS.
  106. #define START_FADE float(0.0003) //Distance the fading starts
  107. #define STOP_FADE float(0.0004) //Distance the fading stops, and the texture returns to just using normals.
  108.  
  109. //Other Options:
  110. //#define USE_TEXTURE_PACK //Uses height maps built into texture files, rather than self generating them. Requires special textures (81mb) # Put a // at the start of this line if you are running low on RAM or get 'Out of Memory' errors. Also it may cause other problems such as disabling the feature altogether
  111. //#define CORRECT_PERSPECTIVE //WARNING!!! artifacts will appear if defined
  112. #define CONTRAST_COEF_Q1 float(0.6) //Amount of contrast in calculations.
  113. #define CONTRAST_COEF_Q2 float(1) //Amount of contrast in calculations.
  114. #define BRIGHTNESS_COEF float(0.25) //Amount of brightness in calculations.
  115.  
  116. //////////////////////////////////////////////////////////////
  117. //Screen Space Ambient Occlusion
  118. //////////////////////////////////////////////////////////////
  119.  
  120. //Basic Options:
  121. #define SSAO_QUALITY int(2) //Amount of SSAO samples. Use 2 for low quality and 3 for high quality. 0 and 1 are invalid. #The only noticable difference is the framerate :P
  122. #define SSAO_TEX_CONT //Increase texture contrast for diffuse lighting # This line makes SSAO much darker. If it is too dark add a // to the start of the line or increase the value on the line below.
  123. #define CONT_COEF float(0.3) //Brightness increase amount
  124.  
  125. //Only for testing.
  126. #define FADE_DIST float(4)
  127. #define FADE_COEF float(0.2)
  128.  
  129. //////////////////////////////////////////////////////////////
  130. //Sun Shafts
  131. //////////////////////////////////////////////////////////////
  132.  
  133. //Basic options:
  134. #define RAY_SAMPLES int(20) //Amount of sun ray samples. The higher this is, the better the quality and the lower your framerate.
  135. #define SS_INTENSITY float(0.5) // intesity of sun shafts
  136.  
  137. //Only for testing.
  138. #define SS_CONTRAST float(4) //Amount of contrast during sunray calculation.
  139. //#define SS_FARNEARLERP //# Seemed to give me more FPS but caused massive sun errors. Leave it disabled.
  140.  
  141. //////////////////////////////////////////////////////////////
  142. //Motion Blur
  143. //////////////////////////////////////////////////////////////
  144.  
  145. //Basic options:
  146. #define MBLUR_SAMPLES int(20) // Quality(Intesity)
  147.  
  148. //Details:
  149. #define SCALE_X float(-0.03) // Velocity ratio X
  150. #define SCALE_Y float(0.03) // Velocity ratio Y
  151. #define START_DIST float(1.0) // Interpolation start distance
  152. #define FINAL_DIST float(300.0) // Interpolation end distance
  153. #define VEL_START float(0.001) //Velocity softening at start distance - default is 0.009, but I consider this value too high
  154. #define VEL_FIN float(0.02) //Velocity softening at end distance
  155. #define IMB_CLAMP float(0.01) //Motion Blur Ratio Clamp
  156.  
  157. // Meltac: Use this instead of the "r2_mblur" setting in the console to define the motion blur amount
  158. //#define MBLUR_COEF float2(1.0,0.0)
  159.  
  160. //////////////////////////////////////////////////////////////
  161. //Saturation and Contrast
  162. //////////////////////////////////////////////////////////////
  163.  
  164. //Basic options:
  165. #define COLOR_SATURATION float(0.5) //Level of Grey. 0 is all grey (Black and White), 1 is no Grey (Why have this enabled?)
  166. #define COLOR_SAT_SUN_COEF float(1) //How much influence sun lighting has on the saturation.
  167. #define CONTRAST_FILTER_COEF float(0.15) //Level of full screen contrast.
  168.  
  169. //////////////////////////////////////////////////////////////
  170. //Float32 v2.0
  171. //////////////////////////////////////////////////////////////
  172.  
  173. //Basic options:
  174. #define CT_int 1.25f //Cook Tolerance of the sun.
  175. #define CT_int_in 1.25f //Cook Tolerance of indoor lighting.
  176. #define BLOOM_val 0.6h //Bloom brightness - Increases HDR brightness of the sky
  177. #define HDR_int 10.h //HDR cutoff - Total HDR brightness
  178.  
  179. //RADEON COMPATIBILITY MODE - For those who can not use Fetch4 or have issues! Not needed on most modern GPUs.
  180. //#define NO_F4
  181.  
  182. //////////////////////////////
  183. //Forced Settings - Debug
  184. //////////////////////////////
  185.  
  186. // #define USE_GAMMA_22
  187. // #define USE_SUNFILTER
  188. // #define USE_HWSMAP
  189. // #define USE_HWSMAP_PCF // nVidia GF3+, R600+
  190. // #define USE_BRANCHING
  191. // #define USE_VTF // VertexTextureFetch
  192. // #define FP16_FILTER
  193. // #define FP16_BLEND
  194. // #define USE_PARALLAX
  195. // #define USE_TDETAIL
  196. // #define USE_LM_HEMI
  197. // #define USE_DISTORT
  198. // #define DBG_TMAPPING
  199.  
  200. #endif
Add Comment
Please, Sign In to add comment