Car Undertray shadow at night

Discussion in 'Car Modding' started by Gijs van Elderen, Oct 22, 2016.

  1. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Something that annoyed me for a long time is that the undertray shadows disapears at night.

    The common technic to get an undertray shadow is to create a ambient shadow caster from a texture under the car. But this ambient shadow disapears at night. It makes the car float on the racetrack at night.
    .gen line :"MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False AmbientObject=(True,Texture)"

    What i did is simple: Instead of creating ambient shadow caster. I used this same undertray.gmt and texture as a Decal. Same technic as tracklines and verges for tracks. Alpha Blending = src Alpha/inv src Alpha
    I used a "T1 no direct lighting shader", so the sun doesn't light the plane. But i think a T1 would work just fine. and tagged the undertray.gmt as decal + unticked omni and spot lights.
    .gen line :"MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False"

    Result is the same at day time. But the Undertray shadow stays at night.

    I thought it might be usefull to share this. :)

    [​IMG]

    View attachment 20965

    View attachment 20964

    View attachment 20963

    Before:
    [​IMG]

    After:
    [​IMG]


    Youtube doesn't like dark colors to much... :(
     
    Last edited by a moderator: Oct 22, 2016
    Ernie, T1specialist, gpfan and 2 others like this.
  2. Woodee

    Woodee Registered

    Joined:
    Oct 4, 2010
    Messages:
    4,010
    Likes Received:
    1,071
    Good work!!
     
  3. Emery

    Emery Registered

    Joined:
    Oct 24, 2010
    Messages:
    3,035
    Likes Received:
    1,654
    Way cool!
     
  4. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    Brilliant! This is what I love about the modding community. Thinking outside the (shadow) box.

    Is that gJed you're using? Is it possible to make those settings with 3DSimEd?
     
  5. Domino Duhan

    Domino Duhan Member

    Joined:
    Sep 6, 2013
    Messages:
    95
    Likes Received:
    122
    Very nice, i miss this too:)
     
  6. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,782
    Likes Received:
    2,243
    I'm using this in a car I'm working on right now. There's an issue. Anything close to the undershadow will move "behind" it when viewing from a distance, because the decal always goes over other objects. It's especially noticeable with objects close to the ground(like the floor on an open wheel car). So I would say this fix might not work for all cars, but the ones that it does work well for will look really nice.
     
  7. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    A better way is to put it in the list of improvement to do by Studio 397 :) :) without changing anything with the current default method.
    But it's a nice found to try to improve rF2 rendering at night.
     
    Guimengo likes this.
  8. gpfan

    gpfan Registered

    Joined:
    Sep 5, 2012
    Messages:
    167
    Likes Received:
    77
    I´ve tried myself this and didn´t manage to have the shadow working at all.... The moment i take off the entry "AmbientObject=(True,Texture)" the shadow disappears.
     
  9. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Check back faced culling. Flip the faces or tag as two sided as test.
     
  10. gpfan

    gpfan Registered

    Joined:
    Sep 5, 2012
    Messages:
    167
    Likes Received:
    77
    Thanks for the tip! I tested but the result is not what i thought it would be...... On track cameras the shadow disappears on greater distances (day and night), at night only when you have cam swingman active and see the car near the result is satisfying, apart from that dont think this is the solution.....

    Undershadow NEED to be fix on the software code itself, very poor shadow at night is a bummer!!!
     
  11. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Check LOD out. And a decal needs to be as close to the ground as possible, while a ambient caster can have some distance. Alpha channel of the texture needs some adjustment too.

    But never the less: The best solution is that the current ambient undertray shadow could stay at night, in low light conditions and when the car is driving in the shadow of a building.
     
  12. WiZPER

    WiZPER Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,517
    Likes Received:
    186
    This works, but you MUST use "Alpha Sorting: 2"

    Tested at ISI's Silverstone.

    With out sorting at 2: GRAB_057.JPG

    With sorting at 2:
    GRAB_059.JPG
    Instance in .GEN:

    MeshFile=Darche_EGT_shad.gmt CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(500.0) Reflect=False
     
  13. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    Nice work.
    If you didn't adjust the apha channel of the undertay shadow yet:
    The alpha channel could use some adjustment. (a bit stronger white)
    To get a better effect: the gradient out between white/back may be a bit bigger.

    BTW: keep a back up of the original if you want to revert back.
     
  14. WiZPER

    WiZPER Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,517
    Likes Received:
    186
    I'm gonna make all new individual undershadows I think, URD is currently using same for all GTEs (and yes, this is allowed modifications for league usage, I DO respect Ales work!)
     
  15. UnitedRacingDesign

    UnitedRacingDesign Registered

    Joined:
    Nov 24, 2010
    Messages:
    2,408
    Likes Received:
    938
    Well once you are done you know where to find me and ill send you some beers :D

    @Gijs van Elderen thx to find that and how to fix it!
     
    Flaux and Gijs van Elderen like this.
  16. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
    No problem.:)

    IMO: During day time: The normal ambient texture caster still works better. But it's gone at night.

    So a mix between the 2 could be a solution:

    ( @WiZPER ): I've no idea if these visgroups work for cars:
    J 512 Removed when night time (for the ambient texture caster)
    K 1024 Removed when daytime (for the decal)

    It's worth a try. (note: i think these visgroups work on Instance level and not at .gmt level)

    But never the less: The best solution is that the current ambient undertray shadow could stay at night. :cool:
     
  17. WiZPER

    WiZPER Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,517
    Likes Received:
    186
    @Gijs van Elderen, I agree it would be a better solution. And I don't think that the visgroups work for cars - think I tested it for our glowing numberplates at some point. I'll see if they seem to work properly without other down sides, and if not I can send you a few GMTs, Ales :)
     
  18. Liquid4653

    Liquid4653 Registered

    Joined:
    Sep 30, 2013
    Messages:
    202
    Likes Received:
    46
    you could always use the upgrades/tuning system and make a Day/Night selection in there before you go to race, swapping between 2 versions of the undertray.
     
  19. Bjørn

    Bjørn Registered

    Joined:
    Oct 4, 2010
    Messages:
    1,821
    Likes Received:
    919
    And how would that work in a full day/night cycled race?
     
    MaD_King likes this.
  20. yoss

    yoss Registered

    Joined:
    Nov 4, 2010
    Messages:
    1,022
    Likes Received:
    2,714
    so gijs , for resume
    gen line :"MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False AmbientObject=(True,Texture)"
    What i did is simple: Instead of creating ambient shadow caster. I used this same undertray.gmt and texture as a Decal. Same technic as tracklines and verges for tracks. Alpha Blending = src Alpha/inv src Alpha
    I used a "T1 no direct lighting shader", so the sun doesn't light the plane. But i think a T1 would work just fine. and tagged the undertray.gmt as decal + unticked omni and spot lights.
    .gen line :"MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False"

    at the end what do you write on the gen??
    MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False AmbientObject=(True,Texture)/// needed for the day
    MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False
    this version can work the same way we did for the car rendering
    or only :
    MeshFile=camaro_undershadow.gmt CollTarget=False HATTarget=False and gmt have a t1 shader and is exported tagged as decal + unticked omni and spot lights with alpha sort = 2 sticked?.??
    alpha sort 1 to 4 is normaly reserved for track , 4 to 8 is reserved for the car
     
    Last edited: Dec 1, 2016

Share This Page