Advertisement Jump to content
Sign in to follow this  
The C modest god

When does the rendering occure in Direct3D?

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When the render state is set to have no culling. Does Direct3D renders a primitive immidatly after calling DrawPerimitive? (In the documentation it says the methods renders the permitive or does it keeps the data about the perimitive and waits to end scence and then does somthing smarter? In other words, if I do a draw perimitive of a triangle and afterwards I use drawPerimitive with another triangle, which is above the previous triangle. Will the first triangle be drawen anyway? Even if it will not be visible? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I believe that most things are buffered onto the card, and then they are executed either all at once or whenever the buffer fills up. Someone else could probably tell you better.

As for your second question, however: if you draw a triangle that's far away and then a second one that's closer and covers it up, the first triangle will still be drawn in its entirety. The second one will cover it up, though, because of Z-Buffering. However, if you were to draw the near triangle first and then the far triangle, the far triangle would not be drawn, as every pixel would fail the Z-Buffer test, and it would be very quickly skipped from drawing.

Share this post


Link to post
Share on other sites
Quote:
Original post by The C modest god
In other words, if I do a draw perimitive of a triangle and afterwards I use drawPerimitive with another triangle, which is above the previous triangle. Will the first triangle be drawen anyway? Even if it will not be visible?


It will, this is what you have a depth buffer for.

Share this post


Link to post
Share on other sites
Quote:
Original post by vNistelrooy
Quote:
Original post by The C modest god
In other words, if I do a draw perimitive of a triangle and afterwards I use drawPerimitive with another triangle, which is above the previous triangle. Will the first triangle be drawen anyway? Even if it will not be visible?


It will, this is what you have a depth buffer for.


Yes, but drake said that if you draw the far triangle first it will be drawen even if you have a z buffer. Did you mean by depth buffer for something else then Z buffer?

Share this post


Link to post
Share on other sites
Another question, If I have transcularency. Like 50% transparency. Do I have to draw the permitives with the transparency last? Or can I draw them before perimitives which are behind them?

Share this post


Link to post
Share on other sites
Quote:
Original post by The C modest god
Another question, If I have transcularency. Like 50% transparency. Do I have to draw the permitives with the transparency last?


Yes actually, you do. And kudos on realizing that yourself -- it doesn't occur to most people until they're told. You'll also have to sort all the triangles by depth in order to get the blending correct (the only exception being additive blending).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!