black and white

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

black and white

Post 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
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

I have very little understanding of shaders, but in my opinion they would be great for that kind of effect.
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post 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.
Image Image Image
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post 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).
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

hmm

Post by 3DModelerMan »

You could also just set all the textures to grayscale in photoshop or something.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Murcho
Posts: 26
Joined: Mon Nov 10, 2008 8:45 am
Location: Australia

Post 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.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post 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.
Image
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Post 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.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Post Reply