Page 1 of 1

Support for "NULL" materials

Posted: Tue Dec 26, 2006 6:29 pm
by Legion
Hey.

Im currently building collision support into my game and i noticed the
absense of a NULL material.
Ok, let me explain:
In certain games it's very common that you build solid collision primitives,
these are only part of collision detection/handling and shouldn't be rendered.
This is to keep the player from entering sections of maps which are
only there for visual aspects and also to not let the player fall.

Setting these polygons to fully transparent will still cause them to be rendered.
Another solution would be splitting the level into 2 meshes.
Both used for collision, but only one used for rendering.

Though easiest(and cheapest) would be to introduce a NULL materialtype,
which won't render anything as long as it's set.
Even if it might not be a large amount of tris it's still data that doesn't
have to be thrown at the GPU.
This is mostlikely the solution i'll make for myself.

Posted: Tue Dec 26, 2006 7:45 pm
by bitplane
the 2 mesh solution is the most sensible, that way your backgrounds aren't included in the triangle selectors and your collision mesh can be much simpler than your level mesh.
having said this, a material flag for invisibility would certainly be useful for debugging

Posted: Tue Dec 26, 2006 8:54 pm
by RapchikProgrammer

Code: Select all

node->isVisible(false); 
I think this shud work????

Posted: Tue Dec 26, 2006 11:28 pm
by Legion
RapchikProgrammer wrote:

Code: Select all

node->isVisible(false); 
I think this shud work????
No, we're talking about selective polygons, not nodes.
That is polygons with a certain material are culled in the rendering cycle.

But yeah, splitting the mesh would work, mostlikely not in realtime :/
Im doing a seamless design where the entire world is broken up into
virtual sectors. When the player is getting near a new sector, objects from it
will be preloaded if within a certain radius from the player.
So loading has to be cheap.
Have to sit down and do some more design tomorrow.

Posted: Wed Dec 27, 2006 12:37 am
by vitek
In certain games it's very common that you build solid collision primitives, these are only part of collision detection/handling and shouldn't be rendered.
In my experience that data may exist in the mesh, but it would usually be stripped out before any rendering would happen. You would load the entire mesh from disk, build your collision mesh, then delete the collision only polygons.

That isn't something that you could easily do with Irrlicht. You could more easily load the visual mesh from one file and then load a collision mesh from another. As long as you don't use Irrlicht for collisions then that would work out well.

Travis