Im making a procedural tree generator, and need to blend the texture of the branches with the bark texture on the trunk, where the branches intersect the trunk.
Has anyone any clues as to how this could be done?
It’s based in UDK/UE3 but should get you started, there is a section near the bottom looking at blending grass and rocks:
Thanks - The problem with this method, is a tree isn’t planar.
For other people who don’t want to read it: planar projection is used to make same space UV’s of the objects you are blending, a mask is applied to texture the edges of the object to give it the same texture as the object it is blending with.
Speedtree blends branch textures automatically, but don’t know how i would do that in UE4
http://docs.speedtree.com/doku.php?id=branchintersections
I did this using temporal AA dither fade using pixel depth offset. The problem is that you must have different values for the parent and child otherwise the same temporalAA value will be on both so it will be like nothing happened. I solved that by storing ‘depth’ as an int on the vertex colors (ie, 0/255, 1/255) and then extracting an even/odd mask from that so that every other branch has greater offset amount which makes them out of phase.
Hi, Thanks for that piece of technical info! I saw it in a show about UE4 technology used in Paragon.
In the past I have tested this method using nonprocedural masks which faded the edges of the branch intersections; it looked OK but was hard to get a good effect on the really large branches. This is because you can see the parallax difference between the faded 3D geometry and the trunk as you move your view.
The reason branch blending is particularly important to me, is i want to generate some VERY large trees.
If anyone happens to know any other potential methods, that would be great; dither fading the branch intersection is not so suitable when the trees are unnaturally large.
Oooh, cool. I wonder if blending props with terrain in UE4 works the same as in UDK.