Search Unity

Creating a custom tree brush (based on slope, terrain texture etc.)

Discussion in 'World Building' started by VincentAbert, Aug 8, 2020.

  1. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello !

    I couldn't find any information online so here I am, wondering how hard it would be to add some constraints to tree painting, as mentionned in the title, like painting only if terrain texture is grass, only if it is flat etc.
    I can kind of see how I would make a script that clears every tree based on texture or slope (which might be the way I'll have to do this) based on the unity api, but is it hard to create a tool that would directly paint only where I tell it to, via script ? I'm pretty sure other people have thought about this, but I couldn't find it (maybe I'm using the wrong words in my research, English is not my native language).

    Thank you !
     
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
  3. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Yes it's one of those weird things, and I'm kinda surprised there is so little on this problem online.
    Thanks for the link, I started creating my own tool for trees and this will help do the same for details. it is quite an interesting experience as my first unity editor tool
     
    su17 likes this.
  4. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello again, I'm back because I can't think of another method than mine, but it starts to get a bit slow when I have a lot of trees. Basically I just loop through every every tree that exists and , depending on the chosen rule (let's say "keep only trees on that texture") I keep them or delete them. But with tens of thousands, or hundreds of thousands of trees, it can get quite slow, is there a better way ?
     
  5. crysicle

    crysicle

    Joined:
    Oct 24, 2018
    Posts:
    95
     
  6. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Allowing use of brush mask filters for painting Trees and Details is something we've discussed. Work on Terrain Tools so far for painting has just been height and splat modification.
     
    Flavelius likes this.
  7. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    So... any progress about painting trees and details with mask filters?
     
    Querke, wyattt_ and Deleted User like this.