Good article on Drawing Policy

Started by
9 comments, last by web383 11 years, 10 months ago

[quote name='web383' timestamp='1340218513' post='4951083']
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.
[/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.

This topic is closed to new replies.

Advertisement