forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable geometry fade/transparency in the Mobile renderer
This is mostly a copy-paste of similar changes in the Forward+ renderer, as hinted in godotengine#76774 (comment) and godotengine#87231 (review), along with a tweak to the shader and pipeline model. The shader pipeline tweak involves distinguishing geometry instance-enabled transparency from material-enabled transparency. A material cannot support transparency on a per-instance level; a separate pipeline must be used when rendering. Originally in c571e4a this was a non-trivial refactoring in Forward+ (which in the past few years has evolved a few more times to account for the multitude of combinations allowed there). I opted to follow a similar sentiment to `SceneShaderForwardClustered::PipelineColorPassFlags` in a simpler `SceneShaderForwardMobile::PipelinePasses` enum, which only accounts for don't-care or opaque pipelines vs. color transparency-enabled ones. This multiplies the number of `PipelineCacheRD`s by two, but otherwise accomplishes the goals without adding unnecessary changes or shooting myself or others in the foot (I hope). BTW I also reorganized and removed some redundant checks in `RenderForwardClustered::_geometry_instance_add_surface_with_material` (since I was comparing this side-by-side with the `RenderForwardMobile` version, which seems better-organized). There is no functional change since `has_alpha` is the only variable used and includes all the checks anyway.
- Loading branch information
Showing
9 changed files
with
89 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters