Improving Trees Shadows?

Discussion in 'Track Modding' started by Satangoss, Dec 2, 2015.

  1. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    Any suggestions on improving this funny tree' shadow? I'm learning how the stamp shaders and billboards work before insert trees in my track.

    Create other non-render object only for shadow caster is not much clever I'd say?

    [​IMG]
     
  2. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Same thing...

    BTW: BB doesn't get saved in the gjed file. It's still ticked when i reopen the .fbx but it doesn't do anything.

    I need to:
    - tick "none" first
    - then tick BB again.
    - then export the gmt's

    So i need to re-apply the BB everytime i open the track for export.

    View attachment 19430
    [​IMG]
     
  3. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    UV placement seems to have an affect were the object turns up in GJED.

    This is really annoying.

    View attachment 19436
    [​IMG]

    So UV up is down in GJED:

    View attachment 19437
    [​IMG]

    If i randomise the UV placement outside of the U0-1, V0-1 box. The object is translated in the other direction in GJED.



    Should the UV placement have an influence on this???



    BTW: open a ISI track (any track with GJED) and set BB to none and back again. :eek:
    View attachment 19438
    [​IMG]
     
  4. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Shawdows issue: A workaround is to put some smaller green stuff around the trees. Or create a seperate shadow caster.

    About the UV mapping having an influence on the the billboard placement. It seems the smaller the billboard plane the bigger the issue. The displacement of big trees is the same, a few centemeters with a 5 meter tree is not a big deal.
    I guess raising the sunken planes a bit will solve the issue.

    About the BB not saved in the GJED file: It's the Quad alignment that i need to re-apply. I only need to do this for export too GMT. So not a big deal.

    Don't know if it's correct but i need to apply center allignment. Bottom allignment will sink the tree halve way in to the ground.


    View attachment 19443
    View attachment 19444
     
    Slamfunk3 likes this.
  5. wizzfactor2

    wizzfactor2 Registered

    Joined:
    Nov 6, 2012
    Messages:
    38
    Likes Received:
    0
    The Poly axis is not right thats why its displaying incorrectly. So The only way I know is to select xform modifier and press reset selected in Max and then the shadows will display the right way :)
     
  6. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Working with Maya here. :eek:

    What does the xform modifier do?
    What's the correct way of the poly axis?

    What does "shadow bias" do in GJED? ==>
    View attachment 19511

    Why does ISI use seperate shadow casters for their trees?


     
    Last edited by a moderator: Mar 7, 2016
  7. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    We usually don't.

    I did for Atlanta Motorsports Park because of the very high hills with trees on top. There, if you don't use that trick you get truncated shadows when the sun if low because a billboard limitation. So, to workaround this, I did static X trees as shadow caster, no render, and billboards as NO caster and visible;



    Most of the time you don't have this kind of problems, so you can just go for standards BBs tagged as shadow casters too. :)
     
  8. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Got it... You did at Portugal too. Problably for the same reasons... So i thought it was becoming a standard way of doing tree shadows.

    I've got no hills on my track. Flat as a pancake.

    I'm still wondering what "Shadow Bias" do? Changing some values in there doesn't seem to change anything.
     
  9. wizzfactor2

    wizzfactor2 Registered

    Joined:
    Nov 6, 2012
    Messages:
    38
    Likes Received:
    0
    Even when Ive created a plane for a tree the way it was mentioned by one of the rf2 guys, it didnt display shadows correctly in rf2. So this is the only way I worked out how to reset. So it somehow resets the mesh axis so it can display the BB tree shadow correctly. Thats all I know. I dont know how it works, its like driving a car I know the controls but I dont know how they work exactly :)
    Also this procedure was mentioned by one of the rf2 guys :)
     
  10. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I still think there is something different with the GJED billboard shader and MAYA to FBX, then 3ds max with the gmotor plugin.

    After some forum-searching: in 3ds Max: The pivot of the billboard operates at Quad level and using the vertex numbers to determine its pivot point with vertex 1 and 2 as base line and a diagonal between vertex 2 and 4.
    - In Maya vertex numbers of a quad are 0 , 1 , 2 , 3. :eek: (Don't know if it's the same with Blender)

    in my case vertex 0 and 1 should be the base line.

    View attachment 19546

    This is why i choose center pivot in GJED??? is this the correct thing to do?



    An other thing is: If i open an exsisting ISI track and re-aply the billboard pivot point. The Tree is turned 90 degrees. So i think the GJED billboarding is different as the 3ds Max Gmotor plugin.
     
  11. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Yes, Blender uses 0 as the first vertex number on a mesh.


    Sent from my iPhone using Tapatalk
     
  12. Fuzzy Downer

    Fuzzy Downer Registered

    Joined:
    Mar 30, 2017
    Messages:
    7
    Likes Received:
    0
    @Gijs - I know this thread is over a year old, but any solution on setting up the vertex alphas and numbering for a set of billboarded trees in Maya? Where do I look to adjust the settings in Maya? Thanks for your video tutorials BTW. Maybe this could be the source for another (short) one.
     
  13. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Tip: Start with 1 billboard first. ;)

    what i did:

    - First create a plane
    - select the vertex
    - apply a vertex color set
    - apply vertex color alpha = 0,999 (make sure vertex RGB is white)
    - Triangulate the plane mesh

    Apply your tree texture ( a .png with an alpha mask in Maya, to preview the result)
    ==> to avoid the UV issue (see post #3) it's best to have 1 tree in your texture, So your plane matches with the UV plane.

    - Export to FBX and open it with gJED.
    - Assign a Billboard (Stamp vertex) shader to this plane. Example ==> Bump Specular Map T1 Stamp Vertex.
    - Assign your tree texture (.dds DXT5) and a spec and normal map (DXT1) (a placeholder if don't have one yet)

    - Object/Instance propperties
    ==> Screen-Aligned Quads tick BB
    ==> choose to "align center"
    ==> tick Omni and Spot lighting
    ==> tick shadow caster and texture



    If the tree is upside down or rotated 90 degrees in gJED. :oops:

    - Flip normals (Mesh display ==> reverse) and try again
    - Flip the diagonal (Edit mesh ==> flip triangle edge) and try again
    - rotate UV's 90 degrees and try again.

    It's a bit of trail and error to get a working billboard. :(

    To speed up this process, you can duplicate this tree a few times.
    Flip normals at 1 duplicate, Flip triangle at another duplicate... etc...



    But once you have a working billboard:
    - Duplicate it
    - Give the duplicate billboard a different material name with a different texture or crowd texture.
    - Duplicate it again for another type of tree.
    - Untill you have a few different trees.

    Export to FBX and assign the stamp vertex shader for the new materials.
    Once your materials have been setup in gJED and your billboards are showing up correctly, you can duplicate them and fill your scene with trees in Maya.

    Once your happy. "Combine" some trees into 1 object. So you have some groups of trees as 1 object.
    Prefer to combine trees close to each other, so you can LOD them out if the car is on the other side of the track.

    Export to FBX and assign the object/instance propperties to those treegroup objects
    ==> Screen-Aligned Quads tick BB
    ==> choose to "align center" ==> it's not saved in the gmenv file. You'll need to click this every time you open your project. :(
    ==> tick Omni and Spot lighting
    ==> tick shadow caster and texture



    So all trees and crowd billboards are duplicates of that 1 working billboard. :cool:
     
    adamfarmer and Fuzzy Downer like this.
  14. Fuzzy Downer

    Fuzzy Downer Registered

    Joined:
    Mar 30, 2017
    Messages:
    7
    Likes Received:
    0
    Perfect! Thanks so much. At first, the trees came into gJED rotated 90 degrees. Flipping the normals (option 1 above) set them right. Also, selecting all 32 tree objects in Maya, then using F8 and F9 to switch between vertex mode to object mode saved a lot of time.

    The trees are a little shimmery. No negative bias. But I think I need to adjust the mip map levels in gJED. Maybe set up proper alpha key values.
     
  15. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    This is what i've set:

    Trees.jpg

    Some gJED bugs:

    ==> When you apply a new shader in your scene. It might not show up correctly.
    Workaround:
    - Apply the textures and the MIP-Mapping like in the screen shot. Save the .gmenv file and reopen the scene.

    ==> Texture filtering with FBX to gJED doesn't work.
    Workaround:
    - Is to force Anisotropic 16x via GPU control panel.

    gJED is still in alpha WIP.
     
    Fuzzy Downer likes this.

Share This Page