Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Strategies for implementing GUIMark2 Bitmap with DX11


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

#1 AverageJoeSSU   Members   -  Reputation: 516

Like
0Likes
Like

Posted 23 January 2013 - 03:21 PM

Topic sums it up really...

 

What is the best/quickest way to push independently transformed bitmaps to the screen?

 

Particularly from the perspective of, doing it in DX9, and then changing subsystems to leverage DX11 features.

 

For Example, perhaps using the compute stage to calculate transforms on the individual bitmaps.

 

Or perhaps binding a texture array to prevent state switching. (that may be a previous OGL limitation)

 

Thanks,

Joe

 

For those of you who don't know what this benchmark is....

http://www.craftymind.com/factory/guimark2/FlashGamingTest.html


------------------------------

redwoodpixel.com


Sponsor:

#2 BornToCode   Members   -  Reputation: 935

Like
0Likes
Like

Posted 23 January 2013 - 05:19 PM

The best way to do is to do all the transformation in software and store the vertices in a huge buffer that is already transformed. Then send the whole batch to the screen to draw the whole thing at once.



#3 AverageJoeSSU   Members   -  Reputation: 516

Like
0Likes
Like

Posted 24 January 2013 - 01:12 PM

The best way to do is to do all the transformation in software and store the vertices in a huge buffer that is already transformed. Then send the whole batch to the screen to draw the whole thing at once.

Okay so is this largely unchanged in dx11?

 

by calcing transforms in software that means you have to push a full transform for each bitmap. Seems to me like you could instead pass translates and calc transforms on the GPU.

 

and compute shaders wouldnt be useful? or passing in points and reconstructing the quad for the bitmap in a geometry shader?????

 

come on guys i know some of you out there can think up tweaks!

 

-J


------------------------------

redwoodpixel.com


#4 BornToCode   Members   -  Reputation: 935

Like
0Likes
Like

Posted 24 January 2013 - 05:07 PM

Okay so is this largely unchanged in dx11?
 
by calcing transforms in software that means you have to push a full transform for each bitmap. Seems to me like you could instead pass translates and calc transforms on the GPU.
 
and compute shaders wouldnt be useful? or passing in points and reconstructing the quad for the bitmap in a geometry shader?????
 
come on guys i know some of you out there can think up tweaks!

 

The only way you could batch that way is to pass an array of matrices to your vertex shader along with some id for each image that tells you which index of the array you want to use for each image. You either do it on the CPU side or waste Shader Registers. Pick your poison


Edited by BornToCode, 24 January 2013 - 05:08 PM.


#5 MJP   Moderators   -  Reputation: 11567

Like
0Likes
Like

Posted 24 January 2013 - 08:49 PM

You can absolutely do almost everything on the GPU if DX11 is your target spec. Take a look at the code for SpriteBatch for some ideas.

 

Also you don't have to pass an entire matrix per sprite if you don't need that much information, nor do you have to pass an ID (vertex shaders have access to SV_InstanceID which is automatically generated by the GPU). You also don't  waste "Shader Registers", that's an outdated notion from DX9. In DX11 you have the option of using constant buffers, vertex buffers, or even structured buffers for storing per-instance data.



#6 AverageJoeSSU   Members   -  Reputation: 516

Like
0Likes
Like

Posted 25 January 2013 - 11:39 AM

Awesome!

 

You can absolutely do almost everything on the GPU if DX11 is your target spec. Take a look at the code for SpriteBatch for some ideas.

 

Also you don't have to pass an entire matrix per sprite if you don't need that much information, nor do you have to pass an ID (vertex shaders have access to SV_InstanceID which is automatically generated by the GPU). You also don't  waste "Shader Registers", that's an outdated notion from DX9. In DX11 you have the option of using constant buffers, vertex buffers, or even structured buffers for storing per-instance data.

 

This is exactly the kind of stuff i was looking for!!!


------------------------------

redwoodpixel.com


#7 AverageJoeSSU   Members   -  Reputation: 516

Like
0Likes
Like

Posted 25 January 2013 - 02:21 PM

I'm a bit surprised that i do not see use of the other shader stages.

 

Things like http://zeeky-h-bomb.blogspot.com/2010/03/instancing-and-geometry-shader.html

 

what he is doing (midway through the article). I guess this prohibits you from doing other things on the CPU kind of like an ALL or Nothing kind of thing.

 

For Example generating mirrored tex coords would then have to be done in a shader... but i guess it isnt that big of a deal.


Edited by AverageJoeSSU, 25 January 2013 - 02:26 PM.

------------------------------

redwoodpixel.com





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