Code Snipped: Contrast Shader

This simple post effect shows how to change the constrast of an image.
We just recover the texture color and apply a simple approximated Contrast equation.

This approach is very simple and give good results

sampler baseSampler : register(s0);

float Contrast;

float4 PixelShader1( float2 Tex : TEXCOORD ) : COLOR0
float3 Color =  tex2D(baseSampler, Tex);
Color = Color - Contrast * (Color - 1.0f) * Color *(Color - 0.5f);
return float4(Color,0);

technique contrast
    pass p0
        PixelShader = compile ps_2_0 PixelShader1();


  1. #1 by jasapembersih acp di semarang on 21 de julho de 2017 - 12:03 pm

    Ahaa, its good dialogue concerning this article here at this weblog, I have
    read all that, so now me also commenting at this place.

  2. #2 by php ecommerce on 21 de julho de 2017 - 12:12 pm

    very handful of websites that take place to be comprehensive beneath, from our point of view are undoubtedly well worth checking out

  3. #3 by سرور مجازی لینوکس on 21 de julho de 2017 - 12:45 pm

    Appreciate a excellent writeup سرور مجازی لینوکس. Them in fact once were your leisure bill the item. View advanced to more provided reasonable from you! Incidentally, how should we speak?

  4. #4 by PHP Programmer on 21 de julho de 2017 - 1:47 pm

    that may be the end of this report. Right here youll uncover some web sites that we feel youll enjoy, just click the hyperlinks over

  5. #5 by tar music instrument on 21 de julho de 2017 - 2:05 pm

    I’m not sure exactly where you might be getting the info, yet superior topic tar music instrument. My partner and i has to spend an afternoon finding out a lot more or maybe comprehending additional. Appreciation for wonderful facts I’m trying to find this data in my assignment.

  6. #6 by on 21 de julho de 2017 - 2:15 pm

    This one item was with that great rates I by no means believe on grade would be so exceptional. It’s pretty. This mama is going to like that upon Christmas time early morning after she opens gift therefore looks as though I devoted even more, although rates was really very good!!

  7. #7 by Health and Fitness on 21 de julho de 2017 - 2:56 pm

    I haven’t checked in here for a while since I thought it was getting boring, but the last few posts are great quality so I guess I will add you back to my everyday bloglist. You deserve it my friend :)

  8. #8 by on 21 de julho de 2017 - 3:10 pm

    I’m gone to say to my little brother, that he should also pay a quick visit this website on regular basis to obtain updated
    from hottest news update.

1 640 641 642
(não será publicado)