rF2 Track Design - Changes to Real Road Shader

Discussion in 'Wiki' started by Luc Van Camp, Jul 3, 2013.

  1. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
    The "Road Shader Two Diffuse Maps" shader has a few drawbacks in terms of looks and flexibility. The new “Real Road Shader” builds upon that base, with a few modifications and enhancements:


    • The Normal map stage now has its own set of mapping coordinates. This allows it to be linked to either the diffuse or the detail map channel (typically channels 1 and 2).
    • The RaceGroove stage works a bit differently now: both the RGB and Alpha portions no longer mask (i.e. hide) the underlying road detail maps (the tarmac grain and its spec map), in order to keep the overall texture resolution of the road as a texture entity as high as possible. The RGB part is used in a multiplicative blend onto the two diffuse maps (T1 and T2); the alpha channel still contains the spec map and is ADDED to the existing detail spec maps. Please note that total specularity is clamped, so having a very white spec map means there is little headroom for the groove spec to show up.
    • In the past, the wet mask was stored in the T1 diffuse alpha (used inverted), which was also used as the spec mask. This was a considerable flexibility handicap and either the reflections or the spec had to be sacrificed to some extent. Repetitive tiling patterns and potential seams only added to the diffuse alpha nightmare; not to mention the seams where two or more road sections meet. Some of that has been changed. Actually, the spec masked is still stored in the diffuse alpha, as should some of the wet mask (still inverted). The contents of this alpha channel though should now be limited to unique features of the diffuse RGB: cracks in the road, patches, tar stripes, ... In other words, it contains high frequency elements that are usually also visible in the RGB.

      The low frequency elements (something that looked like a subtle cloud pattern in the past that should have resembled some puddles) are now stored in the spec MAP alpha, which subsequently means it is locked to the detail map channel. This change has been made because the detail maps are typically applied uniformly and seamlessly across all road surfaces. The mapping of this cloud/puddle map inside the spec MAP alpha is currently hard-wired to a factor 20 of its base mapping channel, stretching it over an area of 20 times the asphalt grain stored in the textures' RGB channels. Typically, this would cover an area of about 1600m² or so.

      So the wet mask has now been effectively split into two components: cracks (diffuse alpha) and puddles (spec alpha). The advantage is that there will no longer be any puddle seams between various road mappings and/or materials, and that the repetition in the wet is broken by the two maps (and also in the dry to some extent by the lack of the low frequency clouds in diffuse alpha).
    • Fresnel Reflect should still be set up for dry conditions. The underlying Real Road technology will saturate those values as the road becomes wet. For this reason, materials that require wet reflections should have a _WET suffix in their name.
     
  2. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,010
    Likes Received:
    1,071
    Would love a section of tarmac with these updated notes as an example in the wiki.
     
  3. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Hi Luc,

    The original TrackTech PDF shows the 7 stages and which of the 3 UV maps are assigned to each of them. Above you say that the normal map stage now has it's own co-ordinates. Is this UV Map Channel 4?

    Your recent tracks seem to use the tarmac detail texture for the normal map but I want to experiment with using the main diffuse texture for the normal map, but don't know how to assign it.

    Many thanks,

    Adam
     
  4. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
    It uses the channel you want it to use. If that's Ch4, by all means, go for it. If not, you can assign it to either Ch1 (typically used for the main diffuse map), Ch2 (typically used for detail map) or Ch3 (racegroove) instead. I believe that answers your question ;) .
     
  5. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Thanks Luc. I shall have a play with it later. I was just a bit confused because previously the normal map was tied to the diffuse map. Many thanks!
     
  6. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I use Maya and GJED.
    Maya uses UVsets, which i can name myself. But it seems to work the same. :) In my case, ch1 = map1, ch2 = map2, etc....
    With this real road shader map1 (main diffuse), map2 (ashalt grain) seems to work in GJED, But i can't see or check map3 (race groove) in GJED.

    If i can choose the normal map to be at ch1, ch2, ch3 or ch4, How does GJED know what channel i use in Maya?
    The normal map is al over the place in GJED at the moment... i think it's at ch1 at the moment ??? (not sure) , but it needs to be at ch2... or ch4 which is a copy of ch2.

    How can i preview/check the "race groove and marbles" in GJED? (ch3)

    BTW: When i assign the marble (T6) texture GJED crashes. I needed to map T7 first before T6...
     
  7. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Hi Gijs,

    Mine crashes at T7 no matter what I do - so I guess it's a known bug!

    To preview race groove and marbles I just load those textures first to see they're correctly applied.

    As for the UV trouble - I'm having the same issue using blender. It always uses the channel 1 UV for the normal map. And I'm getting a very shimmery road in moddev - maybe because the co-ordinates aren't working properly?

    It would be amazing if you could assign which UV channel a texture used in gJED.


    Sent from my Hudl 2 using Tapatalk
     
  8. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Thanx for the tip. But it didn't work. :eek: Track remains gray like T1.

    I can see the racegroove if i place the texture at T1. But it uses ch1. So i can't check if ch3 is working like it should.

    Track in Maya
    View attachment 18925

    Track in GJED
    View attachment 18924
     
  9. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Try assigning the race groove texture first, then go back to the main shader list and click the refresh button next to the race groove texture. That might work!

    You're gJED screenshot looks very similar to mine!



    Sent from my Hudl 2 using Tapatalk
     
  10. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    does your road material have _wet at the end?
    and does your defuse road texture have an alpha layer?

    What does it look like in Dev Mod?

    does the road mesh have a name with racesurface_ at the front?
    and does the Instance entry for each track mesh in the .SCN have Deformable=True?
     
  11. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    - Mesh name: Racesurface_track
    - Material name: ROAD_main_WET

    I'm aware of the naming en TDF material names. I did some homework. :)

    I don't have the .scn file yet. :) Just the .FBX and the .gmenv. The instance settings, etc are stored in the .gmenv file.

    My only concern in Maya is the texture mapping, material names and object names. Setting up the shader will be done in GJED.
    I've multiplied the 3 textures (UV channels) ontop of each other to see each texture mapping in Maya. So the total mixed result is darker in Maya then it will be in GJED.
    Everything looks OK in GJED until i apply the normal map. I didn't mapped it to ch4 yet. Something to test tomorrow.

    Anyway GJED is in an early stage and so is my project. :)
     
  12. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    You already know the materials and object naming you just need texture mapping. I use 3dsmax so I can't help with maya but I use the same channels as the track modding PDF Difuse,Bump chnl 1 mult, spec and first marbles chnl 2 racegroove and last marbles chnl 3

    chnl 3 needs to be spline mapped to the AIW fast line for best results

    are you using ISI road textures? or are using different (your own) bump texture?

    If your using your own try ISI.

    or try using a flat bump and increase from there.

    Sorry it's probably not the info you want
     
  13. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    The PDF is talking about the old real road shader.
    Yes, i'm using ISI textures (Quebec karting track) multi, normal, spec map are using the same UV channel.

    This can't be done with GJED at the moment. I'm forced to use the channel GJED uses.

    With other shaders: It's gambling what channels GJED uses.
    Maybe in 3Dmax with the gmotor shaders, if you apply a shader, you'll see what UV channels is used for what texture. But there is no info about that in GJED and it's impossible to get a 3D max version that is compatible with the gmotor plugin and shaders.

    As far as i know there are 3 shaders that uses multiple mapping channels. The old and new real road shader and the multi layer/dirt shader.
     
  14. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    My DevMode / gJED keeps attaching the bump (normal) map to Channel 1 (main diffuse) whatever I do. I'm getting crazy here, and 3dsMax is a piece of **** regarding UV channels, the stupid software is screwing some GMTs geometry if I collapse a UVW modifier. This is really irritating!
     
  15. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
  16. Satangoss

    Satangoss Registered

    Joined:
    Jun 2, 2011
    Messages:
    1,123
    Likes Received:
    7
    Thanks again Luc, I'm looking at. I realize my 3dsMax are gathering a lot of useless channels from nowhere and attaching to the objects (channels info shows that). Let's see what happens now, I'm reading the info.
     

Share This Page