SHADER setting-up trees

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

  1. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    oh i also learned those sub divisions are important
    upload_2021-11-17_23-30-0.png
     
  2. TheCheekiBreekiest

    TheCheekiBreekiest New Member

    Joined:
    Apr 9, 2020
    Messages:
    4
    Likes Received:
    0
    I have been trying to use that KSTREE_GROUP method from this thread, but for some reason the trees still look horrible?

    I have 2501 separate tree objects, each one named KSTREE_TreeAhornBerg_NUMBER, I used one single material for all of them, including some other joined Trees somewhere else, is that the problem or what did I do wrong here?

    [​IMG] [​IMG] [​IMG]
     
  3. sebbbl

    sebbbl New Member

    Joined:
    Mar 29, 2020
    Messages:
    6
    Likes Received:
    1
    Hello there,

    I'm new to modding and I'm struggling with trees.
    I think I've setup everything as it should, normals are correctly aligned, naming is ok too, but no way to avoid the trees self-shadows, and on the track it's just awful.
    For the moment the only walkaround I found is to set the Ambient to 1 and diffuse to 0, but if it works at daylight, it doesn't work anymore at night obviously.
    English is not my mother language so I may have missed something, though I read this thread a hundred times...

    Here's my result, thanks in advance for your help
    [​IMG]

    PS : I use C4D, and imported a Y shaped tree made with blender.
     
    quetillo likes this.
  4. quetillo

    quetillo Member

    Joined:
    Mar 20, 2020
    Messages:
    361
    Likes Received:
    15
    Location:
    España
    materials tab and activate the shadow
     
  5. sebbbl

    sebbbl New Member

    Joined:
    Mar 29, 2020
    Messages:
    6
    Likes Received:
    1
    Shadow is activated. What I want to get rid of is self-shadowing.
     
  6. sebbbl

    sebbbl New Member

    Joined:
    Mar 29, 2020
    Messages:
    6
    Likes Received:
    1
    Ok, found it. Not very academic but here's my walkaround :

    I used MATERIAL ADJUSTMENT : during the day, Ambient is set to 1 and diffuse to 0 and at night Ambient is set to 0 and diffuse to 0.25. Works like a charm. No more self-shadowing.
     
  7. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    You are getting some horrible advice... :lol:

    What you are experiencing is not self-shadowing but bad normals.

    Each tree needs to be a separate object, pivot point at the bottom and middle of mesh, and named kstree_group
     
    Fuzo likes this.
  8. John Harding

    John Harding Active Member

    Joined:
    Aug 5, 2021
    Messages:
    68
    Likes Received:
    127
    Sorry you've been waiting a while, perhaps you have this solved now. I had a similar problem, I solved it by making sure you don't have nested collections (or whatever you call it in Blender) before export. Basically that TreeAhornBerg, click it and delete it so that all the trees are on the base collection (you may wish to save as before trying it out). When you import to KSEditor it should come in under the BLOCKTRANSFORM layer (I don't see it from your screenshot) otherwise the normals haven't worked. Then change them to the KsTree shader.

    You can find my own struggles here somewhere, hopefully it helps:
    https://assettocorsamods.net/threads/pinwheel-circuit.2705/
     
  9. sebbbl

    sebbbl New Member

    Joined:
    Mar 29, 2020
    Messages:
    6
    Likes Received:
    1
    It is already the case. Anyway my method works, I'll et it like this and will try on another track.
     
  10. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    I brought this up in the CSP discord, but it fits here too. CSP 1.78 public adds a tree tweak that removes the vertical plane that might face the camera/view.

    Code:
    [SHADER_REPLACEMENT_...]
    MATERIALS =
    MATERIAL_FLAG_0 = 1
    Left side of the image shows how well this works!

    csp1.78-treefix.jpg
     
    luchian, Patrice COte and maruto like this.
  11. Rob Pawn

    Rob Pawn Member

    Joined:
    Sep 24, 2022
    Messages:
    89
    Likes Received:
    17
    Location:
    Germany
    Black Line on TreeWall
    Hey Guys... Page 4 bring out solutions for that black line over tree-walls when using ksGrass shader.
    If i take the ksTree shader it works fine. But i wanted to have the variation option without placing it by hand in blender.

    I always pay attention while UV editing - there is plenty of space to the top and bottom border.
    But i still have that black line. Normals pointing up. I don't get it. Any advice?
    (i will try the black bar on alpha channel now. But its still frustrating )

    Greetz

    ________________________

    ### EDIT ###

    SRY... well, i tried again with UV... and overdo the space to the image boarder.
    Now the Black line disappeared finally. but cutted off my tree top.
    hopefully i can find a good compromise without editing the texture image in resolution

    ________________________

    ### EDIT ###

    it keeps me frustrated... 6 pixel are not enough. the further you are away from the TreeWall, the more space u need between UV edge to texture edge. Finally i added 40 pixel on top of the texture image...
     
    Last edited: Sep 24, 2022
  12. Rob Pawn

    Rob Pawn Member

    Joined:
    Sep 24, 2022
    Messages:
    89
    Likes Received:
    17
    Location:
    Germany
    TreeWall Variation

    after i wasted the whole evening, there is no Variation visible. When i play around with values boh and scale the wall just disapears... any advice? (its one mesh with 8 faces / vertices are merged / normals pointing up)
     

    Attached Files:

  13. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    You need to use scale and gain, not boh

    upping gain, brings out the variation
     
    Rob Pawn likes this.
  14. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    1,048
    Likes Received:
    613
    That’s because of the mipmaps of the texture, the further you are from the tree wall? The smaller the texture gets scaled to.

    I know it’s frustrating, but I highly recommend you take a peek at how Kunos tracks are made, textures, shader values, etc.
     
  15. Rob Pawn

    Rob Pawn Member

    Joined:
    Sep 24, 2022
    Messages:
    89
    Likes Received:
    17
    Location:
    Germany
    Thank u very much Johnr777 for the helpful reply.
    Gain make it darker. With the x scale value i think i set the wideness and the texture gets a bit brighter again. but i still have no variation. maybe i just expect something else then it is actually workin.

    Is it like a KSmultilayer? 2 textures mixed together?

    i have 2 ImageTextures and thought it will fill the faces randomly...

    Probably i go back to ksTree Shader and make the variation by myself (randome face textures)
     

    Attached Files:

  16. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    i would try low values for scale too, like
    0.05 0.05
    or
    0.01 0.01
     
    Rob Pawn likes this.
  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