dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

ID3DXMesh::DrawSubset vs IDirect3DDevice9::DrawIndexedPrimit

 
dev.gamez.lv Forum Index -> Microsoft DirectX
View previous topic :: View next topic  
Author Message
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Thu Jan 06, 2005 12:13 pm    Post subject: ID3DXMesh::DrawSubset vs IDirect3DDevice9::DrawIndexedPrimit

ID3DXMesh::DrawSubset vs IDirect3DDevice9::DrawIndexedPrimitive

ir kaadam personiiga pieredze kas un kaadeelj ir efektiivaaks?

[edit]topica garums vareetu buut mazlietinj lielaaks Wink
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
gazz



Joined: 03 Jan 2004
Posts: 355
Location: Teika

PostPosted: Thu Jan 06, 2005 2:24 pm    Post subject:

Man pasham pilniigi pietiek ar DrawIndexedPrimitive, kaut gan piniigi iespeejams ka ar pirmo war shaadus taadus trikus izmantot, kaa Optimize. D3DX bilbioteeka jau nekaadus debesu briinumus nedara un es nedomaaju ka tur apakshaa ir kau kaada low-level sasaiste ar D3D. Ideja jau ir lai atwieglotu dazhas ljoti nepiecieshamas fiichas, kas sawaadaak buutu jaaraksta(kau kur jaanosper) pasham. Bet nu wairaak par augstaaku layeri diez wai tas ir.
Back to top
View user's profile Send e-mail
dev



Joined: 27 Jul 2004
Posts: 206
Location: Latvija

PostPosted: Thu Jan 06, 2005 3:44 pm    Post subject:

Nu tak - DrawSubset ir D3DXMesha funkcija un XMeshs nav core D3D sastaavdalja - shii funkcija attiecas tikai uz X modeljiem.
DrawIndexedPrimitive savukaart ir standarta D3D funkcija, bez kuras iztikt nevar un uz kaa viss balstaas.
Back to top
View user's profile Visit poster's website MSN Messenger
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Thu Jan 06, 2005 4:17 pm    Post subject:

nee nu es saprotu atshkjiriibas - galu galaa visi 3anglju ziimeejumi nosleedzas ar 4aam funkcijaam

DrawPrimitive
DrawIndexedPrimitive
DrawPrimitiveUP
DrawIndexedPrimitiveUP

es vienk gribu zinaat vai mesha.DrawSubset ir izraadiijies pietiekoshi labi uzrakstiits lai izmantotu vinju nevis ar rokaam veidotu bufferus un sauktu drawindexedprimitive
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
dev



Joined: 27 Jul 2004
Posts: 206
Location: Latvija

PostPosted: Thu Jan 06, 2005 6:23 pm    Post subject:

nu kaa - ja tu gribi visur lietot XMeshus tad uz priekshu, pats diezvai ko labaaku uzrakstiiisi, tachu terrain engini diezvai uztaisiiti izmantojot DrawSubset.. iisti nesaprotu jautaajuma jeegu :\
Back to top
View user's profile Visit poster's website MSN Messenger
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Thu Jan 06, 2005 11:03 pm    Post subject:

shur tur pa forumiem paviideeja spalvainas idejas ka draw subset kau4ko nevajadziigi ar state changes makareejot
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
dev



Joined: 27 Jul 2004
Posts: 206
Location: Latvija

PostPosted: Fri Jan 07, 2005 12:56 am    Post subject:

varjau buut ka deelj sava universaaluma kautkas lieks tiek reizeem izdariits, tachu man vienalga liekas, ka neko aatraaku kaa maikrosofta pasha rakstiito, tev neizdosies uzrakstiit. kaa nekaa vinji dx paarvalda vislabaak.
Back to top
View user's profile Visit poster's website MSN Messenger
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Sat Jan 08, 2005 12:16 pm    Post subject:

es laikam saaku iebraukt kaapee forumos par shito bija breeka.
simple kods
ziimee meshu [viens subsets] divas reizes katru reizi ar savaadaaku world matricu

Code:

   D3DXMATRIXA16 matWorld;
   UINT  iTime  = timeGetTime() % 1000;
   FLOAT fAngle = iTime * (2.0f * D3DX_PI) / 10000.0f;
   D3DXMatrixRotationY( &matWorld, fAngle );
   Device->SetTransform( D3DTS_WORLD, &matWorld );

   D3DXVECTOR3 vEyePt( 0.0f, 10.0f,15.0f );
   D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
   D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
   D3DXMATRIXA16 matView;
   D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
   Device->SetTransform( D3DTS_VIEW, &matView );
   D3DXMATRIXA16 matProj;
   D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
   Device->SetTransform( D3DTS_PROJECTION, &matProj );


   for(unsigned long k=0;k<matcount;k++){
      Mesh->DrawSubset(0);
   }

   D3DXMatrixRotationZ( &matWorld, fAngle );
   Device->SetTransform( D3DTS_WORLD, &matWorld );

   for(unsigned long k=0;k<matcount;k++){
      Mesh->DrawSubset(0);
   }


pixa [dbg toolis] outputs


kaa redzams netiek keeshotas paaris lietas [vertexdeclaration, streamsource, indicies buffer]
itkaa maz bet savaaksies pie normaala skaita darbiibu

[edit]
var jau buut ka state changes tiek no4ekotas draiverii, bet ljoti shaubos ka kaads draiveris uz setvertexdeclaration paarbauda vai taads declarations jau nav uzsettots pirms tam

[edit2]
ja njemam veeraa to ko ms pats bija uzrakstiijis tad:
SetVertexDeclaration calls aiznjem 6500 - 11250 tickus
SetStreamSource 3700 - 5800
SetIndices 900 - 5600
kopaa vismaz 11100-12525 lieki ticki ja mums objektu vajaga ziimet vismaz 2as reizes [pa vidam nomainot tikai world matricu].

+ ja SetVertexDeclaration tiek keshots globaali tad ieguvums vareetu buut pat diezgan juutams

+ teixim flatoutu papeetot nemaniiju ka shamais izmantotu mrakosofta mesh objektu

vitoge: varbuut ms mesh objekts tomeer nav tik labs kaa izskataas saakumaa
laikam paarieshu uz custom meshiem un saukshu draw*primitive* callus pats

[edit3]
paspeeleejos ar OptimizedMesh Sample - laikam naaxies apvienoties ar mesh objektu deelj OptimizeInplace un peec tam izmantot izveidotos bufferus
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Sat Jan 08, 2005 6:18 pm    Post subject:

ghmm..
izveicu testus - ar roku saucot tikai drawindexedprimitives un mesham draw subset
100 teapoti [2256 triangles katram] - abaam pieejaam vienaads fps ~16

tb laikam kau4kaads keshings tomeer pastaav - tb mainot states ja taada jau ir uzsetota


ghmmm
nonjemot wirefreimu diivainaa kaartaa palielinaas fps... ???
163
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
dev



Joined: 27 Jul 2004
Posts: 206
Location: Latvija

PostPosted: Sat Jan 08, 2005 11:26 pm    Post subject:

videokarshu draiveros, kas ir optimizeeti prieksh speeleem, wire atbalsts un performance ir nozheelojama - uzsvars ir likts uz citaam lietaam. Uzinstaleejot pro draiverus (piemeeram, FireGL uz Radeona), viss radikaali mainaas - wire performance ir daudz lielaaka.. tas taa - off topic
Back to top
View user's profile Visit poster's website MSN Messenger
Display posts from previous:   
dev.gamez.lv Forum Index -> Microsoft DirectX All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group