The Clouds Do not Project Shadows

Your forum for all discussions around Modding.
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

The Clouds Do not Project Shadows

Post by KCHARRO »

Does anyone know how to make clouds cast shadows?

I could do it with the grass, (in the game the grass that is not inside the fields do not project shadows) by editing two files; grassDense.i3d and grassLong.i3d and it works and gives the game quite realism. They are in the folder "data/foliage/"

To do so, edit both files preferably with notepad++ and in the lines of 47-50 and 53-56 change

castsShadows="false" by castsShadows="true"

save and ready (it is not necessary to open with GiantsEditor)

Note: with the "bushes" also works

if it is a mod map, you must do it in said map, same in the folder "/foliage"

If someone discovers how to do it with clouds please let me know, since they are textures and not objects do not have an i3d file.


Also if you could align the sunlight with the shadows, which do not correspond, let me know.

I will continue investigating ....


Important: Remember that there are certain files that if they are edited the multiplayer can stop working ... make a copy of the original.
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

In sky.i3d, I set the "sky" <shape> to cast shadows:

Code: Select all

  <Scene>
    <Shape name="sky" shapeId="1" castsShadows="true" receiveShadows="false" materialIds="1" objectMask="33536" nodeId="1"/>
  </Scene>
...but didn't notice any cloud ground shadows. I then played with the cloud "gsWeatherSetClouds" console command and increased the the cloud densityScale "1 1 10 5" and the ambient light gets darker but still no cloud shadows. Seems like any densityScale above 10 starts to invert the shadows of everything. You can see some cloud setting examples in data\maps\map*_environment.xml
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

Also, regarding shadows, if an I3D's <material> tag has alphaBlending="true" it won't cast a shadow.
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

I uploaded a "mod" with all the foliage and trees casting shadows at http://www.modhub.us/farming-simulator- ... shadows-1/ (pending approval).
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

Eep wrote: Tue Dec 18, 2018 11:00 pm I uploaded a "mod" with all the foliage and trees casting shadows at http://www.modhub.us/farming-simulator- ... shadows-1/ (pending approval).
Good job, do you see a small change makes a big difference? and it has no impact on performance.
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

Eep wrote: Tue Dec 18, 2018 10:27 pm Also, regarding shadows, if an I3D's <material> tag has alphaBlending="true" it won't cast a shadow.
Another thing that I think about this is that the point that emits light is below the cloud layer. and they should also anchor the point of light to the sun, because there are moments that does not correspond to the projected shadow, as if it were desynchronized, and in day / night transitions the change of light is very abrupt, although they have improved somewhat with respect to the version 1.0.0.0

Take a look here:

https://www.fs-uk.com/forum/index.php?topic=204586.105

that there is good discussion on the dynamic terrain
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

I believe directional light, which the sun and moon are in FS19, don't have a specific position like point and spot lights do per se. I'll have to test this by trying to move the sun above the sky.i3d layer, if possible, but clouds do block the sun already so not sure.
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

KCHARRO wrote: Wed Dec 19, 2018 2:50 pm
Eep wrote: Tue Dec 18, 2018 11:00 pm I uploaded a "mod" with all the foliage and trees casting shadows at http://www.modhub.us/farming-simulator- ... shadows-1/ (pending approval).
Good job, do you see a small change makes a big difference? and it has no impact on performance.
There is some lag with FPS dips to 15 in certain places like looking up the hill to the right of the Ravenport farmhouse and when approaching the construction house on the road from the default starting farm but my system is an i5 4th-gen CPU 3.5GHz, 16GB RAM, GTX 750 Ti 2GB with max game settings except MSAA 2x, 4x distances in game.xml, and 50 maxShadowLights (which doesn't seem to matter).
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

Eep wrote: Wed Dec 19, 2018 3:48 pm There is some lag with FPS dips to 15 in certain places like looking up the hill to the right of the Ravenport farmhouse and when approaching the construction house on the road from the default starting farm but my system is an i5 4th-gen CPU 3.5GHz, 16GB RAM, GTX 750 Ti 2GB with max game settings except MSAA 2x, 4x distances in game.xml, and 50 maxShadowLights (which doesn't seem to matter).
Acualy im in work, when i arrive home i test your mod in my PC, Whit my modified files, is stable in 40 FPS, i see you changed more things, tomorrow i tell you.

My PC is similar to yours, i5-4460, 16GB-1333, only direferet GPU, My is an ASUS GTX1050Ti OC 4GB

in maxShadowLughts Don't matter the number you put, only 10 working, i have in FS17 all vehicles i3d modified so that the lights project shadows and it looks incredible, and very realistic but the graphic engine is limited to 10 likewise happens in FS19, if we could find the place to remove that limit maybe we could solve the shadows of the clouds.
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

another thing that I see is the frequency with which it is updated, it does it every two seconds, put yourself away from a tree and look at the edge of the shadow, that's why you're right to say that the sun and moon lights "do not have a specific position like point and spot lights ", is something apart, even the sunlight goes out before he himself is on the horizon
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

Shadow update occurs relative to how fast the game speed is. Increase the speed to 120x and the shadows move much faster than 5x and 1x. Unfortunately, the shadows don't move smoothly (interpolated) which is annoying to some people but apparently that's the way the engine renders shadow movements.
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

Thanks, i'm reading this now, interesting things here
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

I Test your MOD, and work fine, 30-40 FPS:

Take a look here:

https://mega.nz/#F!42AwTASS!viQxkcr3S7Obcsq8uKgWtA

Some Fotos and 1 little video... to this speed is good for me, Im Not a FPS NERD.

I testing in Ravenport too, there it decrease to 28-27 FPS, but less than one second, so in general no give me problems
User avatar
KCHARRO
Posts: 67
Joined: Mon Oct 15, 2018 9:21 pm
Location: Las Tunas, Cuba

Re: The Clouds Do not Project Shadows

Post by KCHARRO »

Look at the Render Stats that there are three types of lights, Directional Lights, Spots Lights, and Point Lights.

The Ambient light is Directional and has shadows, get on a tractor and turn on the beacons, and you'll see that it puts the amount of shadows in Spot Lights ... and the default beacons cast shadows, (by activating the realistic beacons in the config)

You have seen that by modifying the vehicle's i3d and activating the shadows of the lights, they work well without slowdowns or falling of FPS. and render the perfect shadows up to 9 Spot + 1Directonal (10 GE Limit - That's why they disappear at a certain angle of the camera).

in short, Sun and Moon (Directional) Vehicles (Spot).

If we could change the ambient light from Directional to Spot Light, I think that the overall performance problem would be solved and everyone would have dynamic shadows in real time without delays.

Tomorrow is my last day of work, I will not be in the forum until January. If you discover something post it here, when I start working I will let you know in a PM.
User avatar
Eep
Posts: 98
Joined: Mon Nov 26, 2018 6:07 pm

Re: The Clouds Do not Project Shadows

Post by Eep »

The problem with setting the sun/moon to be a spot light is that the shadows will be cast in a cone (/\)--albeit a very long, stretched cone--from the light source instead of at "infinite parallel lines" (\\\\\) so there would be some shadow angle distortion because of the game's sun light source being much closer to the map surface than the real sun being ~63 million miles away from the Earth. I'm also on vacation until January but will be interesting to play with when I get back.
Post Reply