Shadow issue in cockpits - direct sunlight on roll cage through body

Discussion in 'Car Modding' started by Brent, Feb 7, 2020.

  1. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    What can cause the outer body not to cast shadows over the rollcage and allow sunlight to illuminate it even though it should always be in shade? Is it because the rollcage mesh may intersect with the body or interior cab mesh at someplace and that confuses how shadows should be rendered? Objects and the body seem to cast shadows onto things in the cockpit just fine but it seems the rollcage gets this direct sunlight on it. Do I have the incorrect parameters in the .gen file for the instance slot ID body mesh? Or incorrect parameters for the rollcage?

    For months and working with a handful of mods I cannot figure this out. My shadow settings are set to max in RF2. Here's an example of what I'm seeing when the sun is directly behind the vehicle, it's on the ISI Stockcar here:
    [​IMG]
     
    Last edited: Feb 7, 2020
  2. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,782
    Likes Received:
    2,242
    You could try baking AO into the verts, so the top of the roll cage would be black, and should stop the light showing, I did this in the Indycar cockpit because I was getting similar issues. Could also be how the faces are detached/not detached.
     
  3. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    I'm not familiar with baking AO into specific verts with Blender or max, do you know of any good tutorials on how to do that?

    I have worked with the ao layer of the IBL/PBR shader for the area mapped to the rollcage. Fortunately, the rollcage happens to be mapped into the main template but I can't change the AO of a particular portion of the rollcage as all the UVs share the same section so I have had to make a compromise. I guess I can set aside another area of the template and remap the UV's of the cage near the roof. This just seems like a workaround to me like when we use to paint the shadowing on a livery.

    It seems to me there's an issue with the body of the vehicle in the slot ID section of the gen file not registering with the other instances in the cockpit or something to block reflections or cast shadows. I see road being reflected in clear gauges and reflective objects in the cockpit. I've used the alpha layer on some objects to cut down on outside reflections that should be blocked out by other objects in the cockpit. In one particular instance I have a rollcage going right through a section of the body at the door and the rollcage is rendered without any shadow or change in ambient light from the body which should block out light. I've seen gen files organized in so many ways it's confusing to know which one is proper and if that has something to do with this.
     
  4. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    Do you have a separate roll cage GMT? Or is it combined with the interior GMT? What have you got on the line in the GEN file? Do you have "ShadowReceiver=True"?
     
  5. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    The rollcage is a separate gmt from the body and interior. I'll double check everything again. Is there a proper order for those parameters, does it matter if shadowreceiver is ahead of shadowcaster? The settings for one doesn't have an effect on the other correct? I'm pretty sure they don't but everything I've learned is on my own from information I've pieced together here and there.
     
    Last edited: Feb 10, 2020
  6. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,782
    Likes Received:
    2,242
    I just checked my car, and the same happens. Sun is in front of the car.
    Untitled-1.jpg
    Maybe if you clone the body of the car, and place it in the cockpit instance, and set it to non renderable, and as a shadow caster.
     
  7. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    Self in rear view mirror error

    Here's another example of the body not properly casting proper shadows within the cockpit. Looking at the driver in the mirror, you can see the face of the driver appears ok, likely the shadow cast from the visor. However, the helmet and drivers shoulders should not be lit up like the car is an open cockpit.
     
  8. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    Try adding an instance of the roll cage GMT into the 'COCKPIT' section of the GEN and add 'ShadowReceiver=True' and 'ShadowCaster=True' to the line.

    I've actually started adding the 'ShadowCaster=True' part into the cockpit GMTs so they cast shadows within the cockpit.
     
  9. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    I have the cage in the cockpit section and set as a shadowcaster and it casts shadows within the cockpit. The issue is the highlights of light being cast on the tops of cockpit objects that should be well within the shadow of the main body.
     
  10. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    Hmm odd. OK plan B...

    Does your cockpit model have a 'roof'? This is a guess, but if the roof you see in the first picture is the exterior model then maybe copy some sections of the roof panel and paste them into your interior model. With the ShadowCaster and ShadowReceiver bits set to true.
     
  11. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    237
    Likes Received:
    113
    It has both a "roof" and rollcage in the Instance=Cockpit section of the gen file.

    MeshFile=sc2014_cockpit.gmt CollTarget=False HATTarget=False LODIn=(0) LODOut=(2) ShadowCaster=(True, Solid) Reflect=True
    MeshFile=sc2014_rollcage_max.gmt CollTarget=False HATTarget=False ShadowCaster=(True, Solid) LODIn=(0) LODOut=(2) Reflect=True


    Interesting, so do all of the instances need to have ShadowReceiver set to true? I mean other parts of the cockpit that don't have ShadowReceiver even as a parameter seem to have shadows cast on them. This is the ISI stockcar and only the tire instances are set with ShadowReceiver=True

    The only thing set with ShadowReceiver=True on the SkipBarber is the rain light.
     
  12. dylbie

    dylbie Registered

    Joined:
    Oct 25, 2012
    Messages:
    437
    Likes Received:
    756
    You can try and see if it works. I'm guessing it probably wont if the others don't have it, but you never know with rF2.

    One thing I've learned that with rF2 you can do the exact same thing to two items and get completely different results.

    If that fails, and it's still receiving light, then the only other thing I can think of is that maybe the shader on the texture is set up to somehow receive ambient light. I guess as a final, final step is to try and find a car with a roll cage that has shadows and see how it's set up.
     

Share This Page