Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow mask looks different in version 2.0.0 compared to version 1.0.0 #29

Open
ghost opened this issue Jan 12, 2023 · 15 comments
Open

Comments

@ghost
Copy link

ghost commented Jan 12, 2023

I've noticed that the shadow mask that i usually love to use is different in version 2.0.0 compared to version. 1.0.0
first, it's darker and looks more closely to grille mask type

first screenshot in version 1.0.0 (notice how you can actually see the dots)
Screen Shot 01-13-23 at 01 00 AM 001
second screenshot is version 2.0.0 (notice that it looks similar to the grille mask type only darker)
Screen Shot 01-13-23 at 01 02 AM

@ghost
Copy link
Author

ghost commented Jan 12, 2023

p.s better to be viewed in fullscreen

@BiatuAutMiahn
Copy link

BiatuAutMiahn commented Jan 13, 2023

I'd check settings, those look like completely different grille types

@ghost
Copy link
Author

ghost commented Jan 13, 2023

I'd check settings, those look like completely different grille types

the top one is a dot triad shadow beam so as the bottom one, but for some reason in version 2.0.0 they look like grille mask you can even zoom in to see

@BiatuAutMiahn
Copy link

ah

@akgunter
Copy link
Owner

@Hillionliat could you copy/paste your crt-royale config for me? That definitely looks wonky to me, but it's not obvious to me what's causing it.

In the meantime, try out the feature/lowres-phosphors branch I pushed last night. It looks like you're using triad size 3, and I just added some new phosphor patterns that specifically target that use case. Regardless of what's going on with the regular shadow mask, the lowres one should look much better for you.

@BiatuAutMiahn
Copy link

@akgunter Can you post a screenshot for reference?

@akgunter
Copy link
Owner

@akgunter Can you post a screenshot for reference?

A screenshot of what exactly? A crt-royale config, or of what its output looks like, or both?

@BiatuAutMiahn
Copy link

Both?

@akgunter
Copy link
Owner

@BiatuAutMiahn here's an example of a nearly-default config, and the first screenshot shows the corresponding output.

Incidentally, the issue actually turned up right there; so I don't need your configs; and the issue is fairly simple. The ordinary shadow mask is plainly too small to work correctly when the triad size is 3. I'll take another look at the math to see if it makes sense to change the scaling for the shadow mask, but there might not be a choice for that that isn't arbitrary.

The second screenshot shows the results of the LowRes Shadow mask from that branch I mentioned. All the other settings are set to the defaults. It doesn't look identical to the v1 shadow mask, since it's a completely different algorithm; but I think you'll be happier with it than what's in v2 currently.

[crt-royale.fx]
aa_subpixel_r_offset_runtime=-0.333333,0.000000
aa_subpixel_r_offset_x_runtime=-0.333333
aa_subpixel_r_offset_y_runtime=0.000000
aspect_ratio_adjustment=1.000000
basic_setup_help=0
beam_bleed=1
beam_factor=0.000000
beam_gap_width=1.000000
beam_horiz_filter=0
beam_horiz_linear_rgb_weight=1.000000
beam_horiz_sigma=0.350000
beam_linear_thickness=1.000000
beam_max_shape=4.000000
beam_max_sigma=0.300000
beam_min_shape=2.000000
beam_min_sigma=0.020000
beam_shape_mode=1
beam_shape_power=0.250000
beam_spot_power=0.333333
beam_update_interval_setting=0
beam_weight=0.500000
bloom_excess=0.000000
bloom_underestimate_levels=0.800000
blur_radius=1.000000
border_compress=2.500000
border_darkness=2.000000
border_size=0.015000
brightness=1.000000
content_box_help=0
convergence_offset_x=0.000000,0.000000,0.000000
convergence_offset_x_b=0.000000
convergence_offset_x_g=0.000000
convergence_offset_x_r=0.000000
convergence_offset_y=0.000000,0.000000,0.000000
convergence_offset_y_b=0.000000
convergence_offset_y_g=0.000000
convergence_offset_y_r=0.000000
crt_gamma=2.500000
deinterlacing_blend_gamma=1.000000
diffusion_weight=0.075000
dist_weight=0.500000
enable_bobbing=1.000000
enable_interlacing=0
gaussian_beam_max_shape=4.000000
gaussian_beam_max_sigma=0.300000
gaussian_beam_min_shape=2.000000
gaussian_beam_min_sigma=0.020000
gaussian_beam_shape_power=0.250000
gaussian_beam_spot_power=0.333333
geom_aspect_ratio=1.313070,1.000000
geom_aspect_ratio_x=1.313070
geom_aspect_ratio_y=1.000000
geom_mode_runtime=0
geom_overscan=1.000000,1.000000
geom_overscan_x=1.000000
geom_overscan_y=1.000000
geom_radius=2.000000
geom_rotation_mode=0
geom_tilt_angle=0.000000,0.000000
geom_tilt_angle_x=0.000000
geom_tilt_angle_y=0.000000
geom_view_dist=2.000000
grille_edge_intensity=0.010000
grille_q=10.000000
halation_weight=0.000000
interlace_1080i=0.000000
interlace_back_field_first=0
interlace_bff=0
lanczos_weight_at_center=1.000000
lanczos_weight_at_zero=1.000000
lcd_gamma=2.200000
levels_autodim_temp=0.010000
levels_contrast=1.000000
linear_beam_thickness=1.000000
mask_num_triads_across=480.000000
mask_num_triads_desired=480.000000
mask_sample_mode_desired=0
mask_size_param=0
mask_specify_num_triads=0
mask_triad_size_desired=6.000000
mask_triad_width=3.000000
mask_type=2
monochrome_beam=0
phosphor_edge_brightness_new=0.000000,0.000000
phosphor_height=0.800000,0.900000
phosphor_offset=1.000000,0.163000,0.162000
phosphor_offset_x=0.500000,0.000000,0.000000
phosphor_offset_y=0.000000,0.000000,0.000000
phosphor_sharpness=50.000000,50.000000
phosphor_slope_new=1.000000,1.000000
phosphor_thickness=0.200000,0.200000
phosphor_thickness_new=1.000000,1.000000
phosphor_update_frequency=1
phosphor_update_interval=60
phosphor_update_interval_setting=0
pixelation_method=0
pixel_grid_mode=0
pixel_grid_offset=0.000000,-1.000000
pixel_grid_resolution=1920.000000,1080.000000
pixel_grid_size=1.000000,1.000000
pixel_shape=7.000000,6.000000
pixel_size=7.000000,6.000000
preblur_effect_radius=0.000000,0.000000
preblur_sampling_radius=0,0
resizing_factor=1.000000
scale_triad_height=1.000000
scanline_blend_gamma=1.000000
scanline_blend_strength=0.000000
scanline_deinterlacing_mode=1
scanline_max_embedding_dist=1.000000
scanline_num_pixels=1
scanline_offset=0.000000
scanline_thickness=2
version_2_0_1=0

snes9x-x64 2023-01-18 20-32-55

snes9x-x64 2023-01-18 20-36-16

@akgunter
Copy link
Owner

Minor disclaimer: I'm not 100% satisfied with the LowRes Shadow mask yet. The dot pattern isn't really quite right when I look super closely. It's really close, though.

@akgunter
Copy link
Owner

Here's the latest rendition of the LowRes Shadow mask. Note that I set Phosphor Thickness XY to (0.3, 0.3) to hide the grid pattern a little more effectively. You can access that setting in the UI by setting ADVANCED_SETTINGS to 1.

This one is a little more griddy and less stripey. I'm brainstorming over ways to get rid of the grid pattern entirely, but it's being a minor pain.

I also added a new advanced setting Phosphor Offset that nudges the phopshors a teeny tiny bit. You can actually get the HighRes Shadow mask to look halfway decent at triad size 3 by setting it to (0.2, 0.2).

snes9x-x64 2023-01-19 00-19-09

@ghost
Copy link
Author

ghost commented Jan 19, 2023

@BiatuAutMiahn here's an example of a nearly-default config, and the first screenshot shows the corresponding output.

Incidentally, the issue actually turned up right there; so I don't need your configs; and the issue is fairly simple. The ordinary shadow mask is plainly too small to work correctly when the triad size is 3. I'll take another look at the math to see if it makes sense to change the scaling for the shadow mask, but there might not be a choice for that that isn't arbitrary.

The second screenshot shows the results of the LowRes Shadow mask from that branch I mentioned. All the other settings are set to the defaults. It doesn't look identical to the v1 shadow mask, since it's a completely different algorithm; but I think you'll be happier with it than what's in v2 currently.

[crt-royale.fx]
aa_subpixel_r_offset_runtime=-0.333333,0.000000
aa_subpixel_r_offset_x_runtime=-0.333333
aa_subpixel_r_offset_y_runtime=0.000000
aspect_ratio_adjustment=1.000000
basic_setup_help=0
beam_bleed=1
beam_factor=0.000000
beam_gap_width=1.000000
beam_horiz_filter=0
beam_horiz_linear_rgb_weight=1.000000
beam_horiz_sigma=0.350000
beam_linear_thickness=1.000000
beam_max_shape=4.000000
beam_max_sigma=0.300000
beam_min_shape=2.000000
beam_min_sigma=0.020000
beam_shape_mode=1
beam_shape_power=0.250000
beam_spot_power=0.333333
beam_update_interval_setting=0
beam_weight=0.500000
bloom_excess=0.000000
bloom_underestimate_levels=0.800000
blur_radius=1.000000
border_compress=2.500000
border_darkness=2.000000
border_size=0.015000
brightness=1.000000
content_box_help=0
convergence_offset_x=0.000000,0.000000,0.000000
convergence_offset_x_b=0.000000
convergence_offset_x_g=0.000000
convergence_offset_x_r=0.000000
convergence_offset_y=0.000000,0.000000,0.000000
convergence_offset_y_b=0.000000
convergence_offset_y_g=0.000000
convergence_offset_y_r=0.000000
crt_gamma=2.500000
deinterlacing_blend_gamma=1.000000
diffusion_weight=0.075000
dist_weight=0.500000
enable_bobbing=1.000000
enable_interlacing=0
gaussian_beam_max_shape=4.000000
gaussian_beam_max_sigma=0.300000
gaussian_beam_min_shape=2.000000
gaussian_beam_min_sigma=0.020000
gaussian_beam_shape_power=0.250000
gaussian_beam_spot_power=0.333333
geom_aspect_ratio=1.313070,1.000000
geom_aspect_ratio_x=1.313070
geom_aspect_ratio_y=1.000000
geom_mode_runtime=0
geom_overscan=1.000000,1.000000
geom_overscan_x=1.000000
geom_overscan_y=1.000000
geom_radius=2.000000
geom_rotation_mode=0
geom_tilt_angle=0.000000,0.000000
geom_tilt_angle_x=0.000000
geom_tilt_angle_y=0.000000
geom_view_dist=2.000000
grille_edge_intensity=0.010000
grille_q=10.000000
halation_weight=0.000000
interlace_1080i=0.000000
interlace_back_field_first=0
interlace_bff=0
lanczos_weight_at_center=1.000000
lanczos_weight_at_zero=1.000000
lcd_gamma=2.200000
levels_autodim_temp=0.010000
levels_contrast=1.000000
linear_beam_thickness=1.000000
mask_num_triads_across=480.000000
mask_num_triads_desired=480.000000
mask_sample_mode_desired=0
mask_size_param=0
mask_specify_num_triads=0
mask_triad_size_desired=6.000000
mask_triad_width=3.000000
mask_type=2
monochrome_beam=0
phosphor_edge_brightness_new=0.000000,0.000000
phosphor_height=0.800000,0.900000
phosphor_offset=1.000000,0.163000,0.162000
phosphor_offset_x=0.500000,0.000000,0.000000
phosphor_offset_y=0.000000,0.000000,0.000000
phosphor_sharpness=50.000000,50.000000
phosphor_slope_new=1.000000,1.000000
phosphor_thickness=0.200000,0.200000
phosphor_thickness_new=1.000000,1.000000
phosphor_update_frequency=1
phosphor_update_interval=60
phosphor_update_interval_setting=0
pixelation_method=0
pixel_grid_mode=0
pixel_grid_offset=0.000000,-1.000000
pixel_grid_resolution=1920.000000,1080.000000
pixel_grid_size=1.000000,1.000000
pixel_shape=7.000000,6.000000
pixel_size=7.000000,6.000000
preblur_effect_radius=0.000000,0.000000
preblur_sampling_radius=0,0
resizing_factor=1.000000
scale_triad_height=1.000000
scanline_blend_gamma=1.000000
scanline_blend_strength=0.000000
scanline_deinterlacing_mode=1
scanline_max_embedding_dist=1.000000
scanline_num_pixels=1
scanline_offset=0.000000
scanline_thickness=2
version_2_0_1=0

snes9x-x64 2023-01-18 20-32-55

snes9x-x64 2023-01-18 20-36-16

I've tested the low-res mask branch it's beautiful looks absolutely good on 1080p one more question I've noticed version 2.0.0 has higher contrast compared to version 1.0.0

@akgunter
Copy link
Owner

one more question I've noticed version 2.0.0 has higher contrast compared to version 1.0.0

That’s probably a combination of the new phosphor mask and scanline algorithms, and maybe a brightness scaling constant I need to recalibrate.

In both v1 and v2, those masks work by taking an RGB color and multiplying it by an RGB weight; and that weight depends on the pixel’s position on the screen. But the v2 math for converting screen position to color weight is more well-behaved at low resolutions, so the brightness should also have fewer issues with destructive Moire patterns and such screwing up the brightness.

Alongside that, there’s a brightness correction buried deep in the code that’s supposed to make all the masks appear to produce similar brightnesses. But those corrections were calibrated to the v1 masks, and it wouldn’t surprise me if my new ones require slightly different values. I’ll have to figure out how to calculate the new ones, and hopefully it comes out looking similar. For now, my reasoning is that “they’re similar patterns, so they should have similar corrections, so I can just keep using the old ones.”

@ghost
Copy link
Author

ghost commented Jan 20, 2023

one more question I've noticed version 2.0.0 has higher contrast compared to version 1.0.0

That’s probably a combination of the new phosphor mask and scanline algorithms, and maybe a brightness scaling constant I need to recalibrate.

In both v1 and v2, those masks work by taking an RGB color and multiplying it by an RGB weight; and that weight depends on the pixel’s position on the screen. But the v2 math for converting screen position to color weight is more well-behaved at low resolutions, so the brightness should also have fewer issues with destructive Moire patterns and such screwing up the brightness.

Alongside that, there’s a brightness correction buried deep in the code that’s supposed to make all the masks appear to produce similar brightnesses. But those corrections were calibrated to the v1 masks, and it wouldn’t surprise me if my new ones require slightly different values. I’ll have to figure out how to calculate the new ones, and hopefully it comes out looking similar. For now, my reasoning is that “they’re similar patterns, so they should have similar corrections, so I can just keep using the old ones.”

I really low the low-res phosphor it looks good also really love that there is now a choice for people who has 1080p monitors and people who has 2k monitors, question did you succeeded this by combining the two colors blue, red, green because i notice low-res phosphor has two colors purple (which as I understand combined blue and red) and green.

@akgunter
Copy link
Owner

question did you succeeded this by combining the two colors blue, red, green because i notice low-res phosphor has two colors purple (which as I understand combined blue and red) and green.

Yeah, they're actually quite directly based on this blog post. It's basically a trick to activate the individual red, green, and blue emitters in your display, rather than the entire RGB pixels. This creates the illusion of a cleaner, higher resolution image on your screen.

My main contribution was to implement it with pulse waves, so I can render the grid pattern from scratch in real time. This lets me render the mask at almost any scale on any display with minimal rounding errors. And, even better, I can give users control over the size, sharpness, and positions of the phosphors in case my defaults don't work for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants