Advertisement
Guest User

Untitled

a guest
Oct 28th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.40 KB | None | 0 0
  1. # IMPORTANT:
  2. # Shader passes need to know details about the image in the mask_texture LUT
  3. # files, so set the following constants in user-cgp-constants.h accordingly:
  4. # 1.) mask_triads_per_tile = (number of horizontal triads in mask texture LUT's)
  5. # 2.) mask_texture_small_size = (texture size of mask*texture_small LUT's)
  6. # 3.) mask_texture_large_size = (texture size of mask*texture_large LUT's)
  7. # 4.) mask_grille_avg_color = (avg. brightness of mask_grille_texture* LUT's, in [0, 1])
  8. # 5.) mask_slot_avg_color = (avg. brightness of mask_slot_texture* LUT's, in [0, 1])
  9. # 6.) mask_shadow_avg_color = (avg. brightness of mask_shadow_texture* LUT's, in [0, 1])
  10. # Shader passes also need to know certain scales set in this .slangp, but their
  11. # compilation model doesn't currently allow the .slangp file to tell them. Make
  12. # sure to set the following constants in user-cgp-constants.h accordingly too:
  13. # 1.) bloom_approx_scale_x = scale_x2
  14. # 2.) mask_resize_viewport_scale = float2(scale_x6, scale_y5)
  15. # Finally, shader passes need to know the value of geom_max_aspect_ratio used to
  16. # calculate scale_y6 (among other values):
  17. # 1.) geom_max_aspect_ratio = (geom_max_aspect_ratio used to calculate scale_y5)
  18.  
  19. shaders = "15"
  20.  
  21. # Set an identifier, filename, and sampling traits for the phosphor mask texture.
  22. # Load an aperture grille, slot mask, and an EDP shadow mask, and load a small
  23. # non-mipmapped version and a large mipmapped version.
  24. # TODO: Test masks in other directories.
  25. textures = "mask_grille_texture_small;mask_grille_texture_large;mask_slot_texture_small;mask_slot_texture_large;mask_shadow_texture_small;mask_shadow_texture_large;SamplerLUT"
  26. mask_grille_texture_small = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5SpacingResizeTo64.png"
  27. mask_grille_texture_large = "../crt/shaders/crt-royale/TileableLinearApertureGrille15Wide8And5d5Spacing.png"
  28. mask_slot_texture_small = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacingResizeTo64.png"
  29. mask_slot_texture_large = "../crt/shaders/crt-royale/TileableLinearSlotMaskTall15Wide9And4d5Horizontal9d14VerticalSpacing.png"
  30. mask_shadow_texture_small = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDPResizeTo64.png"
  31. mask_shadow_texture_large = "../crt/shaders/crt-royale/TileableLinearShadowMaskEDP.png"
  32. mask_grille_texture_small_wrap_mode = "repeat"
  33. mask_grille_texture_large_wrap_mode = "repeat"
  34. mask_slot_texture_small_wrap_mode = "repeat"
  35. mask_slot_texture_large_wrap_mode = "repeat"
  36. mask_shadow_texture_small_wrap_mode = "repeat"
  37. mask_shadow_texture_large_wrap_mode = "repeat"
  38. mask_grille_texture_small_linear = "true"
  39. mask_grille_texture_large_linear = "true"
  40. mask_slot_texture_small_linear = "true"
  41. mask_slot_texture_large_linear = "true"
  42. mask_shadow_texture_small_linear = "true"
  43. mask_shadow_texture_large_linear = "true"
  44. mask_grille_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod
  45. mask_grille_texture_large_mipmap = "true" # Essential for hardware-resized masks
  46. mask_slot_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod
  47. mask_slot_texture_large_mipmap = "true" # Essential for hardware-resized masks
  48. mask_shadow_texture_small_mipmap = "false" # Mipmapping causes artifacts with manually resized masks without tex2Dlod
  49. mask_shadow_texture_large_mipmap = "true" # Essential for hardware-resized masks
  50. SamplerLUT = "../reshade/shaders/LUT/NEC_XM29plus_capture.png"
  51. SamplerLUT_linear = true
  52.  
  53. # NTSC Shader Passes
  54. shader0 = "../ntsc/shaders/ntsc-adaptive/ntsc-pass1.slang"
  55. shader1 = "../ntsc/shaders/ntsc-adaptive/ntsc-pass2.slang"
  56.  
  57. filter_linear0 = false
  58. filter_linear1 = false
  59.  
  60. scale_type_x0 = absolute
  61. scale_type_y0 = source
  62. scale_x0 = 1024
  63. scale_y0 = 1.0
  64. frame_count_mod0 = 2
  65. float_framebuffer0 = true
  66.  
  67. scale_type1 = source
  68. scale_x1 = 0.5
  69. scale_y1 = 1.0
  70.  
  71. shader2 = "../reshade/shaders/LUT/LUT.slang"
  72.  
  73. # Pass0: Linearize the input based on CRT gamma and bob interlaced fields.
  74. # (Bobbing ensures we can immediately blur without getting artifacts.)
  75. shader3 = "../crt/shaders/crt-royale/src/crt-royale-first-pass-linearize-crt-gamma-bob-fields.slang"
  76. alias3 = "ORIG_LINEARIZED"
  77. filter_linear3 = "false"
  78. scale_type3 = "source"
  79. scale3 = "1.0"
  80. srgb_framebuffer3 = "true"
  81.  
  82. # Pass1: Resample interlaced (and misconverged) scanlines vertically.
  83. # Separating vertical/horizontal scanline sampling is faster: It lets us
  84. # consider more scanlines while calculating weights for fewer pixels, and
  85. # it reduces our samples from vertical*horizontal to vertical+horizontal.
  86. # This has to come right after ORIG_LINEARIZED, because there's no
  87. # "original_source" scale_type we can use later.
  88. shader4 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-vertical-interlacing.slang"
  89. alias4 = "VERTICAL_SCANLINES"
  90. filter_linear4 = "true"
  91. scale_type_x4 = "source"
  92. scale_x4 = "1.0"
  93. scale_type_y4 = "viewport"
  94. scale_y4 = "1.0"
  95. #float_framebuffer4 = "true"
  96. srgb_framebuffer4 = "true"
  97.  
  98. # Pass2: Do a small resize blur of ORIG_LINEARIZED at an absolute size, and
  99. # account for convergence offsets. We want to blur a predictable portion of the
  100. # screen to match the phosphor bloom, and absolute scale works best for
  101. # reliable results with a fixed-size bloom. Picking a scale is tricky:
  102. # a.) 400x300 is a good compromise for the "fake-bloom" version: It's low enough
  103. # to blur high-res/interlaced sources but high enough that resampling
  104. # doesn't smear low-res sources too much.
  105. # b.) 320x240 works well for the "real bloom" version: It's 1-1.5% faster, and
  106. # the only noticeable visual difference is a larger halation spread (which
  107. # may be a good thing for people who like to crank it up).
  108. # Note the 4:4 aspect ratio assumes the input has cropped geom_overscan (so it's
  109. # *intended* for an ~4:4 aspect ratio).
  110. shader5 = "../crt/shaders/crt-royale/src/crt-royale-bloom-approx.slang"
  111. alias5 = "BLOOM_APPROX"
  112. filter_linear5 = "true"
  113. scale_type5 = "absolute"
  114. scale_x5 = "320"
  115. scale_y5 = "240"
  116. srgb_framebuffer5 = "true"
  117.  
  118. # Pass3: Vertically blur the input for halation and refractive diffusion.
  119. # Base this on BLOOM_APPROX: This blur should be small and fast, and blurring
  120. # a constant portion of the screen is probably physically correct if the
  121. # viewport resolution is proportional to the simulated CRT size.
  122. shader6 = "../blurs/blur5fast-vertical.slang"
  123. filter_linear6 = "true"
  124. scale_type6 = "source"
  125. scale6 = "1.0"
  126. srgb_framebuffer6 = "true"
  127.  
  128. # Pass4: Horizontally blur the input for halation and refractive diffusion.
  129. # Note: Using a one-pass 9x10 blur is about 1% slower.
  130. shader7 = "../blurs/blur5fast-horizontal.slang"
  131. alias7 = "HALATION_BLUR"
  132. filter_linear7 = "true"
  133. scale_type7 = "source"
  134. scale7 = "1.0"
  135. srgb_framebuffer7 = "true"
  136.  
  137. # Pass5: Lanczos-resize the phosphor mask vertically. Set the absolute
  138. # scale_x6 == mask_texture_small_size.x (see IMPORTANT above). Larger scales
  139. # will blur, and smaller scales could get nasty. The vertical size must be
  140. # based on the viewport size and calculated carefully to avoid artifacts later.
  141. # First calculate the minimum number of mask tiles we need to draw.
  142. # Since curvature is computed after the scanline masking pass:
  143. # num_resized_mask_tiles = 2.0;
  144. # If curvature were computed in the scanline masking pass (it's not):
  145. # max_mask_texel_border = ~3.0 * (1/3.0 + 4.0*sqrt(2.0) + 0.6 + 1.0);
  146. # max_mask_tile_border = max_mask_texel_border/
  147. # (min_resized_phosphor_triad_size * mask_triads_per_tile);
  148. # num_resized_mask_tiles = max(2.0, 1.0 + max_mask_tile_border * 2.0);
  149. # At typical values (triad_size >= 2.0, mask_triads_per_tile == 8):
  150. # num_resized_mask_tiles = ~3.8
  151. # Triad sizes are given in horizontal terms, so we need geom_max_aspect_ratio
  152. # to relate them to vertical resolution. The widest we expect is:
  153. # geom_max_aspect_ratio = 4.0/3.0 # Note: Shader passes need to know this!
  154. # The fewer triads we tile across the screen, the larger each triad will be as a
  155. # fraction of the viewport size, and the larger scale_y6 must be to draw a full
  156. # num_resized_mask_tiles. Therefore, we must decide the smallest number of
  157. # triads we'll guarantee can be displayed on screen. We'll set this according
  158. # to 3-pixel triads at 768p resolution (the lowest anyone's likely to use):
  159. # min_allowed_viewport_triads = 768.0*geom_max_aspect_ratio / 3.0 = 341.333333
  160. # Now calculate the viewport scale that ensures we can draw resized_mask_tiles:
  161. # min_scale_x = resized_mask_tiles * mask_triads_per_tile /
  162. # min_allowed_viewport_triads
  163. # scale_y6 = geom_max_aspect_ratio * min_scale_x
  164. # # Some code might depend on equal scales:
  165. # scale_x7 = scale_y5
  166. # Given our default geom_max_aspect_ratio and min_allowed_viewport_triads:
  167. # scale_y6 = 4.0/3.0 * 2.0/(341.33334 / 8.0) = 0.0625
  168. # IMPORTANT: The scales MUST be calculated in this way. If you wish to change
  169. # geom_max_aspect_ratio, update that constant in user-cgp-constants.h!
  170. shader8 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-vertical.slang"
  171. filter_linear8 = "true"
  172. scale_type_x8 = "absolute"
  173. scale_x8 = "64"
  174. scale_type_y8 = "viewport"
  175. scale_y8 = "0.0625" # Safe for >= 341.334 horizontal triads at viewport size
  176. #srgb_framebuffer8 = "false" # mask_texture is already assumed linear
  177.  
  178. # Pass6: Lanczos-resize the phosphor mask horizontally. scale_x9 = scale_y5.
  179. # TODO: Check again if the shaders actually require equal scales.
  180. shader9 = "../crt/shaders/crt-royale/src/crt-royale-mask-resize-horizontal.slang"
  181. alias9 = "MASK_RESIZE"
  182. filter_linear9 = "false"
  183. scale_type_x9 = "viewport"
  184. scale_x9 = "0.0625"
  185. scale_type_y9 = "source"
  186. scale_y9 = "1.0"
  187. #srgb_framebuffer9 = "false" # mask_texture is already assumed linear
  188.  
  189. # Pass7: Resample (misconverged) scanlines horizontally, apply halation, and
  190. # apply the phosphor mask.
  191. shader10 = "../crt/shaders/crt-royale/src/crt-royale-scanlines-horizontal-apply-mask.slang"
  192. alias10 = "MASKED_SCANLINES"
  193. filter_linear10 = "true" # This could just as easily be nearest neighbor.
  194. scale_type10 = "viewport"
  195. scale10 = "1.0"
  196. #float_framebuffer10 = "true"
  197. srgb_framebuffer10 = "true"
  198.  
  199. # Pass 8: Compute a brightpass. This will require reading the final mask.
  200. shader11 = "../crt/shaders/crt-royale/src/crt-royale-brightpass.slang"
  201. alias11 = "BRIGHTPASS"
  202. filter_linear11 = "true" # This could just as easily be nearest neighbor.
  203. scale_type11 = "viewport"
  204. scale11 = "1.0"
  205. srgb_framebuffer11 = "true"
  206.  
  207. # Pass 9: Blur the brightpass vertically
  208. shader12 = "../crt/shaders/crt-royale/src/crt-royale-bloom-vertical.slang"
  209. filter_linear12 = "true" # This could just as easily be nearest neighbor.
  210. scale_type12 = "source"
  211. scale12 = "1.0"
  212. srgb_framebuffer12 = "true"
  213.  
  214. # Pass 10: Blur the brightpass horizontally and combine it with the dimpass:
  215. shader13 = "../crt/shaders/crt-royale/src/crt-royale-bloom-horizontal-reconstitute.slang"
  216. filter_linear13 = "true"
  217. scale_type13 = "source"
  218. scale13 = "1.0"
  219. srgb_framebuffer13 = "true"
  220.  
  221. # Pass 11: Compute curvature/AA:
  222. shader14 = "../crt/shaders/crt-royale/src/crt-royale-geometry-aa-last-pass.slang"
  223. filter_linear14 = "true"
  224. scale_type14 = "viewport"
  225. mipmap_input14 = "true"
  226. texture_wrap_mode14 = "clamp_to_edge"
  227.  
  228. parameters = "crt_gamma;lcd_gamma;levels_contrast;halation_weight;diffusion_weight;bloom_underestimate_levels;bloom_excess;beam_min_sigma;beam_max_sigma;beam_spot_power;beam_min_shape;beam_max_shape;beam_shape_power;beam_horiz_filter;beam_horiz_sigma;beam_horiz_linear_rgb_weight;convergence_offset_x_r;convergence_offset_x_g;convergence_offset_x_b;convergence_offset_y_r;convergence_offset_y_g;convergence_offset_y_b;mask_type;mask_sample_mode_desired;mask_specify_num_triads;mask_triad_size_desired;mask_num_triads_desired;aa_subpixel_r_offset_x_runtime;aa_subpixel_r_offset_y_runtime;aa_cubic_c;aa_gauss_sigma;geom_mode_runtime;geom_radius;geom_view_dist;geom_tilt_angle_x;geom_tilt_angle_y;geom_aspect_ratio_x;geom_aspect_ratio_y;geom_overscan_x;geom_overscan_y;border_size;border_darkness;border_compress;interlace_bff;interlace_1080i;LUT_Size"
  229. beam_horiz_filter = "0.000000"
  230. beam_horiz_linear_rgb_weight = "1.000000"
  231. beam_horiz_sigma = "0.555000"
  232. beam_max_shape = "2.000000"
  233. beam_max_sigma = "0.250000"
  234. beam_min_shape = "2.000000"
  235. beam_min_sigma = "0.075000"
  236. beam_shape_power = "0.250000"
  237. beam_spot_power = "0.330000"
  238. bloom_excess = "0.335000"
  239. bloom_underestimate_levels = "1.20"
  240. border_compress = "2.500000"
  241. border_darkness = "0.000000"
  242. border_size = "0.005000"
  243. convergence_offset_x_b = "0.000000"
  244. convergence_offset_x_g = "0.000000"
  245. convergence_offset_x_r = "0.000000"
  246. convergence_offset_y_b = "-0.200000"
  247. convergence_offset_y_g = "0.000000"
  248. convergence_offset_y_r = "0.200000"
  249. crt_gamma = "2.400000"
  250. diffusion_weight = "0.075000"
  251. geom_aspect_ratio_x = "432.000000"
  252. geom_aspect_ratio_y = "329.000000"
  253. geom_mode_runtime = "0.000000"
  254. geom_overscan_x = "1.000000"
  255. geom_overscan_y = "1.000000"
  256. geom_radius = "3.000000"
  257. geom_tilt_angle_x = "0.000000"
  258. geom_tilt_angle_y = "0.000000"
  259. geom_view_dist = "2.000000"
  260. halation_weight = "0.000000"
  261. interlace_1080i = "0.000000"
  262. interlace_bff = "0.000000"
  263. lcd_gamma = "2.400000"
  264. levels_contrast = "0.750000"
  265. mask_specify_num_triads = "0.000000"
  266. mask_triad_size_desired = "3.000000"
  267. mask_sample_mode_desired = "1.000000"
  268. mask_type = "1.000000"
  269. aa_cubic_c = "0.500000"
  270. aa_gauss_sigma = "0.500000"
  271. aa_subpixel_r_offset_x_runtime = "-0.333333"
  272. aa_subpixel_r_offset_y_runtime = "0.000000"
  273. LUT_Size = "32.0"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement