PDA

View Full Version : Sin City style post-process effect


Methulah
10-08-2005, 03:09 PM
Hey all.
Do any of you know what would be involved to make a Sin City style shader for the Source (Haf-Life 2) engine? I'm afraid my knowlege of graphics programming is pretty shocking, but I can do some basic things in HLSL.

If anyone knows how this is done, or a tutorial that would allow me to do it, that would be fantastic.

(Note: For all you that didn't watch Sin City, first off, you should. It was awesome, and secondly, the effect is an almost grayscale, except that there is a little bit of color. Kind of like turning down the color setting on your TV to the lowest setting where you can still see color.)

('nother note: For those of you who have seen Sin City, I'm not fussed about the reds and yellows coming up as bright. All colors can be uniform.)

kusma
10-08-2005, 03:55 PM
try calculating the luminosity of the color, and blend all three components with that.
should be something like this:

float lum = color.r * 0.299 + color.g * 0.587 + color.b * 0.114;
float3 diff = float3(lum, lum, lum) - color.rgb;
color.rgb += diff * t;

where t is a factor between 0 and 1 controlling how saturated the colors are. the color-weighting in the luminosity-calculations are accoding to NTSC.

Methulah
10-08-2005, 09:57 PM
Right, I did some more research and found out that Source Engine has a DLL for all the post-process effects. I think that adding that would probably achieve the effect I want. If I get bored I might even have it so that when the player goes into bullet-time, the world is coloured normally. Thanks for your time.