Jump to content

Terrain MeshLayer bug collection


klepto2
 Share

Recommended Posts

Some bugs i found while playing with the terrain meshlayer system in the editor:

  • Per-Vertex Alignment has wrong lighting:
    • fix in Vertex.glsl
      • line 148: the if statement needs to be removed
  • Slope and Height settings are not working and not updating the already filled instances (update might be intendedm but feels unnatural)
    • slope see image slope (completly undefined)
    • height see image 2 (it seems like the min height is an offset from left and right, the maxheight acts a bit similar to the slope settings)
  • Weight settings are not intentional
    • When you add a new variation:  the previous variations are divided by 2 and the new variation gets the remaining possible weight
      • Samples:
      • 1 Layer: weight = 100
      • 2 Layers: L1 = 50, L2 = 50 (ok)
      • 3 Layers: L1 = 25, L2 = 25, new L3 = 50
      • 4 Layers: L1 = 13, L2 = 13, L3 = 25, new L4 = 50 
      • ...
    • this also leads to problems when editing the weight per variation as you can not exactly make everything lets say 25 percent as the other variations are also updated and readjusted.
    • to solve this, I would suggest the following:
      • for each variation, let the weight be a range of 0 to 100 (or whatever value someone would like to set up)
      • for distribution, calculate the probability by summing up all variation weights and then calculate the real probability by dividing the specific variation weight by the total weight of all variations
      • Sample 1:
        • 4 Layers each have a probability of 100%
        • total weight = 400
        • weight per layer = 100 / 400 = 0.25
      • Sample 2: 
        • 4 layers:
          • L1 = 30
          • L2 = 100
          • L3 = 10
          • L4 = 70
        • total weight = 210
        • weight per Layer:
          • L1 = 30 / 210 = 0.142
          • L2 = 100 / 210 = 0.476
          • L3 = 10 / 210 = 0.047
          • L4 = 70 / 210 = 0.33
          • Total: ~ 1.0

Image (Slope):

image.thumb.png.0faf974f457886f5d1ab5274f90ae0e1.png

image.thumb.png.b0cc34ea9f143c633d02f289e3c61e78.png

Image (Height):

image.thumb.png.ad0f187f8643c942a353819d3e0f1c98.png

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

On 5/15/2024 at 11:40 PM, klepto2 said:

Per-Vertex Alignment has wrong lighting

Grass and small plants  look best when the normals match the terrain normal. These are also the only types of objects that use the per-vertex alignment. So it seems to me these should go together, unless anyone can explain why it would not.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...