Custom vertex paint on SpeedTrees

Hello!

Note : I started discussing the following problem on [the official SpeedTree forum][1]. I’m opening a discussion here because it might be related to Unreal’s way of handling vertex paint.

I’m currently investigating SpeedTree for UE4, testing if it could fit our art pipeline (for a stylized / non-realistic game). I’m loving it so far, but I’m wondering about vertex color usage. To cut it short : SpeedTree uses UV Channels (6 different UV coordinates) to store its data (wind animation, branch blending…), but leaves the R/G/B/A vertex channels available. Using [mesh paint][2] on a speedtree should be possible - and would be very useful for us.

The problem is : when custom vertex paint is applied on a SpeedTree instance (via Unreal Paint Tool), its wind animation becomes weirdly unstable / glitchy when moving the camera around :

http://gifyu.com/images/TreePaint_Bug.gif

It doesn’t seem to be material-related, since we’re using exactly the same material on both trees - we only added vertex color as a color overlay on the left. Here is our very simple leaves shader :

My questions:

  • Do you have any idea of what might be causing these glitches ? Is it related to what vertex painting is doing under the hood in Unreal ? Is it a know limitation of Speedtree’s UE4 Integration ?
  • Any workarounds ?

Thanks in advance!

Hi there.

Thanks for the report. I’ve also been able to reproduce it and it’s been entered into our bug database as UE-32762. When we have further information, we’ll update you here. Vertex painting ought only to be affecting the vertex colors, not additional UV channels, so this certainly seems to be a bug, rather than something by design. Regarding LODs, while it’s true that only the highest LOD’s vertex colors can be edited, these will always be propagated down to lower LODs, so it should be usable.

Rich

Hello,

He previously contacted SpeedTree support and we told him to post here for someone from Epic to possibly answer with more information. I am unsure of the recourse when something gets assigned to us and needs to be someone else…

Basically, we have reproduced the problem. Mesh painting seems to be stomping some of the static mesh texcoords we use for wind data. It looks like mesh painting only works on the highest LOD anyway, so using it with LOD might be problematic. It seems to be more of a mesh painting issue than SpeedTree.