gJED - How to set Reflection Mapper?

Discussion in 'Modding' started by RJames, Sep 10, 2015.

  1. RJames

    RJames Registered

    Joined:
    Nov 2, 2012
    Messages:
    567
    Likes Received:
    0
    Finally getting my head around gJED and all is going well so far apart from the Reflection Mapper.

    Can anyone explain how to set this up, as for me it always remains empty. (Working on a car model for reference).

    Would it also be reasonable to ask for a sub forum in the "rFactor 2 Modding" section for gJED related enquires?
     
  2. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,035
    Likes Received:
    1,654
    +1
     
  3. Tosch

    Tosch Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,872
    Likes Received:
    51
    Even if it is possible I would not use a scn file created by a tool. It may be ok for the first steps, but when you start to fine tune, an editor like Notepad++ is the much better solution. A good organized scn file is your best friend when you mod a track. To have the different instances (racesurface, trees, walls, cones, etc...) organized in groups will be a great help when you have to troubleshoot or modify some settings.

    To add objects to the car reflection mapper (REFMAP0) I copy and paste the entire group (for example all racesurfaces) to a new document, delete everything except "Instance=InstanceName", mark the word "Instance", go to "Search - Find... - Replace" ("Find what" should be Instance), enter "IncludeIns" at "Replace with" and hit the button "Replace all". Now you should have a list including all objects (IncludeIns=InstanceName) ready to copy and paste into the scn file.

    The result should look like this.

    Now you can start with the next group or you add everything in one step (works for smaller tracks, xsectors are not needed in the reflection mapper :p).

    Btw, the scn file for Nordschleife 24h has 21048 lines of code. DJC and I worked simultaneously on that file. That would have been impossible with the Windows Notepad, but Notepad++ has a nice compare plugin. :D
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    Just as an aside, a regular expression replace could do all that in one go. Worth looking into and learning about regular expressions if doing a lot of editing, I'm guessing Notepad++ can do it, or many other editors can. Also agree on a compare tool, invaluable for editing and checking.
     
  5. Butters

    Butters Registered

    Joined:
    May 20, 2011
    Messages:
    134
    Likes Received:
    0
    Great tip re: pasting to a new file for editing then transferring back.

    Excuse my ignorance here though does this need to be done for every instance? And is it always Refmap0?

    Sent from my GT-I9505 using Tapatalk
     
  6. Nibiru

    Nibiru Registered

    Joined:
    Dec 24, 2011
    Messages:
    1,200
    Likes Received:
    1,295
    Check in here for reflection maps set up and naming http://imagespaceinc.com/downloads/rf2/modsresources/rF2_Track_Technologyv3.pdf

    REFMAP0 is only for reflections from cars body, You then have REFLECTEDENV for reflections from track surface. Each one needs different settings. (check PDF) You then have a few more reflection instances you can have for TSO's. But they need more attention to get the right settings. Check the PDF.
     
  7. Tosch

    Tosch Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,872
    Likes Received:
    51
    Think of a reflection mapper as a camera. This camera renders a 360 deg panorama around the specified location (dynamic cube map). All you have to do is to tell the reflection mapper which objects you want to include. You can include everything but for performance reasons it's not the best idea.

    ReflectionMapper=REFMAP0 creates the cube map for the vehicle in focus.
    ReflectionMapper=STATIC00 creates the cube map for static objects (Building windows for instance). You can have more than one static mapper (static00, static01, ...). The gfx engine picks the one closest to the instance with the cube material. All you have to do is to find a good position for the "camera" on the track and add the coordinates (Pos=(-100.000,8.000,0.000)). No need to include instances. The "UpdateRate" is very low to save resources.
    ReflectionMapper=REFLECTEDENV creates the environment reflections (wet road). This is the most complicated of the 3 mappers. You have to specify a reflection plane (mirror axis) for every instance (global plane doesn't work and is useless on most tracks) you want to include in the mapper.
    The first 3 values define the angle of the reflection plane (might be useful when the road surface is angled, but extremely complicated to get right), the fourth value is the z-coordinate (height) of the objects base in the 3d environment. You have to invert the value. If z is 12.000 in 3dSimEd (I measure the height on the road nearby) the value for the plane is -12.000.

     
  8. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    How does this actually work in gjed? I've read the isi tutorials but they are useless for car building. I'm not even sure if I need to set up reflection mapper for a car. I know my chrome materials are not working (works on in spinner but in game it is just white) so I'd guess I need reflection mapper (or just get rid of chrome parts...).

    So after typing in REFMAP0 what do I need to do next? I've tried randomly editing the numbers and ticking things on and off but all I get is random crashes. Do I need to somehow open and edit my gen file of the car and then import that into that refmapper? Do I need full gen file or just the parts that reflect? What defines what reflects and what doesn't? Is it just for cubemap shadered parts or..?

    What do these buttons do?
    https://imgur.com/a/15QeA
    What does get locations from instance mean?
    What are the three number slots below the b button (b loads a mesh I think)
     
  9. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469


    For cars you don't have to do much. You don't have to do anything in the "REF" button. :) that's for track modders to create refection planes. It's up to the track modders to assign objects to be reflected on the car. All you have to do is tick "live mapper" in the reflection texture stage.

    You have to assign the car to be reflected on a wet track with parts with reflect=true:
    Check a .gen file from a recent ISI car.
    http://isiforums.net/f/showthread.p...object-problem?p=431528&viewfull=1#post431528
     
  10. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Thanks for your answer. So if I understand correctly you don't need to set up any kind of refmap0 anything anywhere for a car model?

    For which materials should the live mapper be turned on (for cars)? For every material or for just a few materials? Glass? Mirrors? Shadows? Shaders that use cube maps or don't use cube maps? Shaders that have (or don't have) specularity maps? What about materials that are supposed to be shiny like car paint, wheels, chrome or just for something like leather dash material? Should it be used for matte materials?
     
  11. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    I guess: anything with a "cube" stage in the shader.

    anyway this works: View attachment 20752
     
  12. T1specialist

    T1specialist Registered

    Joined:
    Jan 11, 2012
    Messages:
    237
    Likes Received:
    163
    Thanks a bunch Gysbers!
     

Share This Page