Support for "NULL" materials

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Legion
Posts: 15
Joined: Sun Oct 29, 2006 5:03 pm

Support for "NULL" materials

Post 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.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Code: Select all

node->isVisible(false); 
I think this shud work????
Legion
Posts: 15
Joined: Sun Oct 29, 2006 5:03 pm

Post 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.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
Post Reply