Can Rfactor2 cope with loading a large map like gta4 ?

Discussion in 'Track Modding' started by Skynet, Sep 12, 2012.

  1. Skynet

    Skynet Registered

    Joined:
    Jul 30, 2012
    Messages:
    126
    Likes Received:
    2
    Hi,

    I was thinking about building a large map for RF2 for online multiplayer fun, maybe a city similar in size to GTA4, but i just have a couple of questions first;

    [1] Does anybody know if RF2 can cope with loading a map of such a large size.
    [2] Does RF2 work by draw distance or just load everything at once?

    Any advice or tips will be greatly appreciated

    Regards

    Skynet
     
    Last edited by a moderator: Sep 12, 2012
  2. blakboks

    blakboks Registered

    Joined:
    Oct 20, 2010
    Messages:
    843
    Likes Received:
    30
    1.) It shouldn't be a problem. I've heard of people having tracks that are 50km. I don't know what, if any, the limit in dimensions is.
    2.) Yes. Both. :) Loading and drawing are two totally different, mostly unrelated things. When you load a track, it loads all assets related to that track (and the cars) into memory (vRAM). What is drawn is dependent on many things, including FOV and direction of view, distance (LOD Out parameter in the .gmt), and what is being blocked from view by a larger object closer to the camera (maybe?).
     
  3. Skynet

    Skynet Registered

    Joined:
    Jul 30, 2012
    Messages:
    126
    Likes Received:
    2
    Excellent thank you. It is probably obvious that i am a bit of a noob when it comes to modelling things for games/sims, but at least now i know that it is possible and would not be a waste of time to sart creating a city. I should have chosen my words more carefully, by "loading everything at once" i ment drawing everything at once =).

    So Rfactor 2 loads the whole track to the Ram before starting a race right?, so i guess that means the size of the map i can make will be limited by the capacity of the end users ram? On a side note, i think the same question apply's to 3ds max which probably also loads the objects i will be modelling to ram even if it is hidden.

    Will i have to make duplicates of every mesh with different levels of detail/LOD ?
     
    Last edited by a moderator: Sep 12, 2012
  4. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  5. Skynet

    Skynet Registered

    Joined:
    Jul 30, 2012
    Messages:
    126
    Likes Received:
    2
    Thanks for the tip on containers, that had been something i contemplated before but didnt know existed. So you have modelled a track of 50km length? if you could post a link so i can have a look that would be great =)
     
  6. dandar

    dandar Registered

    Joined:
    Aug 12, 2012
    Messages:
    274
    Likes Received:
    15
  7. Skynet

    Skynet Registered

    Joined:
    Jul 30, 2012
    Messages:
    126
    Likes Received:
    2
    Ok i cant believe what i have just seen, the whole of Vice City in GTR2


    This map was converted from vice city to gtr2 by Dzeszi, whom also made the two smaller vice city tracks for rfactor. It seems to run quite well with no lag, it would be fun to get this up on a server with a few people, who knows maybe an RF2 version will be released.
     
    Last edited by a moderator: Sep 13, 2012
  8. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    As I like to make large tracks I have already tested that, there is no shadow flicker problem anymore with rF2. Also maximum drawing distance is increased from 10km to about 70km.
     
  9. Tobi Coats

    Tobi Coats Registered

    Joined:
    Jun 7, 2011
    Messages:
    63
    Likes Received:
    0
    Well targo is 75 km long
     
  10. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  11. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    I can allready tell you it will work just fine :)

    In rF1 scene was drawn first, and then shadows were drawn on top of it as additional geometry. Since floating point numbers loose precision as you move away from 0.0, the offset between rendered scene and shadow overlay was insufficient at some point.
    That two-pass approach was the reason for all the trouble.

    But these times are long gone now. Shadows are handled by pixlel shaders as scene is drawn. They're no longer something overlayed on top of previously rendered scene, but something built-in into lighting system.


    The only thing track builder needs to be concerned with is shadow bias. You should enable shadow blur and try different shadow quality settings at the furthest corner of your track. You need to find the minimum shadow bias value that is free of shadow bleeding on lit surfaces.

    Here's an example of shadow bleeding in Skyrim:

    [​IMG]

    This is the only problem I can think of, that you may expect on large tracks. It's caused by surface actually casting shadow on itself. Shadows are not razor-sharp in games that use shadowmaps - there's always some precision limit, so shadows cannot represent shape of object ideally. That's why you will see these stripes on surface - some fragments of shadow start slightly under surface and some slightly over it.

    That's why shadow bias is needed - so shadow would not begin exactly at the surface, but slightly below it. But if you use too much shadow bias, you may end up with gaps near thin surfaces. Here's a more detailed description: LINK

    So, with large track you go to a furthest corner and search for minimum shadow bias that is free of shadow bleeding. Shadow detail and shadow blur settings have effect on that, so you need to test different options and find minimum bias value that works in all circumstances.
     
    Last edited by a moderator: Sep 14, 2012
  12. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  13. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    No.. you have to add some "fake" object, which mimic hills on horizon, setting it to be invisible and and cast shadow. Probably it will do the job with some approximation. However IMO it may be far from how it looks irl, because irl a lot of light will be reflected from sky making shadows weaker/more diffused.

    Yes. But you have to set date in location files. It is not possible to set it further in-game (which deserves to be added onto wish-list)
     
  14. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  15. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    The problem with terrain shadows during sunset / sunrise has actually quite simple cause - shadows are casted only by surfaces that can be "seen" by sun.

    Look at first exaple - sun is on the left. Terrain surface casting shadow is marked in red. Black terrain surface is facing away from the Sun and therefore is "invisible" to Sun:

    [​IMG]

    Second case shows what happens when sun gets lower - now you can clearily see that shadow casting surfaces get "thin and broken".

    Third image shows a solution - making terrain a closed box. This time shadow is solid.

    Here's a 3D view of such "terrain box":

    [​IMG]


    There is one problem though. Shadowmaps have their own clip planes (you can see them in dev mode when adjusting shadow parameters).

    This means that our "terrain border" may fall out of shadowmap range and not cast shadow at all. To solve that you only need to keep your "terrain boxes" pretty small (200x200 meters perhaps?) and each box will have it's own border.

    The best approach would be not to touch your terrain but create additional mesh under it with such vertical walls every 100-200m, ensuring terrain is a set of closed meshes. Don't make them too high - only as much as you need them to and of course set it as shadow caster only, without rendering on screen - they would be invisible to us anyway:

    [​IMG]

    Red line shows additional polygons you have to put under your terrain. The idea is to make terrain a solid box rather than one-sided plane.
    Of course your vertical walls must perfectly touch terrain. There should be no gaps or the whole idea goes to bust. It has to be done just like that 3D preview I posted above - solid, enclosed fragments of terrain. It's shown on that zoomed-in fragment - vertical walls of both left and right area must go all the way up to terrain level.


    With horizon objects it may be completely different story and I don't know if it's ever going to work properly due to different Z values. Horizon objects are often much smaller than they appear and just travel with camera. It may not be a good idea to use them as shadow casters or create shadow casters based on them.
     
    Last edited by a moderator: Sep 17, 2012
  16. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  17. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Well, you can always duplicate polygons and reverse them if "two sided" flag doesn't work, so instead of one double-sided polygon you would have two one-sided polygons.

    But I'm not sure how would it work - considering that shadowmap range can often be 200-300m it could look bad even if it worked.
    For example - you could see that shadows from horizon are only visible within some range of your car and form a ring that is travelling with you.
     
  18. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013
  19. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Don't ask ;)

    I'd go for global illumination and only used shadowmaps for near range.

    Instead of global illumination you could go for lightmaps covering entire terrain and being periodically updated (rendered to). It would provide virtually unlimited range for shadows and unlimited number of omnilights (with no "x omnilights per GMT" restrictions).
     
  20. Bink

    Bink Registered

    Joined:
    Nov 20, 2011
    Messages:
    523
    Likes Received:
    2
    ..
     
    Last edited by a moderator: Oct 18, 2013

Share This Page