About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Impostors speed up
Author Message
Corrado Offline
Member

Post: #1
Impostors speed up
Hello,

as i already told you, i started some months ago a game development with another engine, now im porting the source to your engine, you have a lot of good
features that i love but i wish also, if will be possible, keep the old good features that i had with the other engine.
One of these is the fast speed in rendering simple objects with a small number of faces (2..20 faces).
The speed of your draw method is good for objects with over 500 faces, but EE keep the same speed with objects with 2..20 faces, now
i ask you if its possible to have a simple rendering method to draw at high speed simple objects (2..20 faces).
In fact i have im my game a lot of Impostors (specially for trees) with a little number of faces (2..20) and i wish to keep this.
About the impostors of course all that i need is : position, rotation, scale and color (i dont need shadows, lights, collisions, ...)
Note that other engines (PowerRender, Ogre) draws this kind of objects from 5 (with recalculate pos, rot) to 25 (without recalculate pos, rot) times faster than EE.

Corrado
03-11-2009 08:20 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Impostors speed up
What Renderer.type are you currently using?
03-11-2009 09:10 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #3
Re: Impostors speed up
all your Renderer.type : the speeds are almost the same drawing the simple objects (2..20 faces)
03-11-2009 09:34 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Impostors speed up
Could you:

1. Paste the code for drawing the impostor objects that you're using
2. In what rendering modes are you rendering the objects?
3. Send me a sample 2 faced object (with material and texture)
4. Tell me what video card do you have?
5. Have you tested RT_SIMPLE type and RM_SIMPLE only?

Thanks
03-12-2009 12:11 AM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #5
Re: Impostors speed up
Im using Athlon X2 with GeForce 8800GT
I draw all the objects with your "Mesh::draw(Matrix)" : there is another faster function ?
I think you have add another "draw function" or add another "RM_MODE" or draw with "vertexbuffer (but 2d objects that not face the camera)" or ...
Set RT_SIMPLE i think is not a right way, because i want togheter a)high speed in drawing simple objects and b)good quality on the other objects

If EE can draw at high speed 2d Objects (not facing the camera) or 3d simple Objects, please tell me.

Tks
Corrado
03-12-2009 10:11 AM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #6
Re: Impostors speed up
I try to send you a 16Mb .rar file with one sample (draw 4faces impostor) with PowerRender and Ogre, but the upload crash.

Pls may i have your mail so i can resend the file ?

Tks
Corrado
03-12-2009 09:27 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
Re: Impostors speed up
Hi

<!-- e --><a href="mailto:esenthel@gmail.com">esenthel@gmail.com</a><!-- e -->

1. Could you tell in what rendering modes are you rendering the meshes
2. Sample 2 faced object with texture would be good for testing
03-12-2009 10:09 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
Re: Impostors speed up
when the next engine version will be ready, you can try something like this:

Code:
/******************************************************************************/
#include "stdafx.h"
#include "../resource.h"
/******************************************************************************/
Gfx *gfx;
Vec  pos[10*1000];
/******************************************************************************/
void InitPre()
{
   App.name=L"Project";
   App.icon=(Char*)IDI_ICON1;
   App.flag=APP_FULL_TOGGLE|APP_ALLOW_SINGLE_PASS;
   ViewportFull.range=1000;
   Cam.dist=30;
   Cam.pitch=-0.4;
}
Bool Init()
{
   Renderer.color_palette=NULL;
   gfx=Gfxs("d:/tree.gfx");
   REPAO(pos)=Random(Box(100,0,100));
  
   Suns.New().set(*Gfxs("gfx/sky/sun.gfx"));
   Sky.set();

   return true;
}
void Shut()
{
}
/******************************************************************************/
Bool Main()
{
   if(Kb.bp(KB_ESC))return false;
   CamHandle(0.1,500,CAMH_ZOOM|(Ms.b(1) ? CAMH_MOVE : CAMH_ROT));

   if(Ms.b(0) || Tm.frame()<=1)Sort(pos,ELMS(pos),CompareTransparencyOrder); // sort on LMB

   return true;
}
/******************************************************************************/
void Render()
{
   switch(Renderer())
   {
      case RM_BLEND:
      {
         SetMatrix();
         VI.gfx(gfx);
         if(Kb.ctrl)REPA(pos)VI.billboard      (WHITE,2  ,pos[i]);
         else       REPA(pos)VI.billboardBottom(WHITE,2,2,pos[i]);
         VI.end();
      }break;
   }
}
void Draw()
{
   Renderer(Render);
   D.text(0,0.9,S+Tm.fps());
}
/******************************************************************************/
03-13-2009 08:02 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #9
Re: Impostors speed up
Hello,

tks for the sample, but as i already told you remember "... or draw with 'vertexbuffer (but 2d objects that not face the camera)' or ...
"If EE can draw at high speed 2d Objects (not facing the camera) ..."

i see that in your sample the 2d objects facing allways the camera : the impostor that i send you (in the test samples) is a 6 faces impostor,
good to see from any angle, so i need to draw at highspeed 2d objects that dont facing always the camera (or 3d objects of course).

Tks
Corrado
03-14-2009 01:28 AM
Find all posts by this user Quote this message in a reply
Post Reply