Jump to content

  • Log In with Google      Sign In   
  • Create Account


draw Instanced question


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
3 replies to this topic

#1 lomateron   Members   -  Reputation: 329

Like
0Likes
Like

Posted 16 September 2012 - 03:18 PM

I have a texture1D 300 X 1. I set it to be the render target.
To draw to all the pixels in the texture, I have two methods.
The first and most common is using draw() and the second is using drawInstanced()

draw() will use a typology of line list and 2 vertex to define the line that will go acros all the pixels of the texture

drawInstanced() will use a typology of point list and 1 vertex that will be modified depending on the intanceID to run in a different pixel of the texture

The question is, which method will end the drawing first?Are they equal.

What i am going to do is use drawIntanced(), not to draw to all the pixels of a 30X1 texture, but to draw to 1 pixel of a 1X1 texture and depending on the value that each pixel shader returns, the pixel will be replaced with that value.

So I create that comparison to see how fast that will be.

Edited by lomateron, 17 September 2012 - 08:10 PM.


Sponsor:

#2 Tordin   Members   -  Reputation: 604

Like
0Likes
Like

Posted 17 September 2012 - 01:41 AM

If i get this right you are asking if it´s faster to call the draw function and rendering two vertexs and getting a line renderd with a texture...
or if you call the drawinstaced at each pixle of the line?

But to me drawing only two vertex would be better... due to the fact that it will create the "pixels" by it self.

hope that helps.
"There will be major features. none to be thought of yet"

#3 Jason Z   Crossbones+   -  Reputation: 4905

Like
0Likes
Like

Posted 17 September 2012 - 07:47 PM

I would tend to agree with Tordin, and think the line list will be slightly more efficient. However, for 30 or 300 or even 3000 pixels, it probably would not make a perceptible difference between the two. I would recommend to try it out and see for your self, but you will probably find that they are identical in a performance test.

#4 lomateron   Members   -  Reputation: 329

Like
0Likes
Like

Posted 17 September 2012 - 09:28 PM

where can I read about how directx works with the GPU?




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.



PARTNERS