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

HLSL shader improvements #173

Merged
merged 5 commits into from May 11, 2015
Merged

HLSL shader improvements #173

merged 5 commits into from May 11, 2015

Conversation

ImJezze
Copy link
Contributor

@ImJezze ImJezze commented May 3, 2015

I'm working on some improvements and additional features for the HLSL shader implementation. There are still unfinished tweaks on my list, but I'm quite happy with the results so far.

I would be pleased, if you merge the current changes into the official MAME/MESS codebase.

- changed shadow mask implementation, shadow count XY now represent the
number of pixel the shadow UV sized tiles will take on the screen
- implemented rotation of the shadow mask texture depending on the
default landscape or portrait view of the screen
- removed prescale and pixel border of the shadow mask texture
- added option to change the shadow UV offset, to reduce the color
bleeding of the shadow mask
- adjusted presets to work with the changed mask implementation
- reduced defocus offset
- improved downsampling for better blurring
- improved alignment of bloom layers (raster and vector)
- applied bloom effect to the render output of screenshot and AVI
recording
- changed curvature effect to fit screen size
- changed scanlines to be not rendered into bloom layers
- changed shadow mask to be not rendered into bloom layers
- changed color floor to not light the bloom layers
- changed shadow mask to not dark the color floor
- added image vignetting simulation and option
- added round screen corner simulation and option
- added screen light reflection simulation and option
- made usage of unused brightness offset (additive)
- removed unused pincushion option
- removed duplicate shadow count Y options
- removed artwork/adapture.png
- added artwork/adapture-grill.png
- added artwork/shadow-mask.png
- added artwork/slot-mask.png
- added hlsl/simple.fx
- removed unused shaders::blit() function
- added shaders::screen_pass() function, which handles the
(raster-)rendering on screen, into screenshot and AVI recording
- added effect:set_bool() function
@rb6502
Copy link
Contributor

rb6502 commented May 6, 2015

Could you describe briefly what this fixes/improves please? :)

@cuavas
Copy link
Member

cuavas commented May 6, 2015

He describes it in detail in the commit message for a70198a. Expand it by clicking the "...: above. I really don't see how you could make it brief given all the things he's done ;)

@ImJezze
Copy link
Contributor Author

ImJezze commented May 6, 2015

As Cuavas said. :)

But in addition and for documentation I could show you some before and after results of changes that are described too briefly.

@rb6502
Copy link
Contributor

rb6502 commented May 6, 2015

Ahh, my bad. Thanks! :) I'll apply this later today if nobody beats me to it.

- fixed usage of OrientationSwapXY shader parameter
- added RotationSwapXY shader parameters to consider the user defined
screen rotation
- added missing RotationSwapXY shader paramter
- fixed curvature zoom to fit the screen size in any aspect ratio
rb6502 added a commit that referenced this pull request May 11, 2015
Many HLSL shader improvements [Jezze]
@rb6502 rb6502 merged commit 26572a8 into mamedev:master May 11, 2015
@rb6502
Copy link
Contributor

rb6502 commented May 11, 2015

Jezze, could we get a preferred license for your changes? Most of the project's going with either BSD-3-Clause or GPL, but pick whatever you like. Thanks!

@ImJezze
Copy link
Contributor Author

ImJezze commented May 11, 2015

I'm not quite familiar with all the difference between those licenses, but I want that source changes will be reflected back to MAME. I think the GPL ensures that.

@Lord-Nightmare
Copy link
Contributor

There's definitely still a few HLSL issues, even with this patch. For instance, adjusting the screen curvature causes the scanlines to diverge at the screen edges rather than converge, which looks very weird and unrealistic; the scanlines should follow the screen curvature and the input pixel lines exactly.
EDIT: The above is actually NOT true, this is an extremely unfortunate case of moire effects on the scanlines, which i'm unsure the best way to get rid of (supersampling of the post-scanline texture?)
(I used the canon cat 'cat' MESS driver as an example, as that driver would benefit greatly from HLSL due to its prominent scanlines and extremely long phosphor persistence in real life)

Also (and this may be unrelated to this patch in particular), resizing the window in windowed mode seems to cause the hlsl slider settings as set in the tab menu to reset themselves to whatever was loaded from the .ini (or whatever was default); the changed slider settings don't seem save at all even within a single mame/mess session.

@u-man74

This comment has been minimized.

@Lord-Nightmare
Copy link
Contributor

Yes, the cause of the resize error existed prior to this; I edited my report above (you can see it on the github page); The cause of the "diverging" lines is not caused by your patch, it is a moire artifact caused by scanlines being so thin that whatever the next texture is which samples the scanline-applied texture in the hlsl 'stack' causes pseudo-scanlines to appear in a moire pattern. I'm not sure the best way to fix this.

@u-man74

This comment has been minimized.

ICEknigh7 added a commit to ICEknigh7/mame that referenced this pull request Jun 8, 2022
- Balalín (type-in, MicroHobby mamedev#125) [Ignacio Prini]
- Magnus Zone (type-in, MicroHobby mamedev#126) [Ignacio Prini]
- Oráculo Egipcio (type-in, MicroHobby mamedev#127) [Ignacio Prini]
- Demolition (type-in, MicroHobby mamedev#128) [Ignacio Prini]
- Basket Trainer (type-in, MicroHobby mamedev#129) [Ignacio Prini]
- Galaxy Fun (type-in, MicroHobby mamedev#130) [Ignacio Prini]
- Micro Draw (type-in, MicroHobby mamedev#131, mamedev#132) [Ignacio Prini]
- El Alambrista (type-in, MicroHobby mamedev#133) [Ignacio Prini]
- Ranamirez (type-in, MicroHobby mamedev#134) [Ignacio Prini]
- Fórmula Suicida (type-in, MicroHobby mamedev#135) [Ignacio Prini]
- Phantasmas (type-in, MicroHobby mamedev#136) [Ignacio Prini]
- Dardos (type-in, MicroHobby mamedev#137) [Ignacio Prini]
- S.E.M.I.S.I.S. (type-in, MicroHobby mamedev#138, mamedev#139) [Ignacio Prini]
- Alley's Gun (type-in, MicroHobby mamedev#140) [Ignacio Prini]
- Kleingeld (type-in, MicroHobby mamedev#141, mamedev#142) [Ignacio Prini]
- Caribe’s Day (type-in, MicroHobby mamedev#143) [Ignacio Prini]
- Rally (type-in, MicroHobby mamedev#144) [Ignacio Prini]
- La Profecía (type-in, MicroHobby mamedev#145) [Ignacio Prini]
- Mine Alert (type-in, MicroHobby mamedev#146, mamedev#147) [Ignacio Prini]
- Freddy (type-in, MicroHobby mamedev#148) [Ignacio Prini]
- Russian's Attack (type-in, MicroHobby mamedev#149, mamedev#150) [Ignacio Prini]
- En Ruta (type-in, MicroHobby mamedev#151) [Ignacio Prini]
- Zinco (type-in, MicroHobby mamedev#152) [Ignacio Prini]
- Ruffo’s Dream (type-in, MicroHobby mamedev#153) [Ignacio Prini]
- Crozet (type-in, MicroHobby mamedev#154) [Ignacio Prini]
- Rock Animation (type-in, MicroHobby mamedev#155) [Ignacio Prini]
- Bunker (type-in, MicroHobby mamedev#156) [Ignacio Prini]
- Telepuzzle (type-in, MicroHobby mamedev#157) [Ignacio Prini]
- Golfo Pérsico (type-in, MicroHobby mamedev#158) [Ignacio Prini]
- Mad Drivers (type-in, MicroHobby mamedev#159) [Ignacio Prini]
- Bowling Star (type-in, MicroHobby mamedev#160) [Ignacio Prini]
- Gas-Car (type-in, MicroHobby mamedev#161) [Ignacio Prini]
- Ghost Like (type-in, MicroHobby mamedev#162) [Ignacio Prini]
- Sky Invaders (type-in, MicroHobby mamedev#163) [Ignacio Prini]
- Perico Jones (type-in, MicroHobby mamedev#164) [Ignacio Prini]
- Brad Zotes (type-in, MicroHobby mamedev#165) [Ignacio Prini]
- Striker (type-in, MicroHobby mamedev#166) [Ignacio Prini]
- Indy (type-in, MicroHobby mamedev#167) [Ignacio Prini]
- Topin (type-in, MicroHobby mamedev#168) [Ignacio Prini]
- Starlike (type-in, MicroHobby mamedev#169) [Ignacio Prini]
- Tres en Raya (type-in, MicroHobby mamedev#170) [Ignacio Prini]
- Goteras (type-in, MicroHobby mamedev#171) [Ignacio Prini]
- Parvision (type-in, MicroHobby mamedev#172) [Ignacio Prini]
- Furax (type-in, MicroHobby mamedev#173) [Ignacio Prini]
- Duck Shooting (type-in, MicroHobby mamedev#174) [Ignacio Prini]
- Nomen Rosae (type-in, MicroHobby mamedev#175) [Ignacio Prini]
- PunkyMan (type-in, MicroHobby mamedev#176) [Ignacio Prini]
- El Retorno del Yedi (type-in, MicroHobby mamedev#177) [Ignacio Prini]
- Sky Warrior (type-in, MicroHobby mamedev#178) [Ignacio Prini]
- Reptkon (type-in, MicroHobby mamedev#179) [Ignacio Prini]
- Intro (type-in, MicroHobby mamedev#180) [Ignacio Prini]
- Keops (type-in, MicroHobby mamedev#181) [Ignacio Prini]
- Sir Gawain (type-in, MicroHobby mamedev#182) [Ignacio Prini]
- Snake (type-in, MicroHobby mamedev#183) [Ignacio Prini]
- Microbowl (type-in, MicroHobby mamedev#184) [Ignacio Prini]
- God Save the Punk (type-in, MicroHobby mamedev#185) [Ignacio Prini]
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

Successfully merging this pull request may close these issues.

None yet

5 participants