Track not always lit by head lights

Discussion in 'Track Modding' started by Gijs van Elderen, Jan 15, 2016.

  1. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    The head lights only lit the track at a certain direction.

    any idea? :)

     
  2. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,999
    Likes Received:
    2,873
    Looks like a "Hardcore" Version of THIS (older) Bug. Do you use the current Build 1036 Shader and Road-Material?
     
  3. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I've read the thread yesterday. :)

    Yes my builds are up-to-date. Object names, material names should be OK, material and instance settings are the same as an ISI track (Quebec).

    In my case it effects the sun too. If the sun is casting on the track from those angels, the track hasn't any specular and looks a bit darker and it doesn't draw any shadows on track. It's like there is only ambient light and no direct sun light, like a big cloud is blocking the sun. (i'll try to make a video of this later ...)

    My work flow: Maya ==> export it to FBX (with FBX game exporter) ==> GJED ==> dev mod.
    In GJED everything seems OK, sun is casting on track from dawn to dusk.

    I needed to swap Y/Z upon GJED import. i thought that's the problem.
    So i swapped it in the FBX export settings. ==> same problem.
    I swapped the Y/Z in the project settings and turned the hole track Z up in maya. ==> same problem.
     
  4. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
     
  5. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I did a "quick" test.

    I've made a square plane with a UV map. ex.ported it as FBX. View attachment 19142

    opened it with GJED and assign a simple bump spec T1 with some textues from Joesville. View attachment 19143
    exported the test.gmt
    I've removed all instances in the Joesville.scn file expept the Xsectors...

    started Devmod: Same problem...



    (car isn't the problem: it happens with the ISI clio and camaro too.)
     
  6. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Shadows in GJED seems to be OK with a test object And Road should look like this when the sun is casting on it.

    So it might be a GJED bug...


    View attachment 19159

    [​IMG]


    But in DEV mode when the .gmt's are created, It's not OK. :(

     
    Last edited by a moderator: Jan 23, 2016
  7. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I think i found the problem. :)

    It's related to the normal map. I've applied a black/white checker pattern...
    I thought it was assigned to UV channel 1 in GJED by default. But the normal map is assigned to UV Channel 3 in GJED. :confused:

    But the ISI tracks i've checked in GJED. The normal map makes use of UV channel 2 for road textures and UV channel 1 for curbs with the real road shader...

    I hope there will be a option to choose the UV channel in GJED in the future...
     
  8. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    OKay Found it !!!


    I needed to rotate the track X= - 90 ... and do the same with the normals...

    So I've to rotate all object the same. :( But atleast I'm getting somwere.


    BTW: Tanks Redapg for the help ...
     
  9. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Z ==> UP !!!

    By default maya is set everything with Y = up.

    The Y/Z swap on GJED does rotate the object but not everything.
    The Z up on FBX export does the same thing...

    A fresh project with Z-up did the trick.
    All default buttons to create a plane, spere, cube are with Y-up. So I've removed them from the shelf-barr and created new ones with Z-UP.


     
  10. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Still is a little problem... ;)
     
  11. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    ..is it..? :confused:

    Last time I loaded the track in gJED, realroad material settings (including channel settings) were imported correctly.

    Are you sure that normal map was assigned to channel 2 in Maya before fbx export..?

    ...personally I use 3ds max, I'm not familiar with Maya and I have no idea what kind of mapping tools Maya has...
     
  12. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I can not assing a realroad shader in MAYA. It's just a mixed texture lambert shader to make the 3 UV channels visible for me. I can swap textures and UV channels in Maya, But it doesn't seem to have an effect in GJED.

    As far as i understand: It doesn't matter what i do in Maya. GJED needs an object with 3 UV Channels for the real road shader, The real road shader will use the UV channel for the texture it needs. The mappings are fixed.

    But if i'm wrong i like to know how to change/manipulate the UV mappings in GJED. :)


    I've assigned Xsector.dds to UV channel 2 in Maya and to the Normal map in GJED:
    Asphalt_multi and Asphalt_spec are at UV channel 2 in Maya and GJED. Asphalt_normal is at channel 3 in GJED

    View attachment 19207

    View attachment 19208

    ==> this will show channel 2 in GJED View attachment 19209
     
    Last edited by a moderator: Jan 28, 2016
  13. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    As you can see, I don't know how materials are setup in Maya. :)

    Generally speaking, all modelling and mapping should be done in external 3d modelling application before exporting scene to fbx. You cannot change any mapping coords or manipulate mesh geometry in gJED. You can manipulate material settings (like spec power, fresnel etc.) in gJED on the fly before exporting the track in game.

    Regarding RealRoad "shader" in 3rd party application (like Maya), it's obvious that there is no way to use gMotor materials on those applications because ISI plugins supports only 3ds max. That is one main reason why gJED was developed in first place. ;)

    Instead you should able to setup some "standard" material (in Maya) which can use 3 different mapping channels and texture slots. After fbx export (and import to gJED), you should able to manipulate this "standard" material to RealRoad and assign correct textures in the slots. Mapping coords of these 3 channels comes from fbx file.

    For troubleshooting purposes:
    - can you try anything else than "mixed texture lambert" material in Maya?
    - load some ISI track to gJED, copy real road settings and setup it exactly same way in your track. Use ISI texture set as well, export and check out if that makes any difference in DevMode.

    If this still has no effect in gJED, then it's probably a bug and devs would like to investigate this further.
     
  14. adamfarmer

    adamfarmer Registered

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

    Using Blender I'm having exactly the same issue as Gijs. I can set up and assign as many UV channels as I want but in gJED they are fixed such that the normal map always uses the old real road set up - uvmap 1.

    So whilst gJED has made it possible to not use 3DS Max (which is amazing) it could really do with the ability to choose which uv map each texture uses.


    Sent from my iPhone using Tapatalk
     
  15. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    You don't have too. :)
    GJED requires a mesh name and a material name and UV Channels: What the material shader is Maya, Blender, Max, .... It doesn't matter. :) The object doesn't have to be textured !!! ;) I do this to make them visible for me.

    Example:

    Just a poly plane with no textures with Mesh name "Racesurface" and material name "ROAD" ==> View attachment 19212

    View attachment 19213
    View attachment 19214
    View attachment 19215

    In GJED you apply textures:


    View attachment 19216 = UV channel 1
    View attachment 19217 = UV channel 2
    View attachment 19218 = UV channel 3
    View attachment 19219 = UV channel 2

    I can work with the normal map being at channel 1 or channel 2, But not with Real Road rubber !!! :D

    I don't know the workflow in Max with the Gmotor plugin. I guess the Gmotor plugin will show what UV channel for what texture. If i look at the image below: the Normal map is user defined in Max. All others are fixed.
    So i guess you can only change the UV channel of the normal map in the Gmotor plugin.

    [​IMG]
     
    Last edited by a moderator: Jan 29, 2016
  16. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    With 3ds max gMotor plugins (which contains gMotor materials and exporter) you can assign mapping channels on certain materials, but not all. Some shaders (like RealRoad) has wired mapping channels.

    In this case, the RealRoad shader determines which mapping channels are used by which textures. gJED has no influence on it. It just reads what comes from FBX.

    RealRoad mapping channels are:

    Ch 0: diffuse map
    Ch 1: mult/spec maps
    Ch 2: normal map
    Ch 3: groove/marble maps

    In FBX file texture mapping channels are referenced by name, with an index in the name. So they are identified as "channel0", "channel1", or something similar, always with a number at the end. gJED uses the number (0, 1, 2, 3) and assign that channel to the vertex mapping channel (0, 1, 2, 3). Again, which channel is used for which map is wired into the realroad shader. It's up the the modelling program to allow you to assign a specific mapping channel to a specific texture. gJED just converts what comes in from the FBX file.

    The Real Road shader expects the normal map tex coords to come from vertex ch 2 (u2, v2). gJED doesn't care which shader is used by a material/mesh, it just takes the tex coords from FBX "channel2" and assigns them to vertex u2,v2. It's up the modeller responsibility to make sure, that "channel2" has the proper mapping.

    Hard part is, that I don't know how this is done in the various 3D applications, or even if it's possible?
     
  17. WiZPER

    WiZPER Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,517
    Likes Received:
    186
    If using the RealRoad Two Diffuse shader, the normal map is fixed to use the T1's
     
  18. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    Yes, that is true.

    Two Diffuse Maps shader is obsolent and it should not be used anymore.
     
  19. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    1,031
    Likes Received:
    317
    Could the use of the Two Diffuse Maps shader cause any problems and should be taken into account while testing tracks for league suitability?
     
  20. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
    It should still work and look alright, but I'll always recommend using the 'Real Road Shader'.
     

Share This Page