Render many object with one scene node

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
samleo
Posts: 16
Joined: Mon Aug 17, 2015 12:26 am

Render many object with one scene node

Post by samleo »

Well, I have a chunk made of a 3d array of int. Each int is a type of scene node, for example, I have 3 blocks scene nodes with type 1, 2, 3, when I go to render so I just render with that 3 scene nodes in different positions, like a 2d tile map.
So, may anyone teach me how to render many objects with one or 3 scene nodes? I try to do but never call the render method of my chunk class, that is a derived from ISceneNode.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Render many object with one scene node

Post by CuteAlien »

Helps if you post code what you tried, then it's easier to see what's going on. But usually when render is not called it's either because you did not register the node in OnRegisterSceneNode or it is clipped away because getBoundingBox returns the wrong values. You can avoid the bounding-box test completely if you set your node to setAutomaticCulling(0).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
samleo
Posts: 16
Joined: Mon Aug 17, 2015 12:26 am

Re: Render many object with one scene node

Post by samleo »

CuteAlien wrote:Helps if you post code what you tried, then it's easier to see what's going on. But usually when render is not called it's either because you did not register the node in OnRegisterSceneNode or it is clipped away because getBoundingBox returns the wrong values. You can avoid the bounding-box test completely if you set your node to setAutomaticCulling(0).
Here the code: http://pastebin.com/SHdERteR
See the render method in last lines.
The problem was because not register the node, but now has another, the chunk isn't shows more than the last block (the last with type == 1). Does is possible to render more than one block with my chunk render method? I don't want to use one scene node by "tile" because takes many memory. Do you know a better method of render many blocks with just one scene node?
samleo
Posts: 16
Joined: Mon Aug 17, 2015 12:26 am

Re: Render many object with one scene node

Post by samleo »

CuteAlien, can you give me a link where shows how to render many objects with just one scene node? If you don't know, so I'll search for another method to render blocks with low memory usage.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Render many object with one scene node

Post by hendu »

Search for "batching". You're the #14355676756 asking about how to make Minecraft.
samleo
Posts: 16
Joined: Mon Aug 17, 2015 12:26 am

Re: Render many object with one scene node

Post by samleo »

Where I said that I'm making a minecraft like?
Just of block?
I'm making a voxels editor and not a game ¬¬
But thank you, I'll search for batching
Post Reply