mamedev / mame

MAME
https://www.mamedev.org/
Other
8.42k stars 2.04k forks source link

Add "pyramid" render target mode to BGFX shader JSON #766

Open MooglyGuy opened 8 years ago

MooglyGuy commented 8 years ago

In order to fully port over the HLSL shader system, I'll need some way of accomplishing bloom in a data-driven manner. The idea is to have a render target mode to go with "guest", "native", and "custom", called "pyramid", which defines a cascading set of render targets, starting with native resolution and then being downsized by half repeatedly until the render target's dimensions are less than 2 on any side.

ImJezze commented 8 years ago

Quick note: Since 0.172 the scale factor of the bloom targets is 0.75 instead of 0.5. As it turned out, this scale factor makes the bloom look much less blocky, especially for vector screens. So maybe the scale factor should be a parameter. Furthermore the maximum number of down-scaled targets was decreased to 8 for raster screens, but increased to 15 for vector screens. Another parameter which might also be considered.

MooglyGuy commented 8 years ago

Seems like it would be easy enough to do. And yes, I like the idea of the scale factor being parametric. I could also give it a cutoff limit so that it doesn't loop paste a given maximum. Thanks for the input!