MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Shader Floor
#333257 - 10/15/14 11:10 PM


Hi,

Now that 0155 is out, I wanted to play with the SDL shader a bit more and was wondering if someone might be able to help me or point me in the right direction. When using HLSL on my cabinet, I wanted to boost the floor a bit so that the screen stands out from the artwork (meaning black isn't totally black). I realize that probably goes against the grain since CRTs tend to have nice blacks. That having been said, it's something I want to do to help with the illusion of a CRT in the middle of a virtual cabinet.

Using HLSL I just set bump up floor a little to something like:
Code:

floor 0.05,0.05,0.05


However using a shader (Timothy Lottes as moded by SoltanGris42) I only seem to be successful in bosting the overall gamma, which I'm trying to avoid. What I initial did was to adjust the "gammaBoost":
Code:

const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15, 1.0/1.3);


Which is used in the gama boot section:
Code:

#ifdef GAMMA_CONTRAST_BOOST
gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip);
#endif
gl_FragColor=vec4(clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0) , 1.0);


I see why this doesn't do what I want since it affecting overall gamma. Is there an (easy) way to just boost the floor a bit and not the entire gamma?

Thanks!



SoltanGris42
MAME Fan
Reged: 11/16/13
Posts: 134
Send PM


Re: Shader Floor new [Re: lamprey]
#333270 - 10/16/14 04:18 AM


> Hi,
>
> Now that 0155 is out, I wanted to play with the SDL shader a bit more and was
> wondering if someone might be able to help me or point me in the right direction.
> When using HLSL on my cabinet, I wanted to boost the floor a bit so that the screen
> stands out from the artwork (meaning black isn't totally black). I realize that
> probably goes against the grain since CRTs tend to have nice blacks. That having been
> said, it's something I want to do to help with the illusion of a CRT in the middle of
> a virtual cabinet.
>
> Using HLSL I just set bump up floor a little to something like:floor 0.05,0.05,0.05
> However using a shader (Timothy Lottes as moded by SoltanGris42) I only seem to be
> successful in bosting the overall gamma, which I'm trying to avoid. What I initial
> did was to adjust the "gammaBoost":const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15,
> 1.0/1.3);
> Which is used in the gama boot section:#ifdef GAMMA_CONTRAST_BOOST
> gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip);
> #endif
> gl_FragColor=vec4(clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0) , 1.0);
>
> I see why this doesn't do what I want since it affecting overall gamma. Is there an
> (easy) way to just boost the floor a bit and not the entire gamma?
>
> Thanks!

Just set "blackClip" to a negative number. You might also need to lower "brightMult" afterwards. You would need to have "GAMMA_CONTRAST_BOOST" enabled.

EDIT: This looks gross with curvature enabled though because it raises the black level of the whole rectangular tecture.

As a side note, "gammaBoost" should have the same number 3 times if you don't want the color to shift. If it wasn't originally, then that was just a mistake on my part.

Edited by SoltanGris42 (10/16/14 04:22 AM)



lamprey
MAME Fan
Reged: 12/01/11
Posts: 238
Send PM


Re: Shader Floor new [Re: SoltanGris42]
#333273 - 10/16/14 04:29 AM


> EDIT: This looks gross with curvature enabled though because it raises the black
> level of the whole rectangular tecture.
>
> As a side note, "gammaBoost" should have the same number 3 times if you don't want
> the color to shift. If it wasn't originally, then that was just a mistake on my part.

LOL, I was just about to reply saying that.

Yeah, the gammaBoost did have three numbers of the same value (1.0), I was trying to give a slight boost the blue.


Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 165 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1425