Blender to gJED to rF2?

Discussion in 'Track Modding' started by Nyowa225, Oct 18, 2015.

  1. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Hi everyone,

    Maybe I haven't been looking in the right places or maybe I'm just an idiot, but I've spent almost the whole day today trying to get a track to work in rF2 and nothing I've done has worked.

    Most of the tutorials I've looked at for getting a mod track in-game seem either out of date, reliant on the modder using 3dsmax or reliant on the modder already knowing a ton of stuff I've never seen put all into one location.

    I'm already familiar with blender, and if I'm understanding the purpose of gJED correctly, I should be able to use it, or any other 3D editor, to make a track (including texture mapping and making materials), export it as an .fbx, open that in gJED and from there set my textures and shaders, then export into an .scn and .gmt files to be able to run it in dev mode. Right?

    I followed the "bare minimum to get track into rf2" sticky and set up all the files and file structure for the track. Then I made a really simple track in blender, just an oval with some grass on either side of the road, to test getting something working in game. I've gathered (please let me know if what I'm about to say is wrong) that a track needs to have 5 planes named xpitin, xpitout, xfinish, xsector1 and xsector2 to specify where those points on the track are. I've also read in a few places to name the road itself RaceSurface_01 and have done so, but I'm not sure if that's necessary if I'm not trying to use realroad. I've assigned each object a material, with all the x[name] objects having the material called SECTORMAT. I've tried a few variations on the material names for the road and grass, including copying what i saw Joesville had when I opened it in blender, but nothing seems to make a difference. I've tried playing with the .scn, since I'm pretty sure I need to re-add the 'instance' lines for the racesurface and grass pieces to that for it to work but that hasn't worked either. Whenever I load the track in dev mode the loading bar completes, but then the game crashes and I'm thrown back onto my desktop with no error listings or hint as to what went wrong.

    I've uploaded the fbx of the oval test track I made here in case someone wants to look at it. If someone's willing to help and needs anything else uploaded just let me know.

    I hate to ask to be spoonfed all this information but unless I've missed it there really isn't a good guide on making tracks from scratch in rF2/how to use gJED, etc.
    My only modding experience has been with Assetto Corsa, which seems to either have a much easier system for track modding or at least more accessible documentation for someone just starting out. I have a full track almost done I'd like to bring into the game, but as you can see I'm lost here. If/when I figure all this out I'd be happy to make a detailed tutorial myself of all the information needed to do this to make it easier for others, but I have to know what I'm doing first.

    Thanks
     
  2. Nuno Lourenço

    Nuno Lourenço Registered

    Joined:
    Oct 19, 2010
    Messages:
    593
    Likes Received:
    65
    In your case I woud try to make only 6 objects...

    - Road_01 - Plane with 50mx50m centered in (0,0,0) because car without AIW will appear in that coordenate, with simple T1 difuse shader.
    - xpitin - (coordenates are irrelevant) with simple T1 difuse shader
    - xpitout - (coordenates are irrelevant) with simple T1 difuse shader
    - xsector1 - (coordenates are irrelevant) with simple T1 difuse shader
    - xsector2 - (coordenates are irrelevant) with simple T1 difuse shader
    - xfinish - (coordenates are irrelevant) with simple T1 difuse shader

    Add with a .scn file something like this,

    GDB file,


    Don't forget that you need at least "test.TDF" file in track main folder.

    Copy the track icons from joesville and rename it to your track

    With this steps I think that you should be able to get it working. After that its all the same... Add objects, shaders, etc...

    Hope I didn't miss nothing
     
  3. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    That worked, thank you! A very basic version of my test track loaded. I used the same basic oval with grass on either side I used before, but went through and compared the .scn and .gdb to the files I had before and there were a few differences, so I guess the steps I followed previously were wrong.

    I'm still confused on two more points that are stopping me from getting any farther though- I can't seem to get anything to texture correctly, everything is just flat colors. Everything is uv mapped ok in blender, but shows up in gJED like it's been tiled a million times or is just the average color of the image I used. You can see what I mean in this picture linked here. I looked at Joesville in blender and didn't notice anything out of the ordinary about its uv mapping. I think in 3dsmax you have to apply uvs or something before you export? I'm not sure if there's something similar in blender I have to do. Besides that, I can't seem to get the reflection mappers to load into editor. From what I can tell, again from looking at Joesville, I only need to add some lines to the .scn file? I don't see it referenced anywhere else, but I'm guessing that's not all though since they won't load in gJED.

    Thanks again though Nuno, it's great just to get anything working in game.

    EDIT: I should add I'm aware that rF2 uses multiple UVs for some shaders, but the T1 only uses one, so it should map the road surface as it shows up in blender, right?
     
    Last edited by a moderator: Oct 21, 2015
  4. Nuno Lourenço

    Nuno Lourenço Registered

    Joined:
    Oct 19, 2010
    Messages:
    593
    Likes Received:
    65
    Well I'm not familiarized with gJED... I Still do everything in 3ds max but, and someone will correct me if I'm wrong, you must apply all map channels on diferent stages and when gJED open mesh will see that (I don't see an option in gJED to selection the channel so must be automatic).

    For example,

    Real road Shader

    Do this in blender,

    Stage 1 - Road main texture (UVW Channel 1)
    Stage 2 - Road Detail multiplied on stage1 (UVW Channel 2)
    Stage 3 - Road Detail normal map (UVW Channel 2)
    Stage 4 - Racegroove (UVW Channel 3)
    Stage 5 - Road Detail specular map (UVW Channel 2)
    Stage 6 - Road marbles (UVW Channel 2)
    Stage 7 - Any texture with live reflection mapper turned on (UVW Channel 1)

    Then gJED will know that for each texture/stage you are using it corresponds a channel previously added in blender...


    Like I said its just a theory that someone familiarized with FBX/gJED can confirm or not.
     
  5. Jka

    Jka Member Staff Member

    Joined:
    Jan 31, 2011
    Messages:
    954
    Likes Received:
    213
    That is correct.

    You need to do all modelling and mapping in 3D application before exporting your model to FBX format (and import FBX into gJED in the end).

    After importing your track to gJED, you can adjust all material settings on-the-fly in gJED UI.
     
  6. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Thanks Nuno, I'll try that soon and see if that yields better results. At the moment I'm only using one UVW channel, which from looking at Joesville should be all the T1 shader needs to work. The section of outer wall at Joesville that actually says 'Joesville' just uses the T1 shader and one texture, which is what I've been trying to use on my test track for the time being before delving into more advanced texturing. I'm fine with this test oval being ugly as longs as it's functional, since I only plan on using it as a testing ground for future learning. I have a nearly fully made version of Road America almost ready to get in game, but I want to learn the basics before I go and try to make it look pretty in-game. Even if I don't use it right away it's still good to know though, so thanks.

    And Jka, I'm not sure which post you're replying to when you say "that is correct," but I do understand that I can't do any modelling or mapping in gJED. I have done all that in blender already. In case you didn't see the image I posted before (the color for links here is easy to miss, at least on my screen) here it is again: View attachment 18339

    As you can see in blender I've already modeled and mapped everything that I'm trying to export into the game with gJED. I export the fbx and import it into gJED, but it seems like something goes wrong there. I can adjust material settings in gJED, but no matter what I do the textures I select never actually show up correctly, I just get a single solid color for each material as you can see in the picture. To me it almost looks like the UVs are just scaled extremely incorrectly, I can get the same effect in blender if I scale the UV's to be way too small. I'm not sure if this is caused by blender exporting the uv's to the fbx in a way gJED does expect, or if there's some other setting in either blender or gJED I have to change but something is definitely not right. What makes it even weirder is if I open my .fbx in 3dsimed, everything shows up correctly, which makes me think there's a gJED setting I haven't found yet that I have to change.


    ------
    And in case anybody else new to rf2 modding is following this thread and is as lost as I am with all this, I should say I did some testing recently and would like to expand upon Nuno's first post in this thread. When you make the road and grass meshes in blender, or presumably any other 3d modeling software, you have to name the material to something starting with road or grass respectively. It doesn't seem to matter what you name the mesh as long as the material is called road_something or grass_something. In comparison I'm pretty sure the xpitin...xsector2 type objects both have to be named that way and have the material SECTORMAT.
     
  7. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Of course I got it to work less than a half hour after I asked about it, but I got it to work: link

    All I did was duplicate the UVs I had already created, and export the fbx with both of them, and lo and behold they show up in gJED correctly mapped. They still look ugly and out of scale, but thats because I scaled everything differently on purpose to see if there was a problem in the exporter that was altering the scale I had set. The problem now is I don't understand why what I did works. I didn't remap anything, just copied the existing UVs so there are two of them for each object.

    I'm happy I got it to work, but if someone could explain why it would be appreciated.
     
  8. R Soul

    R Soul Registered

    Joined:
    Oct 6, 2010
    Messages:
    125
    Likes Received:
    41
  9. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Well I tried posting this a few days ago and it said 'awaiting moderator approval' but it never showed up here, so here it is again.

    I got basic T1 texturing to work, I just had to create a second UV map in blender. I'm not sure why that works, since it's just a duplication of the original one but I guess I'll just accept it for now. Now I just have to start figuring out realroad...

    And R Soul, I did see that, I just don't think it's necessary now that we have, gJED, right? I'm trying to figure out how to do all this using a minimum of third-party addons as possible, since updates tend to break that kind of stuff in my experience. I'll take another look at it though, thanks.
     
  10. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Wow, I can't believe it's been this long since I last posted here, but real life has calmed down a little and I'm finally back to working on my track.

    I had to reinstall Windows since I last posted and now my old track files seem to not be working correctly. For whatever reason when I go to open my track in gJED all the top layers of vertex painted textures (what is supposed to show up where you paint red or green for multilayer grass/dirt) are transparent. I tried painting it over in blender multiple ways to see if maybe blender changed somehow, but no matter what I do I get a result like what you see in the picture. The picture is a screenshot from 3dsimed, but the result is the same in gJED.
    View attachment 20289

    Any ideas? I've tried going back to an old version of blender and that didn't fix it either.
     
  11. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Check the alpha values of the vertex. looks like the left side has less than 100% alpha value
     
  12. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Thanks for the quick reply, but as far as I can tell from looking around in blender (the alpha being less than 100 was the first thing I thought of too) and from googling it, it doesn't look like blender even has an option to edit vertex alpha values- it's always at 100%. Even using an old version of blender like I would have been when I got this to work back in October didn't fix it, which is making me wonder if there was an update to rfactor that changed something? I imagine others would also have had this issue if that was the case though.
     
  13. Euskotracks

    Euskotracks Registered

    Joined:
    Nov 29, 2013
    Messages:
    1,092
    Likes Received:
    191
    Is any of the textures involved incorrectly scaled in the UV mapping? I've had that "dirty window" effect in some cases due to that.

    Enviado desde mi ONE A2001 mediante Tapatalk
     
  14. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    No, everything should be fine there. I'm using the same .blend file as I was when everything worked. I tried making a new test one too and that had the same issue.

    I'm downloading 3dsmax now and it should be ready by the time I get home, I'll see if exporting it from that makes any difference but I'd *really* prefer sticking with blender since my student license on 3ds runs out in about a year and I'm already familiar with blender.

    Sent from my XT1575 using Tapatalk
     
  15. Euskotracks

    Euskotracks Registered

    Joined:
    Nov 29, 2013
    Messages:
    1,092
    Likes Received:
    191
    Have you tried applying a simpler shader simply to see how it responds. I would start with T1. Backup before just in case...

    Enviado desde mi ONE A2001 mediante Tapatalk
     
  16. Nyowa225

    Nyowa225 Registered

    Joined:
    Oct 4, 2015
    Messages:
    10
    Likes Received:
    0
    Yes, it works fine with T1 and some other shaders, with T1 of course it's tinted the color that the vertex paint is but it shows up fine.
     

Share This Page