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:
    72
    Likes Received:
    377
    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 Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,780
    Likes Received:
    2,242
    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

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    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:
    456
    Likes Received:
    465
    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 Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    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 Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    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 Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    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 Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    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 Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    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:
    456
    Likes Received:
    465
    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:
    456
    Likes Received:
    465
    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:
    456
    Likes Received:
    465
    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.
     
    Nibiru likes this.
  13. Frankalexandre

    Frankalexandre Registered

    Joined:
    Jan 3, 2012
    Messages:
    127
    Likes Received:
    22
    Can anyone point me to a begginer tutorial to use vertex paint for this shader? I've set the materials and mapped as this topic but now i'm stuck since i never used vertex painting before. Thanks.
     
  14. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Frankalexandre likes this.
  15. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    You can also just select the verts you want and in the vertex properties change the colour to whatever you want.
     
    Frankalexandre likes this.
  16. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    You should see how easy it is in AC to make a camera facing crowd. All you need is a plane in almost any shape and then a .ini file that determines the plane name the size range of people to work in and the density.
    The game then creates the crowd for you (you dont use objects) on the plane.
     
    ECAR_Tracks and adamfarmer like this.
  17. Frankalexandre

    Frankalexandre Registered

    Joined:
    Jan 3, 2012
    Messages:
    127
    Likes Received:
    22
    Thanks guys.

    - Multi+Mow (UV3+vc.b)
    What exaclty this mean, i cant see any difference when painting blue.
     
  18. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    The “muti-map” is a layer multiplied on the grass to give an additional effect: like being mowed.
    D71C5C33-91D9-4201-BB5A-EC251E8281E1.png

    You can have 2 multi maps in 1 texture: 1 in the RGB and 1 in the Alpha.

    Usually: a desaturated satellite image is used in the RGB: For far terrain.
    And a mow like multi map in the Alpha channel. For next to the road.


    To blend or switch between these 2 multi maps: you need the blue vertex color. (vc.b = vertex color blue)
     
    Frankalexandre likes this.
  19. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    The “muti-map” is a layer multiplied on the grass to give an additional effect: like being mowed.
    00A19BF5-0603-4287-9EB7-CBD921BEB151.png

    The multi-map is usually a black, white and gray texture. So you can have 2 multi maps in 1 texture: in the RGB and in the Alpha.

    To blend these 2 multi maps: you need the blue vertex color. (vc.b = vertex color blue)
     
    adamfarmer and Frankalexandre like this.
  20. Frankalexandre

    Frankalexandre Registered

    Joined:
    Jan 3, 2012
    Messages:
    127
    Likes Received:
    22
    Thank you very much.
     

Share This Page