Re: Need advises for improving performance

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Faraz Azhar (itz_farazSTOPSPAM_at_hotSPAMmail.com)
Date: 01/22/05


Date: Sun, 23 Jan 2005 01:50:22 +0500

I dont use drawprimitive at all. I have meshes. my isometric game is of
40x32 tiles, and a mesh for each tile. textures are pooled. I guess loading
too many meshes is causing the problem. 40x32=1280 meshes! all with 4
vertices each. Each mesh is loaded into a CD3DFrame, so I guess to render
all the 1280 frames, it calls SetTexture for that many times. no shader or
vertex format changes at all.

its a simple app that I have right now. I have a single mesh and 1 texture.
And its loaded 1280 times all in separate frames. And all these frames are
held into another frame I call m_RootFrame. And I simply call the
m_RootFrame.Render function. :-S

"Phil Taylor" <ptaylor@private-citizen.com> wrote in message
news:e9RDyMKAFHA.1260@TK2MSFTNGP12.phx.gbl...
> how many DrawPrim invocations?
>
> how many SetTextures?
>
> how many shader and vertex format changes?
>
> these are all good things to minimize.
>
> for instance, you can pack your textures into "pages" ( sometimes called
> "atlases" ) and use texture coordinates to index into the right page. thus
> avoiding a lot of SetTextures.
>
> good batching behavior, never calling DrawPrim with less than 128 verts or
> so, is also important. the more verts drawn at a time the better.
>
> "Faraz Azhar" <itz_farazSTOPSPAM@hotSPAMmail.com> wrote in message
> news:%23OEigXEAFHA.3988@TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > Im creating a simcity like game. Im using all the helper modules
supplied
> > with DX 8.1 SDK, plus drawing each tile of the terrain from a mesh I
> > created. (ie I use a mesh for a tile). Which is the problem. A small
> > landscape of about 40x32 tiles takes about 2000+ vertices. It lowers the
> > framerate from 427fps (if nothing is drawn) to 17fps (if the terrain is
> > drawn).
> >
> > I could've used simple primitives (index buffers maybe) for drawing the
> > terrain but the only reason im using a mesh is that I like to store my
> > meshes in CD3DFrame so that each Frame holds 1 tile and all the frames
are
> > the children of a root frame. All this is done just to get the CD3DPick
> > class working. I need the 'pick' thing to detect which tile is the mouse
> > currently hovering. This is the most essential part in any tile-based
> > construction game.
> >
> > Currently ive created a procedure that reads a map file (a heightmap
> > bitmap
> > image) and then adjusts the (y) axis of all the vertices in the mesh, to
> > create complex terrains. The second problem im having that I have a
> > directional light whose direction is (-1, -1, -1). Its giving the light
> > all
> > ok, but the tiles which are really shallow (for eg if I load a grand
> > canyon
> > type map) ie the steep tiles shouldnt be getting light.. they should be
> > darker in color. but all the tiles are lit up, which causes the
complexity
> > in the terrain not to appear nicely. I mean at a single glance one
cannot
> > tell which tile is higher and which is not... just because the light is
> > lighting up all the tiles... even the ones not directly facing the
light.
> > ive set the ambient light to a very very low color so ambient light is
not
> > the problem to it. Anyways, I think this light problem can be sorted out
> > one
> > way or the other.
> >
> > SO I need advises,.. has anyone created a tile-based game in DX 8.1
(VB6)
> > ?
> > How to do it? meshes are taking up too many vertices... and I have yet
to
> > draw buttons and other controls too. Im hesitating to use index buffers
> > because of the CD3DPick class.. it wont pick it. And texturing over
> > vertices
> > in index buffers has always been a pain in the neck for me, plus if the
> > player creates a building at a certain position, that tile will not be
> > drawn
> > anymore and a mesh will take its place; i have yet to figure it out how
to
> > do that. Any performance tips n tricks in this situation?
> >
> > - Faraz Azhar
> > [DX 8.1, VB6]
> >
> >
>
>



Relevant Pages

  • Re: Who coined the mahjong symbols "Cash", "String of Cash" , "Myriad of Cash" and why
    ... approach is improper and too narrow when the whole game of mahjong is ... When credible evidence of similarities are found between the ... How old did you say the mahjong ... pieces (tiles vs. paper) from Mo He. ...
    (rec.games.mahjong)
  • [Review] Ooga
    ... It's a game with a caveman theme and involves players spearing ... tiles with plastic suction cups on the end of sticks. ... given to the "Tribal Chief". ...
    (rec.games.board)
  • Re: Numbers of tiles in the Himly and Glover sets.
    ... Is it the claim that the ZFB tiles are actually HK, ... consider them the 'Four Cardinal Directions'? ... If you think that the game was designed by a designer, ... Are you telling me you know that walls were used in that very early ...
    (rec.games.mahjong)
  • [Review] FourSite
    ... fact that I had seen something similar in the basic game of dominoes; ... tiles, ... The board is made up of a four-hundred square grid, ... One player is chosen to go first, ...
    (rec.games.board)
  • Re: Who coined the mahjong symbols "Cash", "String of Cash" , "Myriad of Cash" and why
    ... he makes a claim to his explanation being a "more fitting ... explain more things in the ma que game than other explanations. ... only 3 suits of 9 tiles each. ... What is the "credible evidence" and where? ...
    (rec.games.mahjong)