About Store Forum Documentation Contact



Post Reply 
Doubt drawing object (Game.Static)
Author Message
cat555 Offline
Member

Post: #1
Doubt drawing object (Game.Static)
Hi, i'm using a set of object tiles that after composed in world editor, are my terrain.

I've created my own class for this, since i need to override some aspects of it. I'm extending Game.Static.

My problem is that when drawing (drawPrepare), when character walks in the world, some tiles are not rendered in certain positions... this occurs even if i don't check if object is inside frustum, so i was expecting that they were always drawn...

I'm using like this:

Code:
UInt drawPrepare()
   {      
         MaterialLock=material(); mesh->draw(_matrix_scaled);
         MaterialLock=NULL;
      
      return 0;
   }

Any ideas of what i'm doing wrong?

Also, even with Frustum check (if(Frustum(mesh->box, _matrix_scaled))), these objects should be drawn since they are in Frustum, but they disappear in some positions...

Thanks!
(This post was last modified: 11-06-2014 06:54 PM by cat555.)
11-06-2014 06:04 PM
Find all posts by this user Quote this message in a reply
cat555 Offline
Member

Post: #2
RE: Doubt drawing object (Game.Static)
I already seen other similar posts that use Renderer.rebuildDepth(), but it does not work in this case.

Also, some notes:
(1) some tiles are bigger than world areas
(2) some tiles are placed across 2 or more world areas

Also, if i use the built-in Terrain class, this works perfectly, with no object culling, but i need to use my custom class in this particular case...
11-07-2014 10:40 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #3
RE: Doubt drawing object (Game.Static)
are you still using game::world for the main draw call of the tiles? maybe the area that draws the tile is not inside active range?
11-07-2014 03:31 PM
Find all posts by this user Quote this message in a reply
cat555 Offline
Member

Post: #4
RE: Doubt drawing object (Game.Static)
Hi Zervox, yes i use game::world draw calls... also areas affected are in active range.

I'm able to overcome this problem by using a world with bigger area size - 128 in this case. If i use area size of 32 the problem arises.

Thanks!
(This post was last modified: 11-07-2014 05:22 PM by cat555.)
11-07-2014 05:06 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Doubt drawing object (Game.Static)
Hello!

Perhaps the objects are too big and don't fit in an area?

World Manager will not process areas that are not in the Frustum View.

Normally huge objects should be set as "Terrain" type, which will make the Manager split them into separate meshes placed into multiple areas.

If that's the case, then you need to - not render the objects using world manager, but process them manually in the Render function.
void Render()
{
Game.World..
draw huge objects..
}
11-08-2014 01:08 AM
Find all posts by this user Quote this message in a reply
cat555 Offline
Member

Post: #6
RE: Doubt drawing object (Game.Static)
Hi @Esenthel, ok i see the problem then... thanks for the clarification and suggestions!

Thanks also @Zervox, you're pointed this earlier, but when i answered you, i wasn't testing it correctly, and thought that affected areas were in Frustum but in fact, they weren't :\
11-09-2014 07:31 PM
Find all posts by this user Quote this message in a reply
Post Reply