4
$\begingroup$

I have a mesh of a terrain with seperate models of a large building and various roads and parking lots on top of it. I wanted to add a tree particle system to the faces of the terrain not covered by the building and roads and I wanted to know if there was a way to select only the faces that are not covered. All of the faces that I want to select are visible when looking from above.Screen Capture enter image description here

$\endgroup$
  • $\begingroup$ Please show your work as a Blender screen capture. $\endgroup$ – atomicbezierslinger Feb 18 at 17:15
5
$\begingroup$

enter image description here

Please click on the image to see a larger image. Particles are emitted in the areas not covered by buildings as explained below. A flat plane is the terrain. A torus and cone represent simple buildings. The buildings are in wire mesh mode to indicate no particles are in that area of the terrain. The yellow arrow shows the particle [density influence] with a check mark.

enter image description here

In the image above the building area have been expanded by blurring in a 2D image manipulation program. Perhaps Blender. Blur, Dilate, Erode can be used. This helps to eliminate trees placed too close to buildings.

  • In the particle panel, Textures can determine the areas of particle emission.
  • The plane has a UV projection. Use that UV projection as needed.
  • GIMP image manipulation was used. GIMP is free. Use the image manipulation tool of your choice.

  • You can hand paint the image if that suits your tastes in what follows below or use the other tools that come with your image editor.

  • You can easily render and create an image of the top view of your scene, with orthographic projection. I used a low quality workbench render with flat colors. You may choose to temporarily have your terrain in an unusual color such as bright green as in green screen for the top view render. You can save a single image with a name such as image001.png.

  • Use an image manipulation tool to process the image001.png for about 33 seconds, to increase contrast if necessary, and building area dilation. This image can be processed to achieve a gray scale or black and white image. In the first image above you see a green and white image. Next it was processed to get the solid green and solid black image for high contrast. Black for no trees. White or Bright for trees. The new image was saved as image002. Use this image002.png to control emission density. Of course choose image names that are suited to your tastes.

  • A texture slot was added in the particles panel. The same texture slot was edited with the texture panel to change the [Influence Density]. The image image002.png was specified.

  • Please inspect and improve any steps.

|improve this answer|||||
$\endgroup$
  • 3
    $\begingroup$ Can also bake to obtain the texture (probably above a vertical sun light).. $\endgroup$ – lemon Feb 18 at 17:36
  • $\begingroup$ "You may choose to temporarily have your terrain in an unusual color " - would it be a good idea to use the material index / object index in the compositor for that? $\endgroup$ – John Dvorak Feb 19 at 11:13
6
$\begingroup$

Another way is to use vertex weights.

But this technique needs either :

  • That you group all of your objects into one (Object > Join when selecting multiple objects)
  • Use as many "vertex weights proximity" modifiers as you have different obstructing objects.
  • Create a "proxy" object mesh which will encompass all your other objects. You can then deactivate rendering for this object and hide it in viewport or set it to bounding box display so that it doesn't bother you.

So :

  • Add a vertex group to your terrain
  • Add a particle system to your terrain set to Hair
  • In the "Vertex groups" foldout of the particle system, set the "Density" to your group

enter image description here

  • Important : In Emission > Source, check "Use modifier stack"

enter image description here

  • Add a "Vertex Weight proximity" modifier to your terrain. Place it in first position, before the particle system. Set the Vertex group to your newly created group, the object to the obstructing object. Set the distance to geometry, and you can SHIFT + Drag to select Vertex, Edge and Face. Set the fallof to median step. Keep "Lowest" to 0 and crank up Highest till your trees visibly get pushed out of your geometry.

enter image description here enter image description here

Note : It won't update directly if you move the obstructing object. You need to toggle off/on the particle system for it to update. It will update if you move the terrain itself.

|improve this answer|||||
$\endgroup$
  • 4
    $\begingroup$ Nice because it doesn't depend on the resolution of a bitmap. I guess you could link the terrain to a 'Canvas' collection, and all the buildings to a 'Brushes' collection and abuse Dynamic Paint as a way into a Vertex Weight layer, too. $\endgroup$ – Robin Betts Feb 18 at 21:06
  • 1
    $\begingroup$ Right that would remove the hassle of going around having multiple obstructing objects ! $\endgroup$ – Gorgious Feb 19 at 7:31
6
$\begingroup$

As @lemon has commented, an alternative method for generating the raw texture might be to temporarily disable all your lighting, replace with a Sun lamp pointing vertically down in Z, and (using Cycles) bake a shadow map, as shown on the left.

enter image description here

If you set the angle of the lamp wide, to get a soft shadow map, you can have some control over the margin between the buildings and the trees, by putting the texture through a color ramp, and out into an Emission shader. You can then re-bake the resulting Emission.

Optionally, retouching can all be done inside Blender, using Texture Paint.

|improve this answer|||||
$\endgroup$
  • 3
    $\begingroup$ Can we call you Robin Bestt? $\endgroup$ – lemon Feb 18 at 19:45
  • 3
    $\begingroup$ @lemon Moi? You could try, but I don't think my extraordinary humility would permit it. $\endgroup$ – Robin Betts Feb 18 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.