Re: Need advises for improving performance
From: Faraz Azhar (itz_farazSTOPSPAM_at_hotSPAMmail.com)
Date: 01/22/05
- Next message: Phil Taylor: "Re: Double buffering"
- Previous message: Faraz Azhar: "Re: Double buffering"
- In reply to: Phil Taylor: "Re: Need advises for improving performance"
- Next in thread: Phil Taylor: "Re: Need advises for improving performance"
- Reply: Phil Taylor: "Re: Need advises for improving performance"
- Messages sorted by: [ date ] [ thread ]
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]
> >
> >
>
>
- Next message: Phil Taylor: "Re: Double buffering"
- Previous message: Faraz Azhar: "Re: Double buffering"
- In reply to: Phil Taylor: "Re: Need advises for improving performance"
- Next in thread: Phil Taylor: "Re: Need advises for improving performance"
- Reply: Phil Taylor: "Re: Need advises for improving performance"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|