Tracks Sveg, Sweden

Discussion in 'Assetto Corsa Modding Discussions' started by LeonS, Oct 12, 2017.

  1. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    when I export the trees as individual objects and import them, something goes wrong with their material -- any ideas what causes this?

    weird_trees.jpg
     
    Last edited: Oct 30, 2017
  2. Fat-Alfie

    Fat-Alfie
    David Pemberton Premium

    Messages:
    1,155
    Ratings:
    +1,995
    They should be using ksTree with AT blending mode, and ksAlphaRef set to about 0.5 (to allow shadows)
     
  3. LilSki

    LilSki
    Premium

    Messages:
    1,466
    Ratings:
    +3,545
    Hrmm are you assigning materials to your objects in blender? The FBX_MATERIAL is strange.
     
    Last edited: Oct 30, 2017
  4. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    Yea, so I made a new group for one tree with a material attached to it, and used that group as the source for the particle system. So in theory all those trees should have the same material. You can see some of them have the right material on them, but most of them don't, even though they're supposed to be all the same.

    I know, but I can't even load a texture manually on those, it'll just stay "NULL" in AC.
     
  5. LilSki

    LilSki
    Premium

    Messages:
    1,466
    Ratings:
    +3,545
    AHA think I got it. They can't be linked multiuser objects. Select all and hit U and select object data then export and see how that works. Make sure the material name in editor matches what you have in blender.
     
    • Agree Agree x 2
  6. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    that does it :)
     
    • Like Like x 1
  7. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    Ok so my trees somehow still don't make use of the kstree shader feature. Here's what I'm trying:

    1) set up y-tree with vertex normals facing up, call it KSTREE_PINE_TEST, put it in a group of its own
    ___tree_issue.JPG

    2) use particle system with said group as source
    ___tree_issue2.JPG
    3) convert group, unlink trees, export as fbx
    ___tree_issue3.JPG
    4) import to blender, use ksTree shader with 0.3 / 0.3 on the first 2, alpha = 0.6
    ___tree_issue4.JPG
    And they are lit top to bottom, like the "TREE" in your example. What am I doing wrong?
     
  8. Fat-Alfie

    Fat-Alfie
    David Pemberton Premium

    Messages:
    1,155
    Ratings:
    +1,995
    typo
     
    Last edited: Oct 31, 2017
  9. Fat-Alfie

    Fat-Alfie
    David Pemberton Premium

    Messages:
    1,155
    Ratings:
    +1,995
    KSTREE_GROUP_xxxx
     
    • Wow Wow x 1
  10. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    So here's a comparison between using the KSTREE shader properly (1st image) and not doing so (2nd image). Each of them at three different times of day.

    ___tree_test_KSTREE.jpg ___tree_test_STD.jpg

    In principle I like the effect, but especially at noon (middle) the effect looks way overdone. Even in the evening it looks like this:

    ___tree_test_KSTREE3.jpg

    Have you guys experimented with setting the horizontal cut in the tree faces to different heights?

    The next problem is that the tree walls that I place behind a few rows of trees don't have the same shader effect, which leads to the wall being clearly visible at times:

    ___tree_test_KSTREE4.jpg

    Here's another straight-on comparison of the two settings:
    ___tree_test_KSTREE2.jpg ___tree_test_STD2.jpg

    Suggestions? :)
     
    • Like Like x 2
  11. Stereo

    Stereo

    Messages:
    2,703
    Ratings:
    +1,746
    It seems to me it'd look better if the base of the trunk was how it is near the bottom of the foliage. Which I think would mean moving the object origins downward so that ground level is maybe 2-3 meters above the origin.
     
  12. LilSki

    LilSki
    Premium

    Messages:
    1,466
    Ratings:
    +3,545
    Well two things make sure the tree is sub-dived once on the vertical.
    upload_2017-10-31_0-51-17.png

    And also there should be some AO on the ground making it darker. Yes I am aware this is a different type of tree but same rules apply. There is no "shadow" shown here only AO under the trees.

    Screenshot_ks_porsche_962c_shorttail_bridgehampton_31-10-117-0-54-32.jpg

    And then for tree walls you need to a normal trick so they act the same way. You need the blend4web addon so you can edit the normals directly. This is how they should look.

    upload_2017-10-31_0-49-17.png
     
    Last edited: Oct 31, 2017
  13. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    whats AO? :redface:
     
  14. RasmusP

    RasmusP
    AC Stuff and G27 help Staff

    Messages:
    3,825
    Ratings:
    +1,335
    That thing I know! :roflmao:

    Ambient Occlusion :)

    No idea what to do with it, but happy to supply the wording :p
     
    • Haha Haha x 2
  15. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    Alright, so I see the idea behind the wall fix. Couldn't that also be my solution for the trees? As far as I understand the kstree shader overwrites the vertex normals in the trees so they all face up except the ones on the ground face down? Or where exactly do they face? Cause it feels like there should be a way of manually setting the vertex normals and placing the division in the tree faces in order to make my trees look right?
     
  16. Fat-Alfie

    Fat-Alfie
    David Pemberton Premium

    Messages:
    1,155
    Ratings:
    +1,995
    I use this technique on the right, which allows you to give the trees a more rounded feel than simple Y-trees, but uses fewer tris than an additional vertical segment on the left (18 tris vs 24tris - that soon adds up with 7-10k trees on a track).

    Wherever you add the additional vert on the upright dictates where the 'underside' shading starts. It gives pretty much the same effect but is slightly more efficient I guess.
    tree-normals-1.jpg
     
    • Like Like x 3
  17. ltcars

    ltcars

    Messages:
    1,273
    Ratings:
    +474
    Lol, I thought for a second on first glance that this is a real life photo
     
    • Agree Agree x 2
  18. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    Introduction
    Let's do some science...

    Methods
    3x3 experimental design + placebo
    ____blender.jpg

    Results

    ____ace.jpg

    1) So the kstree shader has two effects: (#1) darken the lower part of the tree with a smooth fade to the top ("shadow gradient"), and (#2) bringing some mostly horizontal brightness gradient to the tree to get rid of the flat look ("highlight gradient").
    2) putting the origins below the faces gets rid of the shadow gradient altogether, but does not interfere with the highlight gradient (upper row).
    3) putting the origins mid-tree doesn't change much vs. the bottom of the tree with respect to the shadow gradient (middle vs. lower row left+center), unless the origin is above the cut-line in the trees, then the tree gets all dark (middle vs. lower row right)
    4) the height of the origin has an effect on the highlight gradient, as is evident by the very bright highlights in the bottom row, middle tree. there also seems to be an interaction with the cut-line, as the very bright highlight spot is only there for the front row middle tree, where the origin is very close to the cut-line.

    Conclusion
    While for the shadow gradient the upper end can be varied by varying the position of the cut-line, its strength (i.e. how dark the shadow gets) cannot be altered, since it always starts at 100% at the bottom of the tree.

    Outlook
    Next step will be to extend the tree a few meters into the ground and use a high cut-line to have a very long smooth shadow-effect gradient that should be at around 50% at ground-level.

    edit
    noticed something more about the highlight gradient, changed the post accordinly.
     
    Last edited: Oct 31, 2017
    • Like Like x 4
    • Love Love x 1
  19. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    New results are in...

    Methods
    ____1.JPG
    Clarification: The front row is 6 trees with their origins roughly at ground-level. The rear row is 2 trees, duplicates of the rightmost 2 in the front row, but lowered origins.

    Results
    1)
    ____2.JPG
    The height of the origin does influence the highlight gradient (effect #2). I now assume that is more of a circular brightness gradient, and it is additive.

    2)
    ____3.JPG The origin does not influence the shadow gradient (effect #1). In the first row, the two trees on the right with their extended geometry seem to have less of the shadow gradient simply because it starts a few meters below ground-level. The lower it starts, the less we see of the effect.

    Conclusion
    The ksTree shader has two separate effects that separate it from the alpha-only shaders.
    (#1) a shadow gradient (subtracting brightness) starting at the bottom of the tree's geometry, extending up to the horizontal cut-line in the tree. This affect appears to be linear and following a 1-dimensional gradient. This effect is absent if the trees origin lies below its geometry.
    (#2) a highlight gradient (adding brightness) starting at the origin of the object and extending outward in a somewhat radial fashion. This effect increases as the origin moves up towards the cut-line, and decreases as the origin moves below the ground.

    So what I'm gonna do is probably to go a middle way between the two rightmost trees in the front row, i.e., a roughly 10m extension below ground with origins at ground level.

    Appendix
    This is what it looks like from the underworld
    ____4.JPG

    edit
    improved phrasing clarity, updated conclusion
     
    Last edited: Oct 31, 2017
    • Like Like x 6
  20. LeonS

    LeonS

    Messages:
    232
    Ratings:
    +345
    Question @LilSki: Can I combine the KSTREE naming scheme and the KSLAYER naming scheme for LOD? Does the KSLAYER scheme also influence the lower track quality setting (for people with old GPUs)? Is there a good resource to read up on 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.