SHADER setting-up trees

Discussion in 'Tracks' started by jarodyi, Nov 4, 2014.

  1. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    326
    Likes Received:
    277
    I don't know what trees you are looking at but in many areas the colors of trees will vary greatly from species to species. So variation in the tree walls can be very useful. I would actually really like to have variation be an option on the kstree shader but we never got it. There has been work on custom shaders so maybe we can get it that way.

    Another note for tree walls is that it is best on the first wall to point the bottom normals down or at 90*. This will darken the bottom to better match the Y trees. Otherwise you will see the bright tree wall though the trees down by the trunks.
     
  2. mantasisg

    mantasisg Active Member

    Joined:
    Nov 21, 2017
    Messages:
    179
    Likes Received:
    147
    Thats good tip for bottom normals of treeline, LilSki, definitely will check out that next time I am working with them. Tree wall solid 4vertices plane, or divided by half verticaly ?

    As for color variation, I suppose it is true for tree walls just to reduce possible repetition impression, as it was said. I would try just to use longer texture, maybe even 4096x512, it is easy to compose by using Y trees textures. But for Y trees IDK, spieces to spieces yes, but different spieces - different tree texture should go anyway, I would think so.
     
  3. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    326
    Likes Received:
    277
    No vertical subdivisions on the walls. Just 4 vertices per face. Also you don't need shadows on the walls usually.
     
  4. Kornepheros

    Kornepheros New Member

    Joined:
    Dec 12, 2018
    Messages:
    2
    Likes Received:
    0
    I am having problems with the "KSTREE_GROUP_name_number" feature. I have 493 trees, each as separate object in Blender, and named sequentially as follows:

    upload_2018-12-31_16-59-12.png

    When I load my exported FBX file into the ksEditor, I get the following results:

    upload_2018-12-31_17-6-9.png

    One of these "A" items is a (apparently random) set of trees that are correct. A few of the other "A" items are sets of trees with incorrect materials assigned. And all other "A" items are individual trees with a "FBX_MATERIAL" assigned as a material, which is not a material in my Blender file, appear black on screen, and cannot be assigned a texture within ksEditor.

    Things I've already tried:

    1. I have the same issue whether I use Blender 2.79 or Blender 2.8. (I love the changes in 2.8 by the way!)

    2. I have tried breaking the trees into small groups (KSTREE_GROUP_A_number, KSTREE_GROUP_B_number, etc.), but each of the groups display the same behavior. Maybe the groups have to be quite small? If so, does anyone know the limit? I've experimented with different quantities of trees per group, but have not been able to get anything to work, although I've had a few small groups (< 10 trees) work correctly.

    3. I have tried sequencing the trees using numbers 1-493 WITHOUT padding with zeros and WITH padding zeros, with no change to the behavior.

    4. I've looked for trees that might have an extra material assigned within Blender, but haven't been able to find any.

    One thing I also want to point out: In LilSki's tutorial screenshot of ksEditor, I notice that he has at least two of most groups listed under BLOCKTRANSFORM (for example he has two "A" items and two "B" items listed). How and why does this happen?

    Does anyone have advice that might help me solve my problem? My track is looking pretty silly with trees that look like this:
    upload_2018-12-31_17-18-26.png
     
    Last edited: Jan 1, 2019
  5. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    326
    Likes Received:
    277
    They can't be multiuser objects on export.
     
  6. Kornepheros

    Kornepheros New Member

    Joined:
    Dec 12, 2018
    Messages:
    2
    Likes Received:
    0
    Thank you LilSki! I applied "Make Single User -> Object & Data", and it looks great now.
     
  7. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    326
    Likes Received:
    277
  8. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    Hi guys, trying to get my trees working on my first track.
    All good with 'single' panel Y trees, but weird shadow with split panel version.

    upload_2019-9-6_23-32-3.png

    Getting this in the editor (triangular shadow - should be smooth transition instead of pure black...):
    Got my naming OK and origin at the base of the object. Any suggestions?

    thanks in advance!!!!!!
    upload_2019-9-6_23-33-30.png
     
  9. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    390
    Likes Received:
    300
    Are the vertices welded?
     
  10. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    Just tried it, manually merged all nodes of opposite faces to be 100% sure, still got same result in editor....

    EDIT: Double-checked... one was missing - now 1/2 faces are disapperaring when merged... Now I know where to look, thanks!
     
  11. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    390
    Likes Received:
    300
    Sorry man, I don’t use blender... so can’t help much. Hopefully one the blender wizards will see this soon!
     
  12. luchian

    luchian Administrator Staff Member Pilot RLR

    Joined:
    Jun 3, 2014
    Messages:
    2,536
    Likes Received:
    1,117
    Can you attach the file ? I will have a look. I need to monkey-click stuff, not good at guessing (..but if I had to, I'd look at: vertices, origin, normals).
     
  13. Bory123

    Bory123 New Member

    Joined:
    Feb 4, 2016
    Messages:
    6
    Likes Received:
    2
    Had the same issue.
    Just move the tree model origin slightly below the bottom vertex, also make sure the bottom vertices are on the same level by scaling on Z axis.
     
    Patrice COte likes this.
  14. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    That was it!!!!! Just moved model 5mm lower, and bingo! Thanks a lot!!!!!!

    It works great for the leaves, but now I loose all the white of the trunk in the lower part... I'll try different height for the face split to get a better compromise.

    upload_2019-9-7_10-23-31.png
     
  15. Bory123

    Bory123 New Member

    Joined:
    Feb 4, 2016
    Messages:
    6
    Likes Received:
    2
    Great!
    And if you put the tree on the ground the trunk should be properly exposed.
    Since there is only single object on your screenshot the engine is exposing for highlights, so i think you're ok with the origin as is.
     
  16. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    Hi guys,
    I'm stuck again with a weird bug with my trees.
    The ALPHA channel is messed up (or so it seems). Basically, any transparent face locate BEHIND the tree will be drawn in front (including face of the Y tree on the oppposite side).
    So you can see small far away trees overlaid in front of nearby trees, or even building windows, track lines.

    I haven't found anything anywhere on the forums about similar issue.

    Capture_messed_up trees 3.JPG

    Capture_messed_up trees 5.JPG

    Capture_messed_up trees 7.JPG

    Capture_messed_up trees 8.JPG

    What I did so far:
    - All trees (8 variants) are on one single texture, DDS DXT5, no mipmaps (with or without, same results)
    - In Blender, all trees object and data are single user (particle system converted to mesh)
    - All trees object (Y shape) are derived from same base mesh the was scaled.
    - One or 2 individual trees combination are OK, and do not have the problem. Meaning for instance the number 7 will always show up on top of number 1 (as it should), but other types will show thru number 7.
    - Shader ks_tree, with typical settings
    - Object named with KS_TREE scheme (blocktransform seems to work just fine during import). Apart from that bug the trees look as expected (I think).

    My conclusions so far,
    A- it looks like it's not the texture itself (dds file), some trees are OK some not, but they have the exact same material and image applied.
    B- No shader settings changes the result. Even with opaque blend (no alpha blend) this problem remains the same. Probably not the shader then.
    C-I suspect a FBX export or Import issue (or Blender setting??)

    Any help or suggestion would be really appreciated (entire forest of trees and shrubs waiting!)
     
  17. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    326
    Likes Received:
    277
    Do not use alphablend mode with trees. You should be using alphatest
     
  18. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    Ok, thanks! I'll change that. No impact on transparency issue unfortunatly.

    If it would help I can make available a small FBX or .BLEND file with a few trees if someone what to check it out.
     
  19. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    390
    Likes Received:
    300
    Like LilSKi said, alphatest is a must... Also you have the "IsTransparent" setting set to "True" in the object tab, try setting it to "False"
     
    luchian likes this.
  20. Patrice COte

    Patrice COte Member

    Joined:
    Jan 3, 2018
    Messages:
    32
    Likes Received:
    39
    yes... object were all set to "true"....... and false solves it all.
    *really* feeling stupid at the moment. But now I can move forward!

    Thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice