1

I would like to apply a color saturation on the entire final renderer.

Is there an easy way to do it without using shaders ? I don't know anything about DirectX :x

I saw an "Effect" parameter in spriteBatch.Begin() but i didn't find any tutorial about it :s

Hope you can guide me.

Sharpnel
  • 173
  • 1
  • 14

1 Answers1

1

You need a shader to this. A shader is an Effect.

You can create a new effect by right clicking a content project, clicking "Add New Item", and selecting a "Effect" file. The resulting .fx file is in the HLSL language. It will be compiled by the content pipeline, and you an load it with:

Effect myEffect = Content.Load<Effect>("myEffect");

There is an official example of how to use effects with SpriteBatch here (if you want desaturation, there's an example in there). And this blog post may also be useful.

I won't reproduce the code for a saturation effect here, but you can find several examples via Google. Here is one example on the GameDev site.

Community
  • 1
  • 1
Andrew Russell
  • 26,924
  • 7
  • 58
  • 104
  • i modified the shader sample to follow my code logic. (Indeed, as you said, it's not too hard) It works. as usual, thx a lot Andrew. – Sharpnel Oct 15 '12 at 14:11