DMG Shader


[QUOTE=hunterk;21860]@Tatsuya79 you can add multiple LUTs to a cgp[/QUOTE]

Thanks I figured it out!


Here is a new one for The Neo-Geo Pocket Color.

This time I did it from a real photo, a bit of a hassle as it needed the whole glass screen cover to be remade. But it ended up better than expected, with the fake sun reflection on top (I was ready to give up on that half way).


Thanks to Evan Amos for the great original photography.

edit: Newer version here

If anyone knows how to change the aspect ratio in dmg gb-pass5 please tell me (for the Game Gear version).


On line 80: float2 scale = (IN.output_size / IN.video_size) / SCALE; Try changing IN.video_size to: float2(160.0, 144.0)

The border shaders I made are all set to 4:3 and I think that’s what I changed to make them as such…


[QUOTE=hunterk;21954]On line 80: float2 scale = (IN.output_size / IN.video_size) / SCALE; Try changing IN.video_size to: float2(160.0, 144.0)

The border shaders I made are all set to 4:3 and I think that’s what I changed to make them as such…[/QUOTE]

This gives me an half size picture in a 1.1 ratio.

edit: OK found a way. I changed line 83 with:

oTex = middle + diff * scale * float2(0.8326,1);

that makes 4/3 at a perfect 768 x 576 pixels after thousands of screenshots and measurements. lol


Added the Game Gear at last…

Took the photo from wikipedia, nothing better around. It was annoying because of the pronounced lighting on the glass and high brightness.


You’ll notice the subpixels of the lcd grid aren’t perfectly in line, that’s because of the resizing that shader doesn’t like. (edit: it’s perhaps worse than that, my scaling hack isn’t spot on it seems…) (edit2: fixed the problem)

…and I turned the Neo-Geo Pocket On this time (the led was off :stuck_out_tongue: ).

edit: Newer version here


Well, I can’t make the Game Gear rendering better with lcd-cgwg. I think it just doesn’t like non square pixels and then the border pass emphasizes the problem.

Found the logical number to change the screen ratio in the border/

line 80: float2 scale = (IN.output_size / (IN.video_size * float2(1.2,1))) / SCALE;

We want 4/3 but it’s in 160/144 so we do (4/3)/(160/144)= 1.2

And it doesn’t help with the problem though.


Is that including when you set the lcd_grid pass to use linear filtering?


Forget it I found a stupidly simple fix. I use the original gb-pass5 again and I just multiplied every scale_x of the lcd pass by 1.2 in the cgps.

Now the scaling is a lot nicer.

I updated the archive above.


I added the game gear and ngpc borders and renamed the whole dmg-shader subdir to be more generic, since it’s more than just dmg now. I also did some really slight blurring to the gg and ngpc images to make them compress better. Got the filesizes down to about half the original sizes.


[QUOTE=hi-ban;12280]Another update. The last one had too blueish pixels. So i took the dust off my old Gameboy and redid the colors, comparing them with the GB so they are as close as possible to the real thing. I also noticed that the almost-darkest color was darker in the real GB, so i rebalanced the grey levels. I also noticed that the screen of the real GB is very, very yellow. So i changed the palette to reflect that. Also made the border image less blueish, so the grey color of the bezel is grey. Here is the result:




lovely! nice work, fella



You have some duplicates there it seems: gg-4x / gg-shader-4x…


bah, crap. I had hoped git would see the renames. guess not :confused:

I’ll delete those by hand, I suppose…

EDIT: and done.


Made one for people who don’t have a Wii U but wish they did :stuck_out_tongue:

It’s setup for NES/SNES with crop overscan turned off, but I added some runtime parameters for fixing systems with other resolutions.


I modified the pocket/standard borders to try to get rid of the bending caused by the “glass gradient”. I applied a 1% opacity layer with some monochrome noise to make for a manual dithering. It works quite well on the gbp. old version / new version

The gb case is a bit more difficult as the yellowish background seems to make things hard. It’s a bit better though.

Of course the file size gets a bump as the png gets more details. edit: Newer version here

Overwrite the files in the resources folder.

edit: If you’re mainly using the pocket version, in try to use define grey_balance 3.0 instead of 2.6

Makes more difference between the grey tones. 2.6 is good for the standard non-pocket gameboy though.

I haven’t really tweaked those values at all, it could be improved.


[QUOTE=hi-ban;15617]I saw someone requested having 7x and 8x versions of the shaders, so i added them:[/QUOTE]

I’ve been spending the last hour trying to convert this to GLSL using

Gg version: GLSL version:

The pixels or dots are somewhat merged vertically. What am I missing?


I think all of the pixels are taller than usual and it’s making them overlap.


Dang, I’ve narrowed it down to the 4th pass. All the others are working fine!


Cg script for that pass:


Hunterk, there is some data you lost on the DMG shader when you unified the shader files. Some parameters were different in some specific shaders to compensate color distortion caused by the pixels:

For dmg-shader-2x: adjacent_texel_alpha_blending is 0.38 pixel_opacity is 0.90 shadow_opacity is 0.90

For dmg-shader-3x: adjacent_texel_alpha_blending is 0.42 pixel_opacity is 0.80 shadow_opacity is 0.80

For dmg-shader-4x, 5x, 6x, 7x, and 8x: adjacent_texel_alpha_blending is 0.34 pixel_opacity is 0.80 shadow_opacity is 0.80

Oh, and for all of them i recommend, in, to increase response_time from 0.20 to 0.33. This will add a little bit more ghosting to the pixels, more close to the real DMG display.

Sorry, i had problems retrieving my password and couldn’t post until now.


k, that should be easy enough to add parameters to the cgps to fix. I’ll try to handle that asap


[QUOTE=hi-ban;15617]I saw someone requested having 7x and 8x versions of the shaders, so i added them:[/QUOTE]

Does one need to fix anything if they have downloaded from the above link ? (from hi-ban page 2 )