-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imlement Painting by Slope tool setting #282
Comments
Did a quick walk over some of the header files -- I think this case would be the spot to add logic which restricts painting based on slope? Coupled with expanding the brush data definition here to include some slope-restricted-painting parameters? (and producing some editor UI stuff for end users) (Confirming my understanding before attempting a PR) Looking at the current issues in the 9.x and 1.0 roadmap, onlyhttps://github.com//issues/174 pops out to me as a coupled feature. Would GPU painting introduce breaking changes in _operate_map() potentially? |
Painting based on slope can be applied to painting texture, color, wetness, autoshader, navigation. So the gdscript This code you've highlighted is the controlmap, which is the correct place to filter based on slope for painting texture, autoshader, and navigation. Do consider how the autoshader handles slope. If there's a better way to calculate slope, that's fine, we can change it, I just want both settings to match so one it to match, so you can take the value from one and stick it in the other and it blends the same. get_normal() will help you. I hope looking up all of those heights won't slow it down, but it probably will, considering how much slower the smooth brush is. It may not be feasible to implement this until GPU painting works. So if it is any slower, then at the least, have a checkbox to enable/disable slope painting.
Implement it without considering GPU painting for now. There's much more testing and planning to do before we start on that. We will refactor a lot of code to get it working. |
Thanks for the understanding confirmation, broader requirements and suggestions.
The speed issues/limitations of the smoothing brush can probably be mitigated/side stepped a bit for texture painting because the values aren't being changed. No promises on speed, but definitely will make it a toggle/checkbox.
I've looked through the auto_shader, dual_shader and main shader code to get a tentative understanding of how the auto shader handles slope in the context of the shader overall. the I'm not super comfortable with bitwise operations and don't fully understand what in
|
I'm sorry I missed this message. I'll answer these questions for posterity.
Smooth is slow because it's doing 4-5 height lookups and averages them.
Control is a uint that stores a bitfield defined here https://terrain3d.readthedocs.io/en/latest/docs/controlmap_format.html
Component-wise operations between scalars and vectors are applied to all elements of the vector. That's a normal operation in glsl. You can see it with There is a beginning implementation in #456. |
Description
Filter painting based on slope. Eg only paint on flat surfaces, or only on a certain angle.
This should be a
tool setting
, visible on all painting options: texture, color, wetness, autoshader, navigation.See #96 for a slope sculpting tool.
The text was updated successfully, but these errors were encountered: