Page 1 of 1

Make env on the objects ?

Posted: Wed Apr 16, 2008 11:29 pm
by arfgh
Can someone help me to make some basic environment effect on the objects ? I have no idea to how to make that. thx

Posted: Thu Apr 17, 2008 2:09 am
by Ion Dune
I'll assume you mean at least fog, so I'll point you to some tutorials. Tutorials are, after all, best for when you have no idea how to do something.

http://irrlicht.sourceforge.net/tut011.html

http://irrlicht.sourceforge.net/tut008.html

That should cover what you're aiming for (specifically the first one, which contains fog).

Posted: Thu Apr 17, 2008 7:16 am
by JP
yeah try and be a bit more descriptive... what do you mean by environment effect? That could mean any number of things and we can't really help you much by just guessing at what you mean!

Posted: Thu Apr 17, 2008 10:52 am
by arfgh
No, is not fog.

Imagine for example a real car, ok ? its body have some type of environment reflection. That is a little shiny effect showind a static map we can make.

Of course i not plan to make environments as are showed on the Gran Turismo GT5 playstation 3 game. I only want to make a basic one.

is that posible with irrlicth ?

Posted: Thu Apr 17, 2008 10:55 am
by JP
Yeah, you can check out Christian Clavet's 'Level Demo' in the projects forum which used a reflection layer on a bus, though this was a pre-rendered reflection and didn't actually work too well when i saw it running.

You can also do dynamic reflections using RTT and possibly shaders.

Or are you more talking about specular highlights? Those can be set in the material parameters, though i've never really seens them give much effect...

Posted: Thu Apr 17, 2008 11:07 am
by bitplane
You can use the sphere map material for this kind of basic environment map. If you want something more complex, check out the metal materials in rendermonkey, you can add them to irrlicht like in the shader example

Posted: Thu Apr 17, 2008 3:05 pm
by arfgh
No

i dont want to make nothing so complex, just a basic effect where we have a simple texture and we want to add it as env to the models. This type of effect just cause some type of metallic shiny on the model, just the type of effect a car body needs, true ?

how can i do that ?

Posted: Thu Apr 17, 2008 4:13 pm
by radiant
OK... im definitely no expert in this... but just from cheking tutotial 11 and playing a little with the code u can figure out how to make textures have some reflection... im sure its probably not the best way to do it but u can try this in the tutorial 11 code:
change this:

Code: Select all

room->getMaterial(0).MaterialTypeParam = 0.035f; 
to this:

Code: Select all

room->getMaterial(0).MaterialTypeParam = 1.035f; 
just play with those values and see what happends... now comment the heightmap code... and see what happends(or just set the height to 0 like this:

Code: Select all

driver->makeNormalMapTexture(normalMap, 0.0f);
)and see what happends...

hope it helps...

Posted: Thu Apr 17, 2008 6:24 pm
by Kriolyth
Yes, it is possible.

If you have a static camera, but you want to rotate the car, you can use a sphere map. You take 1 texture of the environment to be reflected and warp it (I'm quite sure there are plenty programs that do the warp for you). Then you set environment texture as a second texture for SPHERE_MAP material.

If you want to move the camera as well, you must use a cube texture and write your own shader (or find an existing one).

Anyway, google for "Evironment mapping", there are a few interesting articles.

Posted: Sun Apr 20, 2008 12:14 am
by arfgh
Kriolyth, can you show an example of that ? thx

Posted: Sun Apr 20, 2008 4:49 am
by BlindSide