Help for first mod

Discussion in 'Car Modding' started by doc-brown, May 13, 2016.

  1. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,779
    Likes Received:
    2,241
    I don't know about blender, but only certain objects need to be named certain things, you can check on the wiki. Steering wheel isn't one of them. Try this, SteeringWheelAxis=(0.0, 0.0, 0.2), I used that and it works for me, but that's with a straight steering wheel and column.
     
  2. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Nulls seem to have the "gmt" name.
    Mesh have the material name and mesh is split by material. Don't know if this is mandatory or the way Traveller made his import script.

    So your swheel Null object will consist of the 3 mesh parts (part1, part2, part3) Don't know if it's mandatory that the mesh have the materiaal name as name and if the mesh is limited to 1 material. In maya i can assign different materials within 1 mesh and it works in gJED.


    I think you're the first one doing a car with blender and gJED. So you'll need to find out. :eek:




    [​IMG]
     
  3. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    I just tried the skippy wheel on my car and it works and rotates correctly around its own axis. For whatever reason my own wheel gmts don't. I did try moving the wheel null in 0,0,0 and then parent the wheel parts under that null but keep their pivots in the center of the steering wheel. Nope

    I certainly hope I'm not the first one making car mod for rf2 with blender. I can imagine why that could be because the amount and quality of tutorials is very poor so it is impossible to make a mod for rf2 from scratch.
     
    Last edited by a moderator: Jul 26, 2016
  4. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    I have more questions! This time some shader issues.

    1. For some reason one set of my wheels has this strange flicker issue. Basically as I drive the car and watch it from trackside camera the shading of the wheels goes from dark to bright. This small pic shows both the bright and dark versions:
    https://imgur.com/a/UZQEc
    As I drive the shading goes smoothly from bright to dark. It almost looks like my reflectiveness map (or the alpha for the wheel skin) was asymmetric but it is perfectly symmetrical. I'm using specular mapT1 shader. My other wheels are basically constructed the exactly same way and don't have this issue. This is how the wheel is listed in the gen file:
    MeshFile=<RRTIRESA> CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(500.00) ShadowCaster=(True, Solid) Reflect=True

    2. The front fenders of the car have this strange chrome like glow:
    https://imgur.com/a/rD791
    It uses the same shader as the main body and the main body doesn't have that issue. So basically there is this white bright reflection and I have no idea where it is coming from. The fenders are under the spindle instances in gen and look like this:
    MeshFile=lokaril.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(500) Reflect=True
    The fender objects are not double sided nor are they closed. Could either of those be the issue?
     
  5. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    Are you using DevMode? I have some strange issues with sharers in DevMode so now I just package into the game proper every time.

    With the wheel arch, is it set the same as the carbody material shader?

    Off topic - is that a Yokohama A048 tyre textures? I need those as they are the control tyres for the MR2 series I've made.
     
  6. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Yeah devmode. Probably good idea to check inside the game if the problems persist.

    As for the tire texture. There are lots of good quality a048 pics online. One of the easiest tires to make a texture :).
     
  7. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Dev mode should represent everything like it is ingame.

    For the car body shader: Make sure your specular is good with no reflections. And add a bit of reflection. ==> https://www.youtube.com/watch?v=O1mivFR_K64 (start at min 3:55)
    Reflections are also controlled by the diffuse Alpha. So check if it isn't all white. Bake ambient occlusion. Use it in your diffuse, specular map, and use it in the diffuse alpha: to controlle the reflections. ==> http://isiforums.net/f/showthread.php/28933-Help-for-first-mod?p=423820&viewfull=1#post423820


    If you change shaders or change things in shaders in gJED and load it in dev mode again. (If all goes well, they are overwritten. But you'll never know...)
    It's a good time to delete the shader cache of dev mode. "/devmode/UserData/Log/Shaders". To start fresh and everything represent as you designed. A new shader log will be created with the new values.
     
  8. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    We were able to solve the issue. It turns out I had set up some of the orientations xyz wrong for these parts. Now all of them are pointing the same way and as far as I can tell the problem has gone away. The reason I did not figure it out sooner was that I was kinda expecting rf2 to rotate the mesh if the orientations are wrong but it seems the mesh is still drawn physically correctly but the lighting doesn't work correctly with incorrect xyz orientations.
     
  9. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Is there a shader that can do ao shading with tiled textures (bump+diffuse)? What I want is a shader for cockpit which allows me to use tiled texture (diffuse+bump) for the fine texture of the mesh (like leather or carbon fiber for example) and then have another texture which has the overall shadows for the mesh (ao). The latter would be drawn on top of the first diffuse so that it adds the shadow effect and would be controlled by the alpha layer of that texture. Also if such shader exists can it control the ao texture with the the alpha layer of the ao texture? I hope you understand what I mean.

    How does such shader need to be set up in gjed? How do the alpha blend options need to be? One and zero? Can/need one/second/both diffuse textures have alpha layers? Also which uvmaps are used for which texture?

    Does ADD in the shader name mean vertex colors? Does "mul" mean alpha layer of T1 controls where T2 is drawn - like with T1 mul T2?

    Is there a shader that can do shadows in cockpit (like switches on dashboard casting shadow on the dash)?
     
  10. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I think you are looking for a bumb spec map T1 mul T2. (T1xT2 bump spec map in gJED) it's a shader with a wrong name convention in gjed.

    What you want is a common AO map (T2) for the entire cockpit parts and materials, muliplied ontop of a tilled diffuse (T1) for seperat parts and materials.


    UV maps for blender.

    T1 UVmap1 (DXT1 no alpha) tilled diffuse
    T2 UVmap2 (DXT1 no alpha) AO map (common UVmap for the cockpit parts)
    Spec UVmap3 (DXT1 no alpha) copy of UVmap1
    bump UVmap4 (DXT1 no alpha) copy of UVmap1 (or UVmap2 if you want bake high poly details (rollcage weldings, knobs, dashboard seams) in a normalmap)


    - When you have created your cockpit and UVed all the parts into 1 UV tile (UVmap1): you can bake the AO map. (And bake High poly to low poly for a Normal map)
    - Then you copy the UVmap1 into UVmap2 (UVmap2 will be a common UVmap/texture for the entire cockpit)
    - Then you can create a T1 mul T2 layered textureshaders in blender for the Metarials: for example, dashboardleather, carbon, metal, cockpitdetails.
    - assign T1 to UVmap1 in blender and assign T2 (AO) to UVmap2
    - Then you can tile UVmap1 for each surface leather, metal, carbon and create a UVmap1 for cockpidetails.
    - Once you are done UVing T1, you can copy UVmap 1 to UVmap3 for the specular map and UVmap4 for the normalmap)
    - assigning a spec map and bump map in blender isn't needed. Aslong there is a UVmap for these stages for gJED.

    In gJED assign a T1xT2 bump spec map to the materials and fill in the textures.
    fine tune the spec map and specular property's. Specularty makes the material come to live. Spent some time on it. Check it from different angels and distances.


    Texture alpha in general are for transparency and to controll luminance (night luminance color). (Unless it's differently discribed in the shader: like to controle reflections)

    T1 Mul T2 = T2 multiplied ontop of T1 like you would with photoshop
    T1 Add T2 = T2 added ontop of T1 like you would do with photoshop


    if you want knobs to cast real shadows: model them.
    if you want knobs to cast ambient color: bake them to a normal map.
     
    Last edited by a moderator: Oct 7, 2016
  11. CrossPly

    CrossPly Registered

    Joined:
    Dec 23, 2014
    Messages:
    86
    Likes Received:
    244
    For shaders that can use an AO map, look for any shader with "T1 mul T2" in the name ("mul" I assume stands for multiply blending) or the "gravel traps" shader. I don't remember if either of the alpha channels control the blending for any of these shaders, though it would certainly be useful if they did!

    I haven't switched over to gjed yet myself so can't really help with any specifics with it, in Max though they are relatively straight forward to setup as you can set which UV map channel is used by each texture. Blend mode I'm pretty sure should usually be one-zero in any case.

    So far I haven't found a good use for any of the ADD shaders for cars, but perhaps someone else will provide some input there.

    I'm not aware of any shader that accepts an independent shadow map, typically shadows are just baked into the diffuse map (or AO map in the case of a multiply shader).

    From memory the ISI cobra is a good recent example of a car that makes good use of a multiply shader for the dash but I'm sure there are others.

    Edit: Gysbers beat me to it and with much more detail, great post!
     
    Last edited by a moderator: Oct 7, 2016
  12. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
  13. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Thanks for detailed answer.

    However, what you mean by this:
    "if you want knobs to cast real shadows: model them."

    You mean model the shadows as static shadow meshes? I have modelled the knobs and switches but I'm not getting them to cast shadows. For clarity I'd want shadows that are created when the sun is blocked by the 3d model of a switch (or any other object) that is on the dash. So the shadow is dynamic and moves as I drive.

    Does the shadowcasting need a specific shader? Or does it require some ultra level shadow graphics option turned on to see the shadows?
     
  14. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I did mean model the knobs. :) (But you already did)

    You don't need extra stuff or special shaders to create shadows. Just tag the mesh instance as shadow caster (solide in most cases), windows and semi transparant objects shadow caster (texture)
    BTW Don't forget to tag them to recieve lights and onmi lights :eek: (should be ticked by default IMO)

    In gJED shadows aren't perfect. (it's better in devmode and ingame) .
    In gJED shadows seem to have an offset where the shadow starts. So for objects smaller as 10 cm, you probably don't see the shadows in gJED. Check them in devmode.

    But if you tagged them as shadow caster solide. It will be OK.
     
  15. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    I manually edit the gens so I don't use or the gjed gen editing. How do you turn on receive lights and omnis in the gen? Currently my dash is like this in gen:

    car.gen: MeshFile=<COCKPITD1> CollTarget=False HATTarget=False ShadowCaster=(True, Solid) ShadowReceiver=True LODIn=(0) LODOut=(2) Reflect=True

    spinner: MeshFile=<COCKPITD1> CollTarget=False HATTarget=False ShadowCaster=(True, Solid) ShadowReceiver=True LODIn=(0) LODOut=(10) Reflect=True

    No shadows though.
     
  16. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Mesh/instance propeties in the instance editor need to match with the .gen file. :) LOD's, shadow caster, shadow LOD's, shadowgroups, light reciever,... are also storred in the gmt. It's not just a line in the .gen.

    BTW: all objects are shadowrecievers in rF2. Don't know if "shadowreciever=true" is necessary...

    Hopefully gJED will support Cars (.gen-files) soon. Building a complete .gen file manually without mismatches is a lot of work... :(

    Things to check:
    Shadow LOD distance: it's sometimes at "0" by default.
    Also make sure nothing is blocking the sun to get to your knobs. (collision box, windshield,...)
     
  17. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Thanks again!

    Collision box can block sun too? How does one then do collision box for open cockpit cars with rollcage if you then also want shadows in cockpit? I'd guess the collision box needs to be setup correctly or does it always block the shadows? The way it works now is that I do have shadows from the rollcage (low res though) but not from the smaller bits in cockpit.
     
  18. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Collision box is tagged as norender, collidable and NOT tagged as shadow caster. But i guess this is the case.

    If the shadows are low res, maybe you chould check the graphic settings of dev mode.

    For gJED: There are some options for shadow resolution.
    FSAA level: the options you have depend on your graphics card.
    Tex Filter: Doesn't work in gJED: i've overriden it with a nvidia profile for gJED.

    View attachment 20938


    Some reading about shadows: http://wiki.rfactor.net/index.php?title=ShadowCaster and http://wiki.rfactor.net/index.php?title=ShadowGroups
    Shadows are simple to set up: toggle: on/off. Solide or texture. Shadow out distance. and shadow groups
    Everything else depend on the in game settings.
     
    Last edited by a moderator: Oct 8, 2016
  19. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    1,031
    Likes Received:
    317

    What happens if they don't match?
     
  20. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Don't know why some things are in the gmt only and some others are also in the .gen/.scn.

    LOD's are stored in the gmt and you can set them in the .gen file. Don't know what will happen if they don't match.
    For tracks you don't set them in the .scn file. They use the LOD values in the gmt.

    Maybe the new Studio397 staff or experienced car modder has an answer...

    Ideally: The .scn file and .gen file is generated by gJED and shouldn't be manually edited no more. So it shouldn't be up to us think about it.
     

Share This Page