• Advertisement
Sign in to follow this  

Good article on Drawing Policy

This topic is 2031 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

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 ???

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure what you mean by drawing policy - can you elaborate on what you are looking for?

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Ahhh!.. thank you [b]bronxbomber92[/b], thank you [b]L. Spiro[/b],

those articles are exactly what I was looking for.

Thanks!

Share this post


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

Share this post


Link to post
Share on other sites
[quote]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?[/quote]
In order for things to look correct, yes.

Share this post


Link to post
Share on other sites
[quote name='web383' timestamp='1340218513' post='4951083']
[quote]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?[/quote]
In order for things to look correct, yes.
[/quote]
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.

Share this post


Link to post
Share on other sites
If you have an AMD GPU, you can download PerfStudio and use its API trace feature to look at CPU API timings.

Share this post


Link to post
Share on other sites
[quote name='Fredericvo' timestamp='1340579521' post='4952467']
[quote name='web383' timestamp='1340218513' post='4951083']
[quote]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?[/quote]
In order for things to look correct, yes.
[/quote]
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.
[/quote]

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.

Share this post


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

  • Advertisement