   One draw call to render a patch
  Hi all,I've tried posting in directx forum but no avail, thought I'd try in here.  I was wondering if it is possible to render a terrain patch with one draw call ?  At the moment I'm having to make 4 calls to render a quad with 4 rows.  Is there a special way the indices buffer needs to be layed out so you only need to make one Draw call to do this ?Kind regards,Steve   
  You can either use degenerate triangles ( search it ), or use the DX equivalent of glMultiDrawElements ( I can't be more specific, as I don't use DX, sorry ).   ;  Your post in the DX forum is a whole 1-hour old, and has several people trying to help.  After a day or two with no help, sure post in another forum... but after an hour?!?I'm sorry this is going a bit off topic into rant mode... not even a rant directed at you... but a rant that seems to be necessary every once in a while to remind people that GameDev isn't a right.This isn't on-demand instant help... you post and wait for someone who,a) can understand your post (some posts on GDNet incomprehensible),b) can understand which part of your post your problem is (for some posts, this is very difficult),c) knows the answer (this is just a matter of the right person reading the right thread at the right time), andd) can be bothered to reply.Sure, sometimes you can wait a while for all 4 conditions to be met.  As for d), there are several factors than can affect it.  Do you have a history of posting many, many questions, each one step after the other, as though you haven't attempted, for more than 2 minutes, to solve this latest problem on your own?  If so, people might just ignore it.Does your question lack focus?  Some people ask questions that would require a book, or a chapter of a book to answer.  They don't explain which parts they need help with, and which parts they understand.  Ask things like "how does lighting work in DX?" and you'll wait a while for anyone to try to tackle it.  Is your question answered by a simple search with google, forum search, or checking the last few pages of posts?  Ask "how does alphablending work?" and you might have to wait for a reply.  This gets asked like twice a week, sometimes while the first post about it remains on the first page of the forums.  There's only so many times in a row that people will answer the same question over and over.Then, my favourite.  Ignoring the posts that answer your questions.  I love these.  I remember one that I answered as like the 2nd or 3rd reply on the first page... and it went on and on for 5 pages or so until someone finally stumbled on the answer... the same answer I posted 2 days, and 4 pages back.Now, I'm not saying you did any of these things (aside from lack of patience and cross posting in less than an hour) but that these things occur, REGULARLY, on GDNet.  With that in mind, you should be thankful that anyone ever replies to anything.   ;  The best way on modern 3D hardware is to use triangle lists instead of triangle strips. That way you can render an entire patch in a single call, and lists can be optimized for good post t&l vertex cache efficiency (much better than strips).;  Well, I don't know DirectX, but over at gametutorials they have an OpenGL tutorial on how to render a patch of terrain using triangle strips, in a single glDrawElements call... It had certain artifacts, though, so I wouldn't really recommend it. You're better off just using regular triangle lists.   ;  Thanks all,I am using tri-lists, not strips.  I know for my last terrain I did use lists also and geomipmapping, but still had to usemore than one call for each patch.Regards,Steve   ;Quote:Original post by stegI am using tri-lists, not strips.  I know for my last terrain I did use lists also and geomipmapping, but still had to usemore than one call for each patch.When using tri lists, you can render *anything* with a single call, whatever the shape. As long as all faces use a common texture and shader. If you need more than one call to render a tri list patch, then you're using the feature in the wrong way.;  Thanks Anonymous,But still don't know how to render a patch with one DIP.Again, example:|/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/|For instance, if I wanted to render the top right patch shown above, I have to use 4 DIP calls.  Obviously to render the whole terrain I can use one DIP call.Regards,Steve   ;Quote:Original post by stegAgain, example:|/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/*|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/||/|/|/|/|/|/|/|/|For instance, if I wanted to render the top right patch shown above, I have to use 4 DIP calls. ...Why do you need 4 calls? And more importantly, what are the asterisks supposed to be?   ;  Sorry Promit,Let me explain, the asterisks are just to show which patch I want to render (top right patch).Four calls as the patch starts 4 indexes in, in the vertex buffer. So I draw four rows of the patch, each row has a DIP call.  All the vertices are in one big vertex buffer and I have one index buffer.  It doesn't work if I just do :DIP(D3DPT_TRIANGLELIST,4,0,25,32);I guess I'm doing it wrong ?Regards,Steve