Crystal Space
Welcome, Guest. Please login or register.
September 20, 2014, 03:20:39 am

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8484 Members
Latest Member: Msnatecarleen0303
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  improve starttup
« previous next »
Pages: [1] Print
Author Topic: improve starttup  (Read 3090 times)
Luca
Guest


Email
« on: February 23, 2006, 06:14:07 pm »

Hi,
i have twelve sp3d meshes of the same factory(10 frame action and 400 vertices per mesh), this meshes have the flags CS_ENTITY_INVISIBLE active and the start up of the application.
these meshes have proctex material and i draw a picture and text over it. When i make these meshes visible for the first time, i notice the process stop for 1 or 2 seconds. During the game these meshes switch from visible to invisible some time and the problem don't happen. Note every time these meshes come in to the screen i notice the performance go low for half a second.
what can i do to prepare the engine to unshow these small problems? ( i tried to use precachedraw or function like that, but nothing happen)
thank you
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: February 23, 2006, 11:01:55 pm »

What version of CS are you using?

I think I have an idea what could cause this but I need to know exactly what procedural texture you are using and which version of CS you are using.

Greetings,
Logged
Luca
Guest


Email
« Reply #2 on: February 24, 2006, 10:38:20 am »

I'm using a snapshot of the 9 January 2006 (the time pass really too fast!).
I can test the last cvs version, if you think this small problem should be solved.

Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: February 24, 2006, 10:54:23 am »

I'm using a snapshot of the 9 January 2006 (the time pass really too fast!).
I can test the last cvs version, if you think this small problem should be solved.



No it is not solved yet. But can you please tell me which procedural texture you are using?

Greetings,
Logged
Luca
Guest


Email
« Reply #4 on: February 24, 2006, 11:05:57 am »

it's a csProcTexture like this:

class m3gProcTex : public csProcTexture
{
private:
  csRef<iEngine> Engine;
  csRef<iFont> font;
public:
  m3gProcTex ();
  ~m3gProcTex ();

  bool InitProcTex ();
  virtual bool PrepareAnim ();
  virtual void Animate (csTicks current_time);
};
and i use the UnitMesh->GetMeshObject()->SetMaterialWrapper(ProcMat); to set to the mesh.

let me know if i can help in any way.

Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: February 24, 2006, 11:45:33 am »

I need to see the implementation of Animate(). That's where the problem is I think.

Greetings,
Logged
Luca
Guest


Email
« Reply #6 on: February 24, 2006, 12:20:29 pm »

i set the RefreshTexture at true each time the Name or the texture change, but i have observed it have not influence during the game.
...this a very old code, i have to improve it for sure.

void m3gProcTex::Animate (csTicks current_time)
{
   if (RefreshTexture)
   {
      RefreshTexture = false;
      iMaterialWrapper* tm = Engine->GetMaterialList()->FindByName(BaseMatName.GetANSI());
      if (!tm) return;
      iMaterial* mh = tm->GetMaterial();
      iTextureHandle *th = mh->GetTexture();
      g3d->SetRenderTarget (tex->GetTextureHandle());
      if (!g3d->BeginDraw(CSDRAW_2DGRAPHICS)) return;
      int tex_w, tex_h;
      th->GetOriginalDimensions(tex_w, tex_h);
      g3d->DrawPixmap(th, 0, 0, tex_w, tex_h,    0, 0, tex_w, tex_h);

      MxStr str(Nome);
      const char *text = str.Mid(0, Cool.GetANSI();
      int txtx = 4;
      int txty = 470;
      g2d->Write(font, txtx, txty, g2d->FindRGB(255,255,255),   -1, text);
      g3d->FinishDraw ();
   }
}
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #7 on: February 24, 2006, 12:22:52 pm »

Hmm that looks ok. How big is your procedural texture?

Greetings,
Logged
Luca
Guest


Email
« Reply #8 on: February 24, 2006, 12:52:38 pm »

it is a 512x512,
the overdraw pixmap  is a 512x512 jpg
the write use the freetype plugin.

m3gProcTex::m3gProcTex() : csProcTexture ()
{
  RefreshTexture = false;
  mat_w = 512;
  mat_h = 512;
  texFlags = CS_TEXTURE_3D;
}

Logged
Luca
Newbie
*
Posts: 3


View Profile Email
« Reply #9 on: March 01, 2006, 10:02:36 am »

Hi Jorrit,
have you got some news about that? can i help you?
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #10 on: March 01, 2006, 10:09:22 am »

I'm afraid I have no clue. Sorry sad

Greetings,
Logged
Luca
Newbie
*
Posts: 3


View Profile Email
« Reply #11 on: March 01, 2006, 11:44:51 am »

i'll try to give you more elements during next days.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.242 seconds with 15 queries.