Page 1 of 1

black and white

Posted: Sun Nov 30, 2008 5:10 pm
by Katsankat
Hi,
How to achieve this black and white effect?
Would it be possible (or best) to create a texture having the size of the screen, or place a billboard it in front of the camera, or models and ground have a special texture, or ... I don't know. On a real video you can see the gunner switch quickly between normal and night view like on the image below. It might be a thermal camera as bodies are close to white, like the copter here.
What do you think?
Image

Posted: Sun Nov 30, 2008 5:19 pm
by twilight17
I have very little understanding of shaders, but in my opinion they would be great for that kind of effect.

Posted: Sun Nov 30, 2008 7:32 pm
by JP
Yeah seems like a shader would be the easiest option (if you know how to do shaders!) and then you could add in other cool effects rather than just black and white like making certain objects glow a bit or something.

Posted: Sun Nov 30, 2008 8:44 pm
by Dark_Kilauea
You should be able to render the entire scene to a render texture, render that texture to a quad with a shader to turn color values into a scalar value, then render that quad over the entire screen.

But you are in luck, everything but the shader has been done for you with XEffects (Go look it up in project announcements).

hmm

Posted: Sun Nov 30, 2008 9:35 pm
by 3DModelerMan
You could also just set all the textures to grayscale in photoshop or something.

Posted: Mon Dec 01, 2008 1:54 am
by Murcho
Call of Duty 4 has a level where you play through a thermal camera that looks just like your pic above.

I've done a bit on shaders, and I would recommend looking at post-processing effects. This link has a good look at how to do the thermal shader.

Posted: Mon Dec 01, 2008 2:10 am
by dlangdev
XEffects has screen space filters, though there's no code for the one you're looking for. if there's demand for these XEffect filters maybe someone could write one up and post them here later.

Posted: Mon Dec 01, 2008 8:59 pm
by Katsankat
Thank you for the replies.
This is what i got for now, without effects
Image
FPS are voluntary blocked to 32, otherwise they go beyond 500 FPS even when shooting.

Posted: Mon Dec 01, 2008 10:46 pm
by sudi
well its really simple. i just tried it. with my shaderlib i made the following shaderfile.

Code: Select all

<PostProcess name="BlackWhite" width="800" height="600">
	<Pipeline vertex="standard" fragment=
	"
	uniform sampler2D tex0;
	varying vec2 vTexCoord;
	
	void main()
	{
   		vec4 sample = texture2D(tex0, vTexCoord);
		float a = sample.x+sample.y+sample.z;
		a = a/3;
   		
   		gl_FragColor = vec4(a, a, a, 1.0);
	}
	" target="" tex0="BlackWhite" tex1="" tex2="" tex3="">
	</Pipeline>
</PostProcess>
And then just add some plin noise.

if u want a copy of that lib. just ask.