Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#1920 closed enhancement (invalid)

[PATCH] Add the possibility to remove sorting by distance for not-so-transparent models such as trees

Reported by: wraitii Owned by: wraitii
Priority: Should Have Milestone:
Component: Core engine Keywords: patch
Cc: Patch:

Description

Some transparent models currently require sorting by distance, in order to avoid usual transparency artifacts if rendering is not done in the proper order. However, this is only really a problem with models that are actually somewhat transparent, whereas for example trees mostly use alpha as "opaque or transparent" in which case sorting by distance is not required. This speeds up the rendering a lot on maps with many trees, since we can then also speed the batching up. The attached patch also makes batching compare between all textures, though that change is minimal. In the patch, basic_trans_wind material (used by all trees that move in the wind) uses the new "model_transparent_nosort" effect which doesn't sort by distance. For full effect, this could also be used for most bushes, and perhaps other elements. Note that stuffs like lilypads shouldn't use it as that would case artifacts when there are many of them in the same spot (z-conficting). I'm posting this as a patch and a ticket, we still can not add it if it's undesirable, but the graphical artifacts should be minimal and/or unnoticeable, and the speed boost should be very noticeable.

Attachments (3)

NoSortingForTrees.patch (5.1 KB ) - added by wraitii 11 years ago.
model_transparent_nosort.xml (4.5 KB ) - added by wraitii 11 years ago.
NoSortTrees.patch (9.6 KB ) - added by wraitii 10 years ago.

Download all attachments as: .zip

Change History (10)

by wraitii, 11 years ago

Attachment: NoSortingForTrees.patch added

comment:1 by wraitii, 11 years ago

Keywords: patch review added

comment:2 by historic_bruno, 11 years ago

Hmm is that patch complete, I don't see where the "no-sorting" comes into play?

by wraitii, 11 years ago

comment:3 by wraitii, 11 years ago

Indeed, forgot a file. This should go in shaders/effects

comment:4 by Kieran P, 11 years ago

Milestone: Alpha 14Alpha 15

by wraitii, 10 years ago

Attachment: NoSortTrees.patch added

comment:5 by wraitii, 10 years ago

New complete patch (basically no changes). I'd like to commit this if possible, I'm about 100% sure it's graphically impossible to differentiate with SVN and it should be a tiny bit faster.

comment:6 by wraitii, 10 years ago

Resolution: invalid
Status: newclosed

Philip actually did this in [13753]

comment:7 by leper, 10 years ago

Keywords: review removed
Milestone: Alpha 15
Note: See TracTickets for help on using tickets.