Mega Bezel Reflection Shader! - Feedback and Updates

No problem @RetroGames4K. I understand you’re trying to match an actual set. Do remember that there are several different models of Trinitron sets with different TVLs and also different levels of deconvergence.

I’d say you’re probably already 90% there with your Sanyo Slot Mask Presets. All you might need to do to Trinitronify them might be to turn the Slot Mask Strength Bright and Dark Pixels down to 0 or comment them out in your preset and you’ll have a decent aperture grill at around 300TVL if using Mask 12, Size 1.

You can get a slightly higher TVL by using Mask 6, Size 2, also Mask 10, Size 1 and lastly Mask 6, Size 1.

You might want to experiment with the different Scanline Types as well with GSL 2 giving the darkest and thickest scanlines and you could easily match a PVM, BVM or Consumer Style TV.

1 Like

today i got c64 lighgun games working (the option was elsewhere) and the second game i tried just speaks to me , so i had to share this

6 Likes

Hi p3st, I dropped you a pm. Thank you man.

1 Like

@HyperspaceMadness just updated my post with some additional info.

1 Like

So when you are asking for things to be backported, what you are asking for is a custom branch of the software just for your use. This places a significant burden on maintenance of the package, and what about the next fix that comes out that you would like to be back ported?

Maintaining multiple branches of a package like this is not something I’m prepared to do at this point, because of the effort it would take, effort which instead could go into further work on the Mega Bezel which could be of value to everyone.

I don’t know that this is working the way you are thinking (I’m not sure the one set of parameters is connected to anything).

What I am planning on doing is for the next version make sure we don’t have repeated settings, and see what the visual difference between versions is caused by.

3 Likes

Nice! A little crosspost of an awesome Rastan cover

3 Likes

I understand. A separate branch just for myself isn’t really what I had in mind but I’m learning as we go along. Thanks for the insight.

Okay. You’re probably right. I just thought that the filtering section might have at least contributed to the discrepancy because none of the parameter changes were having any effect and those preset examples used some of those settings to achieve their final look.

My suggestion about keeping the GDV-NTSC around wasn’t really about fixing bugs. I only asked about that because I was thinking about what might have been lost if the GDV-NTSC filtering section had to be swapped out but I’m sure you would have a much better understanding of all of the implications and workings of these things than myself. Thanks again for the insight.

Please forgive my exuberance and at times ignorance.

1 Like

Here you have more screenshots. I’ve optimized brightness, I think is perfect now. At last!:sweat_smile: IMG_20230120_045241 IMG_20230120_045142

4 Likes

Hey guys… I’m looking for some tips on setting up a preset for Irritating Maze. Is it possible to properly line up the “official” bezel from Mr. Do’s pack with the in-game MAME lights? I’m hoping to use opacity to get them to glow through the bezel a bit. I know this won’t look perfect, but it’s the only way I could think of to make a unique bezel for it. Any other ideas are most welcome… would love to hear specifics about what aspect ratio and sizing tips to use to line everything up.

Thanks for the help.

Could you post a picture of the raw mame output and the overlay pointing out what you are trying to do?

I believe this is how it’s supposed to line up. I would probably like to add a marquee (or bottom part of) to use the red light area, and just have the CP area off screen.

1 Like

If you can’t do it by just scaling and positioning the screen then you are out of luck. (You’ll have to play with the aspect also.)

It is a pretty simple layout though.


<mamelayout version="2">
	<element name="bezel">
		<image file="irrmaze_bezel.png" />
	</element>
	<view name="Upright_Artwork">
		<screen index="0">
			<bounds x="408" y="221" width="1200" height="900" />
		</screen>
		<bezel element="bezel">
			<bounds x="0" y="0" width="2000" height="1660" />
		</bezel>
	</view>
</mamelayout>

<!--

- Artwork type: Bezel
- Photographed bezel provided by Bobby Tribble
- Converted for MAME by Mr. Do
- Lay file by Mr. Do

-->

So it should be possible.

Edit: Not going to be possible after all, without some serious effort.

The thing is that applying a layout in MAME disables the hard coded layout. I’m sure there are no flashing lights in MAME standalone using the Mr. Do layout.

In MAME you could recreate the lights and place them where you want but in the shader everything is part of the screen.

You could use the screen only base preset but you would need to edit the hard coded layout and do a custom compile. The hard coded layout is not as simple.

<!--
license:CC0
copyright-holders:Vas Crabb
-->
<mamelayout version="2">
	<!--
	sit0...sit9     TIMER LAMP          *0x10fe1c & 0x03ff
	sit10           TRACK BALL LAMP     *0x10fe1f != 0
	sit11           SIDE LAMP           *0x10fe20 != 0
	sit12...sit13   COLOR LAMP          *0x10fe21 & 0x0003
	sit14           FLASH LAMP          *0x10fe22 != 0
	sit15           ???                 *0x10fe29 != 0
	-->

	<element name="white">
		<rect><color red="1" green="1" blue="1" /></rect>
	</element>

	<element name="marquee">
		<rect><color red="0.5" green="0" blue="0" /></rect>
	</element>

	<element name="colorlamp">
		<rect state="0"><color red="0.4" green="0.4" blue="0.4" /></rect>
		<rect state="1"><color red="1" green="0.3" blue="0.2" /></rect>
	</element>

	<element name="timerlamp">
		<disk state="0"><color red="0.3" green="0" blue="0" /></disk>
		<disk state="1"><color red="1" green="0.3" blue="0.1" /></disk>
	</element>

	<element name="sidelamp">
		<rect state="0"><color red="0.5" green="0.5" blue="0.1" /></rect>
		<rect state="1"><color red="1" green="1" blue="0.5" /></rect>
	</element>

	<element name="flashstick" defstate="1">
		<rect state="0"><color red="1" green="1" blue="1" /></rect>
		<rect state="1"><color red="0" green="0" blue="0" /></rect>
	</element>

	<element name="flashgrille" defstate="1">
		<disk state="0"><color red="1" green="1" blue="1" /></disk>
		<disk state="1"><color red="0" green="0" blue="0" /></disk>
	</element>

	<element name="cpanel">
		<rect><color red="0.4" green="0.4" blue="0.4" /></rect>
	</element>

	<element name="trackball">
		<disk state="0"><color red="0.6" green="0" blue="0" /></disk>
		<disk state="1"><color red="0.9" green="0.5" blue="0.1" /></disk>
	</element>

	<element name="redbtn">
		<disk state="0"><color red="0.7" green="0" blue="0" /></disk>
		<disk state="1"><color red="0.35" green="0" blue="0" /></disk>
	</element>

	<element name="bluebtn">
		<disk state="0"><color red="0.2" green="0.5" blue="1" /></disk>
		<disk state="1"><color red="0.1" green="0.25" blue="0.5" /></disk>
	</element>

	<view name="Cabinet Lamps">
		<screen index="0"><bounds x="3.5" y="4.4" width="16" height="12" /></screen>

		<collection name="Marquee and Timer Lamps">
			<element ref="marquee"><bounds x="0" y="0" width="23" height="2.5" /></element>
			<element ref="colorlamp" name="sit13"><bounds x="0" y="0" width="11.5" height="1" /></element>
			<element ref="colorlamp" name="sit12"><bounds x="11.5" y="0" width="11.5" height="1" /></element>
			<element ref="timerlamp" name="sit9"><bounds x="2" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit8"><bounds x="4" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit7"><bounds x="6" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit6"><bounds x="8" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit5"><bounds x="10" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit4"><bounds x="12" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit3"><bounds x="14" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit2"><bounds x="16" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit1"><bounds x="18" y="1.25" width="1" height="1" /></element>
			<element ref="timerlamp" name="sit0"><bounds x="20" y="1.25" width="1" height="1" /></element>
		</collection>

		<element ref="flashstick" name="sit14"><bounds x="0.75" y="6.5" width="1.5" height="5.5" /></element>
		<element ref="sidelamp" name="sit11"><bounds x="0.5" y="12.5" width="2" height="4.5" /></element>
		<element ref="flashstick" name="sit14"><bounds x="20.75" y="6.5" width="1.5" height="5.5" /></element>
		<element ref="sidelamp" name="sit11"><bounds x="20.5" y="12.5" width="2" height="4.5" /></element>
		<element ref="flashgrille" name="sit14"><bounds x="7" y="17.25" width="3" height="2.5" /></element>
		<element ref="flashgrille" name="sit14"><bounds x="13" y="17.25" width="3" height="2.5" /></element>

		<collection name="Control Panel">
			<element ref="cpanel"><bounds x="4.5" y="20" width="14" height="7" /></element>
			<element ref="trackball" name="sit10"><bounds x="10" y="22" width="3" height="3" /></element>
			<element ref="bluebtn" inputtag="edge:irrmaze:START" inputmask="0x01"><bounds x="11.125" y="20.125" width="0.75" height="0.75" /></element>
			<element ref="redbtn" inputtag="edge:irrmaze:BUTTONS" inputmask="0x10"><bounds x="7" y="23" width="1" height="1" /></element>
			<element ref="bluebtn" inputtag="edge:irrmaze:BUTTONS" inputmask="0x20"><bounds x="5" y="22.5" width="1" height="1" /></element>
			<element ref="redbtn" inputtag="edge:irrmaze:BUTTONS" inputmask="0x40"><bounds x="15" y="23" width="1" height="1" /></element>
			<element ref="bluebtn" inputtag="edge:irrmaze:BUTTONS" inputmask="0x80"><bounds x="17" y="22.5" width="1" height="1" /></element>
		</collection>
	</view>

	<view name="Screen 0 Standard (320x224)">
		<screen index="0">
			<bounds left="0" top="0" right="4" bottom="3" />
		</screen>
	</view>

	<view name="Screen 0 Cropped (304x224)">
		<element ref="white">
			<bounds x="8" y="0" width="304" height="240" />
		</element>
		<screen index="0" blend="multiply">
			<bounds x="0" y="0" width="320" height="240" />
		</screen>
	</view>

	<view name="Screen 0 Stretched (304x224)">
		<bounds left="8" top="0" right="312" bottom="228" />
		<element ref="white">
			<bounds x="8" y="0" width="304" height="228" />
		</element>
		<screen index="0" blend="multiply">
			<bounds x="0" y="0" width="320" height="228" />
		</screen>
	</view>
</mamelayout>

Which is why you have the fancy lights.

This would be a LOT of tedious trial and error and probably not worth it for one game.

1 Like

The lights are actually flashing if you just enable them in the MAME tab video settings.

That will turn on the hard coded layout, but it has no relation to the soft layout. If you wanted the lights to match up with transparencies in the graphic, the hard coded layout would have to be modified to work. (And compiled into the binary.)

I went through the effort years ago for my MAME Spacewar! layout.

Original Spacewar! hard coded layout.

New hard coded layout.

3 Likes

Here’s what I came up with… I had to resize elements of the bezel art to fit the lights properly. The overlay still needs some cleanup and I found out I didn’t have an image of the red light part of the marquee, so I just colored it red for now, over the lights. Duimon, you were probably right that it was too long to spend on one game, but I felt like I wanted to do something for it since it was a unique cabinet.

3 Likes

I would have spent less time answering if I had known you were willing to modify the original art.

Nice work.

1 Like

This is why I like to use Integer Scale Mode + Integer Scale Offset + Bezel Independent Scale when using certain masks in my SNES presets.

Observe the power bars.

2 Likes

What does bezel independent scale do? These options look really good. I found some weird patter in Rastan’s life bar, and always thought that something was missing there and in other games always found life bars a bit different from a CRT, and it would be nice to align the stripes I think these are good options… Here’s a pic of Rastan’s life bar… It has odd stripes, they don’t look simetrical…

2 Likes

This is generally not needed, it is only useful in situations where you have a bezel as part 9f one of the images and so you want the bezel to be transparent and stick to it and not scale with the screen/tube, so basically the graphics stay static while the tube is scaled inside them.

I say it’s generally not needed because you usually can and want the graphics to scale with the screen/tube

This is because of the crt curvature and the uncurving mask, to get rid of this you should set the crt curvature multiplier to 0.

2 Likes

In my examples above if I leave Bezel Independent Scale Off and leave Integer Scale Mode Offset on 0, I still get the anomalies. It’s only when I increase it to 1 (or alternatively step up to the next Max Integer Scale Height % stop) that everything seems to render cleanly in all SNES games I’ve tested so far.

If I try to do this while leaving Bezel Independent Scale Off, too much of the Bezel/Frame ends up off screen and it doesn’t look nice in my opinion. In the case of my presets which include graphics, I at least wanted the top of Bezel/Frame to be aligned with the top of the graphics and for the Bezel/Frame not to overlap with the graphics which are already at the extreme horizontal edges of the screen so there’s not much room for the Bezel/Frame to grow without some overlap there.

As mentioned, this power bar rendering anomaly doesn’t seem to occur when using all mask type and size combinations.

Some of them look completely fine without increasing the Integer Scale (and possibly even using Non-integer scale).

In my examples above the issue is present even with Curvature turned off.

In my further testing, I’ve observed a strip where there’s overlapping going on between different layers behind the bezel which is increasing the brightness. It’s not just reflection but also the non-mirrored edges of the viewport being filtered/blurred and “shining through”. This seems to be mixing with the reflections which are stemming from the reflection plane, which starts at the edge of the content, even if the edge is supposed to be obscured by the bezel, (which is possibly incorrect behaviour) but that plane is not lining up with the inner edge of the tube/bezel or otherwise scaling properly.

I’ve observed some further strange behaviour where when using Bezel Independent Scale and some of the image is cut off, if I reduce the Integer Scale Offset or even use Non-integer Scale the reduced image, part of the image that was off screen/beneath the Bezel is still missing.

When I tried the new Show Pass debugging tool, I think I was able to see the strip of overlap when showing either Pass 2 or 3.

Adjusting the Inner Black Edge Thickness seemed to have an effect on the strip of overlap.

If Bezel Independent Scale is not used, everything “seems” fine including where the reflections stem from.

I say “seems” because I haven’t really gone back and scrutinized the reflection with Bezel Independent Scale Turned Off to see if there might be other less obvious anomalies which I might have previously missed.