Repository navigation
cloud_sky: draw the far shells in the volume layer, over the water - #1036
Merged
Merged
Conversation
VTK composites every volume over the translucent layer whatever its depth, so a water or sea volume (generated_world's water, wave_sea) covered the far cloud shells above it. GeometryNode::setDrawWithVolumes() draws a mesh in the volume layer instead, in its place in the renderer's prop order, as translucent geometry draws. cloud_sky's shells use it, and its tick keeps the props ordered [others, shells, near cloud volumes]: the deck is above sea level, so in front of the water, and the near clouds are in front of the shells. A node shown again rejoins the renderer at the end, so the order is restored when it drifts. Test: cvcgl_ariadne_realize checks the shells draw in the volume layer.
Owner
Author
|
Local results on Windows (Release, cvcpkg prefix): the full cvcGL suite ( |
…er-water # Conflicts: # src/cvcGL/ariadne/lsystem_nodes.cpp
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The terrain lab's fuzzy (far) clouds were drawn behind its water: a lake's dark blue showed through the cloud above it.
Cause. VTK draws its layers in a fixed order: opaque, translucent, volumes, overlay. Each volume is composited over the translucent layer whatever its depth. The far cloud shells are translucent geometry and the world's water is a volume, so the water covered them. The near clouds are volumes themselves and were drawn after the water, so they were fine.
Fix.
GeometryNode::setDrawWithVolumes(bool)(new). Every GeometryNode's actor is now a smallvtkOpenGLActorsubclass. A node that asks for it sits out the opaque and translucent layers, and with them the shadow bake. It draws in the volume layer instead, in its place in the renderer's prop order among the volumes, as translucent geometry draws: blended, depth-tested against the opaque geometry, writing no depth. Other nodes are unchanged.SceneNode::setVisibleremoves and re-adds its prop), so the tick restores the order when it has drifted. It is a walk of the renderer's prop list each frame, and a move only when needed.Checked natively (arigl snapshots of
terrain_lab.ari, 1280x720):near: 0), from above, the cloud over the east lake shows the lake's dark blue before the fix and white after. It matches the same view with the water lowered out of the world.cvcgl_ariadne_realizechecks that the far shells draw in the volume layer.Snapshots are in the shared notes folder,
cloud-shadows/13-17.With #1034. That PR replaces the generated world's water volume with opaque surfaces, which fixes terrain_lab on its own. This fix is still needed for
lsystem_forest.ari: therecloud_skysits over awave_sea, which is a VolumeNode. With #1034 it does no harm, since opaque water draws before anything in the volume layer.