Discard transparent background pixels in the fragment shader instead of a separate CPU pre-processing step #369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reduces the loading times, at the cost of having to perform more checks on the GPU. I highly doubt GPU usage will be an issue however, whereas loading times are very painful in general.
The drawback here is that if a single texture was to be reused many times, it would incur a runtime cost for each instance, whereas pre-processing has a startup cost shared between all instances. But I doubt it's relevant here, and there's no mechanism to reuse resources currently, anyway.
Before this change:
yuno
takes about 2.1 secondsicecastle
takes about 2.2 secondspay_dun00
takes about 1.1 secondsschg_dun01
takes about 2.4 secondsprontera
takes about 0.9 secondsAfter this change:
yuno
takes about 1.5 secondsicecastle
takes about 1.9 secondspay_dun00
takes about 1.1 secondsschg_dun01
takes about 2.2 secondsprontera
takes about 0.9 secondsThe GPU frame time might be slightly higher, but I haven't measured since GPU usage is fairly low anyway.