Jump to content

  • Log In with Google      Sign In   
  • Create Account

Render a triangle and cube same time ?


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1   Members   

134
Like
0Likes
Like

Posted 19 June 2012 - 11:12 AM

Hello everyone !

From the title u can see that i'm a total beginer... i've read a book about dx11 and msdn tutorials... i understood them ... bot no one had an example with ... rendering 2 things with diferent geometry... let's say i want to draw a cube and a triangle... how i do that... if my vertex buffer store the cube vertices... how i modify it or what should i do to be able to render the 2 objects :D


Ty ;D

#2   Members   

1573
Like
1Likes
Like

Posted 19 June 2012 - 01:35 PM

One draw call per object.
I.e. Set world, view,projection, material/texture and vertex buffer for object 1. Draw.
Set whatever changed I.e. World, vertex buffer 2 (if different object) and draw.

#3   Members   

134
Like
0Likes
Like

Posted 19 June 2012 - 01:37 PM

so i should use multiple vertex buffers right ? :D 1 buffer for each element :-??

#4   Members   

1573
Like
1Likes
Like

Posted 19 June 2012 - 01:42 PM

It sure seems silly for such simple geometry but imagine a house and a car for example. You would set all settings and renderstates for the house, draw it, do it again for the car and draw it. You're right that it requires creating 2 VB's and possibly 2 index buffers as well if you use that which you should.

#5   Members   

134
Like
0Likes
Like

Posted 19 June 2012 - 01:43 PM

Thank's a lot man :D that really helped me

#6   Members   

1573
Like
0Likes
Like

Posted 19 June 2012 - 01:54 PM

Welcome man :-)
One more thing, if you draw let's say the car 2 or more times then obviously you don't need a VB for each instance but only change its position (worldmatrix!) and draw from same VB/IB again.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.