Repository navigation
Paint: saved meshes follow the paint, new values without the CSG - #65
Merged
Merged
Conversation
The hash that decides whether a model keeps the meshes saved with its scene (and so what a build takes) has each generator's paint and what the shader of each of its materials takes of paint. Paint changed outside the editor, or a shader that takes paint differently, builds the model when the scene opens rather than keeping meshes with the old paint.
When an entity's paint changes only in its values on the same grids, the values are written in place, the hashes of the surfaces they are on are put right in the brushes' cached buffers (the paint's part of a surface's hash is xor-ed in last for that), and the next update copies the meshes again without building a brush. New grids, a tree that kept its saved meshes, or brushes not built yet still have the brushes built.
The lists the paint part of the hash is gathered in are cleared after it, so a destroyed model's meshes aren't kept loaded through them.
Only a material resolved before whose paint attributes changed has every brush built again; a material resolved for the first time (every one, when the editor starts) is in the brushes being built with it, so models keep their saved meshes when a scene opens. The paint manager's work set is a set, emptied after each update so it holds no generator between updates.
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.
Follow-up to #63.
Saved meshes follow the paint
Painting without the CSG
Also