Multi layer Grass /Dirt with Sat.Map

Discussion in 'Track Modding' started by Goibaka, Apr 8, 2017.

  1. Goibaka

    Goibaka Registered

    Joined:
    Sep 29, 2016
    Messages:
    44
    Likes Received:
    231
    Helllo:

    I have been checking that rF2 shader from 3dsmax 2012 to gMotor 2.5 viewer and making a summary:

    [​IMG]

    Well, observations within Viewer 2.5:

    - T1, T2 and T3 work on same UV channel 1. Within 3ds max Stage1 and Stage 2 must be set to "Map channel 1" but the Stage 3 must be set as "Map channel 2" to show T4.RGB (satelite map) properly, why???? Should not be Stage 3 "Map channel 1"?
    - T4.RGB (Stage 4 Satelite map) is seen on UV channel 2 but it must be set as Stage 3 "Map channel 2" in 3ds max and not in Stage 4. I think it is a 3dsmax bug because Stage 4 (T4.RGB) is taking the Map channel of Stage 3 (UV channel 2).
    - T4.A (Alternate noise map) is using UV channel 3 such as 3ds max Stage 4 Map channel 3

    Is that a bug or I haven't understanding nothing?

    Thanks.
     
  2. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    1,237
    Likes Received:
    493
    Did you ever figure this out? I sent a message to tuttle about it, but I think he's a bit busy with DX11 at the moment.
     
  3. Tuttle

    Tuttle Technical Art Director - Env Lead Staff Member

    Joined:
    Feb 14, 2012
    Messages:
    2,349
    Likes Received:
    520
    Sorry guys I'm busy these days. I will try to write a little tutorial for u, one of these days (probably after 1 May), to work with that shader.
     
    WiZPER, Woodee, TwoHardCore and 3 others like this.
  4. ECAR_Tracks

    ECAR_Tracks Registered

    Joined:
    May 1, 2016
    Messages:
    340
    Likes Received:
    256
    What's the advantage of this shader on the regular multi layer one? This last can be adjusted with different UV channels for the 3 main grass layers by the way.
     
  5. Gijs van Elderen

    Gijs van Elderen Member

    Joined:
    May 1, 2014
    Messages:
    1,387
    Likes Received:
    437
    The advantage is (i think): it's a more light weight/more render friendly version of the regular Multi/dirt/grass shader.

    I've used it at Karting Genk. ;)
     
  6. adamfarmer

    adamfarmer Member

    Joined:
    Aug 29, 2011
    Messages:
    195
    Likes Received:
    96
    I deleted my earlier thread bump because I think I've figured it out - from a Blender perspective - and so I should I explain....

    I've set up 6 UV channels, named 1-6. It seems that 3 and 4 get swapped on importing from an FBX to gJED, so contrary to what seems right I have (for example):

    1: UV for Grass
    2: UV for Weeds
    3: UV for Satellite Map
    4: UV for Soil
    5: UV for Grass Normal
    6: UV for Soil Normal

    However, in gJED, swap the texture slots for Soil and Sat Map. Then it works! :eek: So Grass, Weeds, Soil, Sat Map, Grass Norm, Soil Norm.

    Painting all the Verticies Black or Blue seems to give similar results for grass, then set the mix to add, then paint green for weeds and red for soil.

    For NOLA the Satellite Map has some interesting treatment - it would be interesting to know what's happening there!
     
  7. Gijs van Elderen

    Gijs van Elderen Member

    Joined:
    May 1, 2014
    Messages:
    1,387
    Likes Received:
    437
    Luc Vancamp told me: DX shaders make use of Maximum 4 UV sets/channels.
    This shader makes use of 3 UV set/channels like it is in the OP with the corrections.

    This is in the shader file itself: It can be useful sometimes to take peek.;)

    ShaderName=L2MultiSatGrass
    ShaderDesc="Multi layer grass / dirt with Sat Map"

    - Diff_1/Spec_1 (UV1);
    - Diff_2/Spec_2 (UV1+vc.g)
    - Diff_3/Spec_3 (UV2+vc.r)
    - Multi+Mow (UV3+vc.b)
    - Normal/Mix (UV1/2)
    - Normal/Mix (UV2/1)
    - Radiosity vc.a


    The Layers in the Red square are the ones you want to visualize in Blender. The normal-maps follow the other 2. So they are not mandatory in Blender. But they contain the mix maps.
    Multi layer grass dirt with Sat map.jpg

    Vertex colors In my case:
    - Weeds are vertex Black
    - Natural is vertex Green
    - Soil is vertex Red
    - Blending the sat nav with another multi map is done with Blue: but i didn't use it.

    For start: I flood the whole terrain with RGB Black and alpha white.

    You can use vertex alpha (blak/white) to paint some shadings: like on the edge of the tirestack. You can also do this with an AO or radiosity bake. But in my case painting these shadings manually was done quicker. It takes some trail and error to find the correct bake settings. But once you have good radiosity bake settings you can apply these to other tracks.

    For Blender there is a "Heck" to paint vertex Alpha.
    https://forum.unity3d.com/threads/vertex-rgba-blender-2-5x.254038/

    But inform you on the Blender forum about it: https://blenderartists.org/forum/
     
    ECAR_Tracks and adamfarmer like this.
  8. adamfarmer

    adamfarmer Member

    Joined:
    Aug 29, 2011
    Messages:
    195
    Likes Received:
    96
    Hi Gijs, thanks for the message!

    I should have explained that in my experience the blender to fbx to gjed workflow seems to get in a confusion over UV Maps. So in the case above I did create just 3 UV Maps - grass/soil/sat map - but then by selecting one and clicking the + it creates a duplicate that I can rename. Then using this nice little add-on (https://github.com/ekaj2/uvmap_tools) I can re-order the UV Maps 1-6. If I just have 3 UV Maps it tends not to work - certainly the real road shader gets in a mess. So 1,2 and 5 are the same. 3 and 6 are the same. And 4 is unique to the satellite map.

    So in short, a UV Map per texture generally works, although the above took a little fiddling!

    But, I really appreciate what you wrote out - always interesting to read other people's methods and ideas. And I will try again a more simple approach in case something has changed recently.

    The vertex info is interesting too - and the 'hack' to paint vertex Alpha could be amazing - because I cannot get billboards to turn - I'll try it later today - many many thanks for this!
     
  9. adamfarmer

    adamfarmer Member

    Joined:
    Aug 29, 2011
    Messages:
    195
    Likes Received:
    96
    Slightly off topic but... the vertex alpha addon works - I finally have a rotating billboard!

    Edit: hmmm... 3 hours later and still haven't got it working as it should!
     
    Last edited: Jul 10, 2017
    Gijs van Elderen likes this.
  10. ECAR_Tracks

    ECAR_Tracks Registered

    Joined:
    May 1, 2016
    Messages:
    340
    Likes Received:
    256
    Won't work for me either I set the sat map to 2, 3 or 4 UV channel (using 3dsMax here). Weird.
     
  11. ECAR_Tracks

    ECAR_Tracks Registered

    Joined:
    May 1, 2016
    Messages:
    340
    Likes Received:
    256
    It's amazing how the change from one company to another seems to have zero effect on the complete abandonment of this modding support area.

    It's been almost 1 year and there's no a single decent response from technical staff on this regard.

    No wonder rF2 has a tiny fraction of community mods in contrast to AC.
     
  12. ECAR_Tracks

    ECAR_Tracks Registered

    Joined:
    May 1, 2016
    Messages:
    340
    Likes Received:
    256
    This shader seems to be bugged. You have to set the Sat map as Uv3 but it only works if you map it as UV2. Anyway, can't see any difference from the previous terrain shader, so let it be.
     

Share This Page