Skip to content

After using depth testing, the transparency became quite strange #198

Answered by greggman
ouzhou asked this question in Q&A
Discussion options

You must be logged in to vote

Yea, sorting is no fun but it's in most solutions for this kind of thing.

One idea: You're storing much of the data in a vertex buffer which means it's always going to be used in the same order. If you use a storage buffer, then you can choose the order since you can randomly access the data. That means, all you'd have to do is pass in a sorted array of indices. Use effectiveIndex = sortedIndices[instance_index] or something like that and then accesss the data you have now in a vertex buffer, in a storage buffer instead.

It's probably not worth it. Your circles are only 4 values right now (x, y, depth, size). But just passing it on.

Is the priority of depth higher than blend?

I'm not su…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ouzhou
Comment options

@greggman
Comment options

@ouzhou
Comment options

@greggman
Comment options

Answer selected by ouzhou
@greggman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #197 on January 28, 2025 02:12.