1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rFactor large tracks shadow flicker solution?

Discussion in 'Bob's Track Builder' started by sevware, Apr 14, 2010.

  1. So...

    Still building my 30 mile track. Everything working well EXCEPT shadows. After a month of trying everything that could be searched / translated from lots of forums (settings, config, video cards, box like shadow casters, size of polys in casting object, texture on inside / outside etc... etc...)....

    I have now found how to cause shadow flicker:

    With the stock exported settings from BTB, once in rFactor, any shadow casters more than about 2.5km from the track origin point (X=0, Y=0, Z=0) start to flicker. As you continue to move away from the origin this flickering gets much worse. This is also true of under car shadows. Large shadow casting objects (like tunnel shadow boxes) tend to have random shadows (from its various polys) flickering on and off.

    My track is roughly retangular (when viewed from a 'God' shot)... although curvy within this basic shape, due to its large footprint, and that it is google earth created from 4 intersecting roads, some of shadows worked, and some did not. I tried everything I could troll off of many forums. Eventually I made a copy, and stripped out everything except the 1st track section where the start finish line was. Then I stripped out everything else (terain, objects, walls...) except a shadow caster. It still flickered (this track section is at about X=5km, Y=5km). Eventually, when about to give up, I moved the whole thing to intersect the track's 0x, 0y, 0z origin, and the flickering stopped!!!

    To verify this, I built a new scratch track which was just a 10km road starting at X=5km, Y=0, Z=0 .. and ending at X=-5km (a 10km long track with its center on 0,0,0). Then, I placed 100m tunnel shadow boxes about every 1km along the path. With this test, you can drive along and watch when the flickering stops. Again.. just before the 2km till origin area the flickering stops ... and stays that way until just past negative 2km on the other side of the origin.

    I am hoping that someone can tell me some setting in the scn or gdb file or somewhere that can be used to adjust this out to about the 6km range.

    Initially you would think that something in the FDirect {...} structure would do it, but I've read that that is no longer used (only a code holder) ..?..

    Perhaps the minshadowangle (spelling?) variable..?..

    Any way to set the hight or trajectory of the "sun" (FDirect?...)? That is ... maybe it is artificially 'setting' at the 2km radius (<--wild stab at an answer there)??

    Could anyone provide details about how or what (if anything) these and any other lighting settings work.

    I could start playing with any lighting & shadow oriented parameters, but would rather know what they do first (it's quicker, ya know).

    Any other help on this would also be appreciated.

    Thanks in advance
    • Love Love x 1
  2. It turns out that setting the mainview 'far' clip plane {.... ClipPlanes=(0.05, 200000) ... in the SCN file stops the flickering. It had to be a huge value though...

    --As you approach 80000, the 'random poly' shadow flickering goes away, but the entire shadow blinks at about 2Hz.
    --By setting it at 100000, this goes down to about once a second.
    --In the upper one hundred thousands this cycling went away altogether, and the shadow is nice and stable.

    The only problem remaining is that the shadow itself (not the casting object) seems to 'pop in' at a distance of about 500 meters.... almost as though there is an LOD on the shadow itself. I have tried to set the LOD of the casting object further away to see if that would also affect when the shadow 'pops in', but it doesn't.

    I know that this only is pertinent to people building tracks with a very large footprint (>~4 sq km), but any ideas on getting these shadows to 'pop in' a bit further out (~1500m) would be appreciated.
  3. OK.... Found the setting for how close you have to get before a shadow can be seen.

    It is an SCN file parameter, which when absent, defaults to 350 meters in rFactor. BTB does not put it there for you so you will have to type it:


    As I had mentioned, there was a problem as I approached my tunnels..... when I got to the (default) 350 meters from it, the shadow would (way too obviously) 'pop in'. By typeing the above line into the SCN file, my shadows now come on almost twice as far away (just before the tunnels are visible), and all is well. It probably does not matter, but I put the MaxShadowRange parameter setting line just below the 'group method link single' stuff.
  4. I am still hassling with this problem with my Pyhäranta track. I tried to copy values from Nordschleife which is rather similar in size, but no luck. Sometimes shadows flicker, sometimes not. Also similar problems with night time driving lights. Any help?
  5. Kris Vickers

    Kris Vickers
    Hardware Staff

    Have you had anybody else test your track, to see if they get the same issue?

    My only thinking is that its GFX card related? You never know sometimes, might be worth a shot.
  6. Yes it seems to happen to other users too.
  7. Erwin Greven

    Erwin Greven
    Premium Member

    Also i have this problem with the 15 mile Hondsrugring.
  8. IIRC it is something to do with dynamic shadows. And IIRC again, they have solved this in rF2 by making all shadows dynamic.
  9. Seems like this problem occurs only in BTB made tracks, e.g. Nordschleife 2007 and original Klausenpass doesn't have this problem at all. So shouldn't be just IIRC related...
  10. Thank you, this was very informative post. I wonder how they will go around this restriction with Targa Florio project, that track definitely doesn't fit inside 8km... Over 100K or so does indeed help for most severe flicker problems.