Sign in to follow this  
jakovo

Good article on Drawing Policy

Recommended Posts

jakovo    476
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
jakovo    476
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
jakovo    476
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
Fredericvo    1765
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
web383    804
[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
Fredericvo    1765
[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
web383    804
[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

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