godot_heightmap_plugin
godot_heightmap_plugin copied to clipboard
Update multisplat16.shader
My own attempt at more organic blending for the multisplat plugin and preventing hard cuts when painting with low opacity
Could you add comparison screenshots between the old and new shader?
The pow in the function is to alleviate issues when there are more than 4 textures blending at the same time. If you paint with low opacity brushes with more than 4 textures you'll see abrupt cuts starting to show.
I can't show the assets i tested with but I can show in a clean project later.
As for the names, i have no idea either exactly what they do :D that's why they are not very descriptive. I'm open to any name you will propose ^^
When I have 5+ textures in one area, I often get lines like the dashed line across textures as you can see on the rock faces on the right and left (not the rock cracks). By pushing around the textures more I can eventually brush these out.
I inserted the changes to bump into my get_depth_blended_weights()
function, however none of them, nor any other parameter in that function affected those line artifacts. They did change other blended edges, but I have no issue with the default blend.
Regarding the functions:
-
1-sqrt(1-x)
is indeed equivalent to1-pow(1-x,0.5)
shown on graphtoy below. -
x*x
is indeed preferable to pow() for reasons discussed here: https://community.khronos.org/t/pow-x-2-different-then-x-x/70839/3 -
x*x*x
andx*x*x*x
are probably also better than pow for the above reasons. - Graphtoy shows the shape of all curves used.
1-sqrt(1-x)
is basically a slow linear line with an ease in ending. https://graphtoy.com/?f1(x,t)=1-pow(1-x,0.5)&v1=true&f2(x,t)=1-sqrt(1-x)&v2=true&f3(x,t)=xx&v3=true&f4(x,t)=xxx&v4=true&f5(x,t)=xxxx&v5=true&f6(x,t)=0&v6=false&grid=1&coords=0,0,2.3741360268016223