Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Good article on Drawing Policy


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

#1 Jake Rivers   Members   -  Reputation: 338

Like
0Likes
Like

Posted 16 June 2012 - 08:21 AM

Hi,

does anyone have an article or paper about how to implement a good drawing policy when rendering?

I remember to have seen one from the guys of Kill Zone, but I have been looking for it and I can't find it any more =S

Thanks!

Edited by はとぶ, 16 June 2012 - 08:22 AM.

"lots of shoulddas, coulddas, woulddas in the air, thinking about things they shouldda couldda wouldda donne, however all those shoulddas coulddas woulddas ran away when they saw the little did to come"

Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 6079

Like
0Likes
Like

Posted 16 June 2012 - 12:10 PM

I'm not sure what you mean by drawing policy - can you elaborate on what you are looking for?

#3 Jake Rivers   Members   -  Reputation: 338

Like
0Likes
Like

Posted 16 June 2012 - 03:30 PM

Thanks Jason,

Well, by Drawing Policy I mean a set of rules on how to sort in an efficient way all the materials, textures, etc... available in the current scene.
"lots of shoulddas, coulddas, woulddas in the air, thinking about things they shouldda couldda wouldda donne, however all those shoulddas coulddas woulddas ran away when they saw the little did to come"

#4 bronxbomber92   Members   -  Reputation: 275

Like
1Likes
Like

Posted 16 June 2012 - 07:00 PM

Christer Ericson has a good write-up on his blog about the bucket-sorting approach he used in God of War 3: http://realtimecollisiondetection.net/blog/?p=86

#5 L. Spiro   Crossbones+   -  Reputation: 18950

Like
2Likes
Like

Posted 16 June 2012 - 09:34 PM

You may find this useful.


L. Spiro

#6 Jake Rivers   Members   -  Reputation: 338

Like
0Likes
Like

Posted 18 June 2012 - 10:23 AM

Ahhh!.. thank you bronxbomber92, thank you L. Spiro,

those articles are exactly what I was looking for.

Thanks!
"lots of shoulddas, coulddas, woulddas in the air, thinking about things they shouldda couldda wouldda donne, however all those shoulddas coulddas woulddas ran away when they saw the little did to come"

#7 Fredericvo   Members   -  Reputation: 830

Like
0Likes
Like

Posted 20 June 2012 - 08:55 AM

One thing about sorting objects confuses me. If a mesh is made of different subsets, i.e. opaque and transparent and many instances have to be drawn should you break up drawing calls such as to draw all the opaque subsets first and then reiterate through all objects and draw all transparent parts? An example of a house with windows and a whole street filled of those I'd have to draw all wall instances then later draw all window instances?

EDIT : I think the article about render queue might answer my question after all

#8 web383   Members   -  Reputation: 804

Like
0Likes
Like

Posted 20 June 2012 - 12:55 PM

An example of a house with windows and a whole street filled of those I'd have to draw all wall instances then later draw all window instances?

In order for things to look correct, yes.

#9 Fredericvo   Members   -  Reputation: 830

Like
0Likes
Like

Posted 24 June 2012 - 05:12 PM

An example of a house with windows and a whole street filled of those I'd have to draw all wall instances then later draw all window instances?

In order for things to look correct, yes.

So is switching vertex buffers relatively cheap?
i.e.
Setstreamsource vbcar
Draw all opaque parts of every car instance
Setstreamsource vbhouse
Draw all opaque parts of every house
Set transparency
Setstreamsource vbcar
Draw all transparent parts of every car instance
Setstreamsource vbhouse
Draw all transparent parts of every house

Part meaning subset in d3dx mesh terminology even though I actually use DIP calls directly.


#10 jameszhao00   Members   -  Reputation: 271

Like
0Likes
Like

Posted 24 June 2012 - 10:39 PM

If you have an AMD GPU, you can download PerfStudio and use its API trace feature to look at CPU API timings.

#11 web383   Members   -  Reputation: 804

Like
0Likes
Like

Posted 26 June 2012 - 10:50 AM


An example of a house with windows and a whole street filled of those I'd have to draw all wall instances then later draw all window instances?

In order for things to look correct, yes.

So is switching vertex buffers relatively cheap?
i.e.
Setstreamsource vbcar
Draw all opaque parts of every car instance
Setstreamsource vbhouse
Draw all opaque parts of every house
Set transparency
Setstreamsource vbcar
Draw all transparent parts of every car instance
Setstreamsource vbhouse
Draw all transparent parts of every house

Part meaning subset in d3dx mesh terminology even though I actually use DIP calls directly.


Yes this is correct. And, if you want, you can sort your opaque and transparent objects by shader, then by texture - as described by the links by L. Spiro and bronxbomber92.

Just keep these simple rules in mind, and don't bog yourself down with premature optimization until it really becomes an issue. Implement something simple, then profile it before going any further.




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