jfcameron/gdk-graphics

model: transparency_strategy enum + factory param

Opened this issue · 0 comments

add enum class "transparency_strategy" to model. { per_entity, per_triangle }.
make_model factory method will have a transparency_strategy param.

in implementation, if the strategy is triangle, then a copy of the vertex_data is kept if the provided vertex_data's primitive type is triangle. During transparency pass, if this mutable vertex_data is present, it will be sorted per tri and uploaded to the vbo before drawing.

additionally, if per_tri is selected, uploaded data should always be streaming. user calls to update_vertex_data should ignore the user usage param and upload streaming instead

default strategy is per_entity, as this is cheaper both in time, storage, and for the most part I think users should be able to arrange scenes such that per entity is good enough. per tri is really only needed when a complex shape can blend with its own geometry