test track: blender to gjed to rF2

Discussion in 'Track Modding' started by adamfarmer, May 22, 2016.

  1. adamfarmer

    adamfarmer Registered

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

    When gJED was released I jumped back into my track project since it now seemed possible to use a blender to gjed to rF2 workflow.

    I had a lot of trouble with the road - and took a break. Recently I've come back to the modelling and texturing side and it's going really well and reached the point of trying to get it in game.

    It's not going well. Thanks to Gijs van Elderen's earlier thread I think I've finally got the UV channels working correctly for real road. By naming the UV maps 1,2,3 and 4. It doesn't seem to matter how I assign the textures in Blender but I believe gjed organises them based on these numbers.

    I know I've asked before but a a little drop down to select the UV Map next to the texture in gjed would be a fantastic feature and make things so much easier and reliable. I could then make my 4 UV maps in blender, import into gjed and then assign the map to the texture - this would remove so much doubt.

    I took the Toban track textures and all the gjed settings for the realroad, mapped everything identically on a test track and applied it all in gjed. My results are strange, and in ModDev it looks terrible, and shimmers badly.

    I've attached 4 screenshots. 1)gjed when i load my fbx with all 'toban' settings applied. 2)gjed with the camera higher. 3)gjed with the camera higher again. 4)on track in ModDev.

    I'd really appreciate any help in trying to get this working. I've spent all weekend and got nowhere and I'm desperate to complete my track. Has anyone with Blender managed this initial step?

    All advice/help/ideas would be very welcome.

    Thanks,

    Adam

    View attachment 20033
    View attachment 20036
    View attachment 20035
    View attachment 20034
     
  2. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    I believe gJED looks for 0,1,2 and 3 UV channels from FBX.

    When looking at your screenshots, it looks like mapping channels are mixed up.

    I'm not familiar at all with Blender (I work with 3ds max), so I can't help you with that.
     
  3. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    ...
     
    Last edited by a moderator: May 23, 2016
  4. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Thanks JKA,

    I altered the 6 textures that make up the realroad shader by writing their name on them in huge letters - stretched to the edges of the texture, so I could clearly identify each texture in gJED. Except marbles and racegroove which can't be seen in gJED.

    By using 0, 1, 2 and 3 UV channels - the trackmain and asphalt textures all used UV map 1 in gJED - so the trackmain was repeated across the track - 0 seemed to be ignored. By using 1, 2, 3, 4 - trackmain was correct, asphalt spec and mult were correct - and the asphalt normal map looked correct. But then when I dropped the proper textures back in - you see the results above. I also tried naming the UV channels 'CH 1' and 'CH1', as well as just '1'.

    It doesn't seem to make any difference if I make a shader in Blender or not, and assign UVs to the textures. I've tried both ways but in gJed I need to pick the RealRoad shader and load in the textures. All it seems to want from blender is that some UV maps have been set up, and that the mesh and material names are correct.

    Please keep any suggestions and ideas coming.

    Thanks.
     
  5. Luc Van Camp

    Luc Van Camp Track Team Staff Member

    Joined:
    Oct 4, 2010
    Messages:
    1,030
    Likes Received:
    15
  6. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    If i look at your 2nd sceen shot position value at the bottom. You are viewing the scene at 150 meters.
    in the 3rd screen shot your viewing the scene at 788 meters.

    So i suspect your track is 100 times to big.

    If you are working in cm in blender: 1 cm = 1 unit = 1 meter in rF2
    So if your track 600cm wide in blender, it will be 600 meters in rF2.


    Whatever unit (meters, inches, cm) you set in Blender, Max, Maya. 1 unit is 1 meter in rF2.
    In my case Maya works best in cm. But i need to think in meters.

    You can scale units with the FBX export too. From cm ==> meters


    It's best to set Blender in meters and export FBX in meters.
     
  7. adamfarmer

    adamfarmer Registered

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

    Thanks for the link. That was pretty much my understanding, although I didn't know Stages 5,6,7 used those particular UV sets. It doesn't change much - but it's good to know!

    I just tried again and 0,1,2,3 definitely doesn't work, and despite Gijs' comments, the order the UVs were created doesn't make a difference. It seems they must be called 1,2,3,4 else the main Albedo texture it tiled the same as the Detail texture. The key thing I learned this weekend is that the normal map used UV set 3.

    Gijs,

    Thanks for the reply, and for all your previous excellent work and experiments. You're right! The scale is wrong! I just tested and the FBX exporter 6.1 ASCII exports at the correct scale, whereas 7.4 binary multiplies the scale by 100. Even though in both cases Blender is set to metres and the exported scale is set to 1. I've been using 7.4 this weekend since it's the default so I can just set the scale to 0.01 when exporting, or use 6.1.

    So, a texture stretched by 100 is going to look terrible in game! When I last tried a couple of months ago I did have the scale correct because I drove the track often in ModDev. But the road looked awful - possibly because of how UV set 3 was being used. Hopefully, thanks to your help, it will finally look perfect when I test this evening, and with no shimmering!

    I've attached a gJED screenshot showing the realroad texture, at the correct scale....

    View attachment 20037
     
  8. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Update!

    Thank you all. It looks like I've finally managed the first step. Using 1,2,3,4 UV sets and exporting using FBX 6.1 ASCII gave me a good looking road in gJED.

    In ModDev it looked nice until I started moving and it turned into a shimmering mess. So back to gJED, and I copied the Toban settings - notably Ref Blend % which defaults really high, un-checking Use Z Buffer (which sometimes re-checks itself) and Blend Pixels from 1 to 3. I'd like to set the MIP Bias to 0 but after saving it always reverts back to -1.

    On my first attempt the track looked really sharp and clear - but shimmered when moving. After making the changes it doesn't shimmer and looks pretty good - although I find the road looks a bit too 'smudged'. What setting would have made this difference? Ref Blend % or Blend Pixels?

    Regardless, thank you to all of you for your help. I have a feeling I'll be posting here again....
     
  9. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Here's a brief summary on the Blender side of things, to get a RealRoad road into gJED. I can't verify the RaceGroove yet, but since the rest is ok I'm hopeful it should work in game. I'm assuming you know your way around Blender for the basics.

    1. In Blender delete everything, choose the Cycles render engine and change the units to metres. Create a new plane, and make it 20x10m. Ctrl+A - click Rotation and Scale.
    View attachment 20046

    2. Split the screen and open the UV editor, load the main albedo/diffuse road texture (I've used the one from Toban). Select the plane, go to Top Ortho view, go into edit mode and press U to unwrap - choose Project from view (bounds). In the UV tab to the right rename the Map to '1'.
    View attachment 20045

    3. Click the '+' next to the '1' to create a new UV map and rename it '2'. Load the asphalt detail map into the uv editor, then with the mouse pointer over the plane press U again. Choose Unwrap. It's squeezed a 2x1 rectangle into a square so press S X 2. This will scale the UV by 2 in the X direction so the proportions are correct. Now, for example, press S 4. This scales the map by 4 in both directions - so the detail map will be quite dense over the road plane. I haven't decided what scale looks best yet but around 4 or 5 looks right.
    View attachment 20044

    4. Click the '+' in the UV tab to create a new map, rename it '3'. It will have copied Map 2 and since the normal map matches the detail map - you don't need to do anything else. Click '+' again and rename it '4'.
    View attachment 20043

    5. Load the RaceGroove texture and in this example repeat step (2) above.
    View attachment 20042

    6. Open the materials tab and create a new material and call it road_main_wet. Rename the plane as racesurface_01. Open the node editor and add an image texture node and a UVMap node, copy it 3 times. Enter 1,2,3,4 in each of the UV nodes and in the texture nodes enter the corresonding textures - main, detail, normal, racegroove. I haven't added more because my understanding is the marbles and detail_spec will use UV2. I don't think this Step 6 is required but it seems like the organised thing to do.
    View attachment 20047

    7. Save and then click to Export FBX. Choose FBX 6.1 ASCII - select Mesh - un-tick Animations - and save.

    8. For now I'll leave it at that as the gJED guides cover the rest and you'll need to have your track folder system in place. But hopefully if you've been stuck like me this guide will help with this initial stage.

    Thanks.
     
  10. Christopher Elliott

    Christopher Elliott Registered

    Joined:
    Jul 31, 2014
    Messages:
    4,551
    Likes Received:
    7,538
    This is great, thanks for sharing! :)
     
  11. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    No problem Christopher. I'm sure I'll meet more problems which I'll post here, and hopefully solutions too.
     
  12. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    If you use the same settings as an isi track: Everything should be OK.

    However, gJED will force texture filtering to "trilinear". And ignores the ingame texture filtering. This makes everything a bit smudged/blurry.
    Overriding AF with x8 or x16 with nvidia is a temporary solution to check if everything is OK.

    http://isiforums.net/f/showthread.p...ophic-question?p=413812&viewfull=1#post413812
     
  13. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
  14. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Blender import scripts work great... Much beter result then 3dsimed. :)
    It's great to import some track side objects like tents, bins, parked cars and trucks, tirewalls, ... Etc (Don't forget the credits to the ISI track team)

    Export scripts however are a bit buggy and create some .gmt's that makes rF2 crash. :( Export to FBX and use gJED is a more reliable solution.

    BTW:
    - If you merge the ISI gmt's of the track side objects into your track in gJED first, you can save the .gmenv file. (With the new materials and textures assignments and its settings)
    - Then import those gmt's into blender, place the objects where you like them to be. (Keep the material name the same!!!)
    - Export to fbx, and open the fbx with gJED. And ... Done! Material setup are exactly the same. :cool:

    You can give object itself a different name.

    It's the same thing if you are using an already existing material. Simply open the fbx in gJED and export the .gmt's and done...
    In the beginning there are a lot of materials to setup. But after a while you can reuse existing materials.

    This means if i would create a new track: i can reuse the materials from the previous track. Save the FBX with the same name and open the FBX with the same .gmenv file... Add new search folders for the new track, copy the texture folder. All materials, textures are there, setup and done. :cool:

    Once you have a nice material library in blender, max or maya and in gJED. You can reuse it and expand the material library with the next track... And next... and next....
     
    Last edited by a moderator: May 24, 2016
  15. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    R Soul: I'd not looked at it before because I like to try and work things through myself so I know exactly what's happening (in this case between Blender, gJED and rF2), but I just read the PDF and I can see some good uses for it thanks, particularly copying material settings from GMT objects....

    Gijs: They are the uses I was thinking of thanks - and you've taken it a step further than I was thinking. Some really good ideas and tricks there. Really glad I started this thread. Thanks!
     
  16. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    Just had a quick play with the import script and I can see they'll be really really useful thanks.
     
  17. adamfarmer

    adamfarmer Registered

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

    I've been working with this idea today - importing gmt's to blender - joining my track pieces to them - deleting the original and applying my mapping. So in blender i'm left with roads/kerbs/lining all with materials set up exactly as the toban gmts.

    However - secondly - the gmt exporter doesn't seem to work. Which isn't too bad because I want to export as fbx.
    However - firstly(!) - the scripts only work in blender render mode - and when you export a fbx from blender render the first texture name is appended to the material name in the export. So instead of a material called ROAD_TRACKMAINOLD_WET. I get a material assigned in gJED called ROAD_TRACKMAINOLD_WET_TRACK_MAINOLD_DSS.

    And this therefore doesn't work! Argh! Have you found a way around this? Your post contained some fantastic ideas but I'm not sure how to proceed if the material name is wrong.

    Many thanks,

    Adam
     
  18. adamfarmer

    adamfarmer Registered

    Joined:
    Aug 29, 2011
    Messages:
    198
    Likes Received:
    102
    OK.... I think I've sorted it. Use the FBX 7.1 exporter and set the scale to 0.01.

    It exports the material name correctly - although now my albedo racesurface texture is mapped incorrectly again!

    Getting there....


    Update: renaming the UV maps to 1,2,3,4,5,6,7 etc seems to fix it. I'm cautiously happy right now.
     

Share This Page