Search Unity

Realtime terrain vertex painting?

Discussion in 'Shaders' started by Dobalina, Sep 28, 2019.

  1. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    50
    Hey everyone, I have a terrain vertex painting question.

    Here's brief explanation of what I have. I'm currently using a shaderforge material on my terrain. As with any typical terrain setup, I've hand painted the different layers (ie, grass,dirt,rock etc...) That all works and is fine...

    Next, I have a vehicle that drives on this terrain. I want to find some way that the tires will vertex paint my terrain as it traverses. Here's a somewhat similar example, except this is mesh only and doesn't support terrain painting. https://youtu.be/TWGK5UQ6KsU?t=23

    I know there are packages on the asset store that allow you to vertex paint on meshs via mouse clicks.... but I haven't seen much in the way of gameobject translation or collision painting the terrain. Any suggestions?
     
    Last edited: Sep 29, 2019
  2. unikum

    unikum

    Joined:
    Oct 14, 2009
    Posts:
    50
    Take a look at how the new painting tools works in Unity:
    https://github.com/Unity-Technologi.../TerrainEditor/PaintTools/PaintTextureTool.cs

    Now they are part of editor namespace and use other unityeditor classes, but you can easily rewrite them to your own classes. I've done this myself for my game that has real-time terrain painting and this new system is very fast. You get the same performance as if you paint in the editor.
     
unityunity