Mega Bezel Reflection Shader! - Feedback and Updates

Here’s a screenshot. I circled the gap at the top.

Also, I circle the letters, “game”… notice the scanline blips in the horizontal vector lines. I can’t seem to eliminate these. Is there a way to do it to re-create the solid vector line?

1 Like

I don’t think you are using a diffuse. That is a background as backdrop with the screen in add blending mode.

Just turn off the scanlines.

1 Like

Ah… I think you are right… let me check those background settings.

I have the scanlines settings off as far as I can see.

Try a different Mask Type. Maybe 1 or 0. You can also Try reducing CRT Mask Strength or Lottes Mask Strength Bright Pixels and Lottes Mask Strength Dark Pixels.

Here’s another screenshot with the brightness up so it’s more visible.

1 Like

4 Likes

Ok time to use the Debugging settings! Go to the end of the parameter list, there you will see the Show Pass Index parameter, step through this to see what is going on at which level to see what is happening at which stage.

My quick guess is that you have the black area of the game image is brighter than black, due to black level, or just the initial image coming out of the core. I can see this because there is a mask on the green area. To get rid of this adjust the black level or gamma.

The blips in the lines is the mask like cyber mentions. Since this is a black and white vector game a black and white tube should generally not have a mask as far as I understand, so you can set the guest mask to -1 to remove the mask completely.

2 Likes

Thanks, Cyber and HM… I already have the mask set to off… before I posted those screenshots.

I’m taking a look at the debugging options now.

edit The black level seems to have done the trick. I can look at it in splitscreen now and both backgrounds look black instead of greenish. Thank you.

I did also notice that the color correction and upscaling section of the debugging options looks more like the vector lines I’m after.

edit 2 I’m looking at Armor Attack now… another overlay game. It seems like when I reference back to the new vector presets in my old presets that the built in MAME overlay is super bright, causing the green screen, etc… and has to be adjusted to compensate.

2 Likes

So the graphics are being applied in MAME?

Yeah, it’s the MAME video overlay that colors the graphics in some games (can toggle in the MAME tab menu). It seems like the shader from the new vector graphics is causing it to be brighter than usual… which, as you mentioned can be balanced in the shader parameters, but just thought I would mention it looks like that is what is happening.

Here’s a screenshot in splitscreen to show what I’m talking about. On the left is about how I would have had it set up before… on the right is after the new vector presets. You can see the overlay is so bright you can’t see through it.

So this is kind of a weird situation. Usually for any of the shaders we are expecting to get something like the signal sent to the crt from the core, and in case of a vector game we’re expecting just an image of the vectors, no graphics. And the graphic which colors the screen should be added as the colored gel image

2 Likes

I would not recommend this hybrid approach. Using layouts with MAME you have a lot of control, in this situation you have none. :frowning_face:

The tools in the shader do a really good job of this. It is much easier than manually setting up a layout in MAME.

Here is a shot of the new vector preset with no adjustment.

BTW. My preset does away with scanlines and masks.

3 Likes

Hmm… I see what you guys are saying. But I think there’s only a couple arcade vector games that we have an overlay image for, that could be used in place of the MAME built-in overlay colors, unless I’m mistaken.

2 Likes

The MAME built-in overlay colors are just layouts compiled into the binary.

If you look at the source code.

\mame\src\mame\layout\invaders.lay for example.

<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
	<element name="overlay">
		<rect>
			<bounds left="0" top="0" right="224" bottom="260" />
			<color red="1" green="1" blue="1" />
		</rect>
		<rect>
			<bounds left="0" top="184" right="224" bottom="240" />
			<color red="0.125" green="1" blue="0.125" />
		</rect>
		<rect>
			<bounds left="16" top="240" right="134" bottom="260" />
			<color red="0.125" green="1" blue="0.125" />
		</rect>
		<rect>
			<bounds left="0" top="32" right="224" bottom="62" />
			<color red="1" green="0.125" blue="0.125" />
		</rect>
	</element>

	<view name="Color Overlay">
		<screen index="0">
			<bounds left="0" top="0" right="3" bottom="4" />
		</screen>
		<element ref="overlay" blend="multiply">
			<bounds left="0" top="0" right="3" bottom="4" />
		</element>
	</view>
</mamelayout>

You can get the colors and coordinates to create PNGs.

I’m confused though, there aren’t images hardcoded into MAME. You are just talking about the color of the vector lines, correct?

3 Likes

I become less sure of what I’m talking about as we go on, but for Star Castle, as an example, there’s an existing “overlay” .png with the bullseye colors in the middle, and MAME has a built in “overlay” that creates the colors of the vector lines. This one is just off the top of my head but there are other weird ones.

i would prefer fba anyways for vector games (as long as they working) cuz you have the high res mode

i have an overlay made for armor attack one that didn´t work with fba … and you really cant get the same results i guess , at least when i tried it i couldn´t get it to look nearly the same

2 Likes

So just so we are on the same page…

MAME uses “Layouts”.

Retroarch uses “Overlays”.

The Mega Bezel and shaders use image “Borders”.

So… there are hardcoded, simple layouts in the MAME binary. There are soft layouts available as “artwork”… both cannot be used at the same time. Most soft layouts reuse the hard code for screen color overlays and segment LEDS etc.

You can use a hard “layout” with an “overlay” or “bezel” etc…

The issue with the Armor Attack hard layout is the blending modes.

	</element>

	<element name="reflection">
		<image><data><![CDATA[
			<?xml version="1.0" encoding="UTF-8" standalone="no"?>
			<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 400 300" height="300" width="400">
				<rect x="0" y="0" width="400" height="300" fill="#000000" stroke="none" />
				<rect x="2" y="2" width="396" height="297" fill="#17521c" stroke="none" />
				<g fill="#959414" stroke="#000000" stroke-width="1" stroke-linejoin="miter">
					<path d="M 2,2 V 299 H 398 V 2 Z m 296,13 v 37 h 13 v 12 h 12 v 12 h 62 v 61 h -50 v 26 h 50 v 61 h -62 v 12 h -12 v 12 h -13 v 37 h -72 v -49 h -52 v 49 H 102 V 248 H 89 V 236 H 77 V 224 H 15 V 163 H 65 V 137 H 15 V 76 H 77 V 64 H 89 V 52 h 13 V 15 h 72 v 49 h 52 V 15 Z" />
					<path d="m 236,39 h 38 V 77 H 249 V 64 h -13 z" />
					<path d="m 286,100 h 74 v 25 h -49 v 13 h -25 z" />
					<path d="m 286,162 h 25 v 13 h 49 v 25 h -74 z" />
					<path d="m 274,224 v 37 h -38 v -25 h 13 v -12 z" />
					<path d="m 126,224 h 25 v 12 h 13 v 25 h -38 z" />
					<path d="m 114,162 v 38 H 40 v -25 h 49 v -13 z" />
					<path d="m 114,100 v 38 H 89 V 125 H 40 v -25 z" />
					<path d="m 126,39 h 38 v 25 h -13 v 13 h -25 z" />
					<path d="m 175,77 h 50 v 11 h 12 v 13 h 12 v 24 h -98 v -24 h 12 V 88 h 12 z" />
					<path d="m 151,175 h 98 v 24 h -12 v 13 h -12 v 11 h -50 v -11 h -12 v -13 h -12 z" />
				</g>
			</svg>
		]]></data></image>
	</element>

	<view name="Color Overlay">
		<screen index="0">
			<bounds xc="0" yc="0" width="4" height="3" />
		</screen>

		<element ref="transmission" blend="multiply">
			<bounds xc="0" yc="-0.004" width="4.04" height="3.03" />
		</element>
		<element ref="reflection" blend="add">
			<bounds xc="0" yc="-0.004" width="4.04" height="3.03" />
		</element>
	</view>
</mamelayout>

It is using multiply and add blending modes on top of the shaders add/multiply blending modes, which can yield unexpected results.

It appears they are using SVG code that can probably be pasted into an independent document.

Yep…

… so as I said earlier. The info to create any needed assets for the shader are in the MAME source.

2 Likes

Thanks, Duimon… I’ll look it over and see if I can figure it out.

I think this isn’t pushed to live on github.

latest

1 Like

Hey, I’m not sure I understand what you mean

Hmm, maybe you were mixed up about the last release post, it was for the Examples package, not the base Mega Bezel package.

2 Likes