Sign in to follow this  
lomateron

draw Instanced question

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this