Author Topic: VFM Sun Shadows from CTS Terrain ?  (Read 3688 times)

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6642
    • View Profile
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #15 on: June 05, 2019, 11:39:26 PM »
Some resource might be missing. Did you move the asset around? And the demo scenes, do they work?

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #16 on: June 05, 2019, 11:47:35 PM »
Demos are working ok...

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #17 on: June 06, 2019, 12:03:35 AM »
Don't know if this is significant, but

If "Render Before Transp" is FALSE, then the Volumetric Fog Pos T script is present and enabled
If "Render Before Transp" is TRUE, then the Volumetric Fog Pre T script is present but disabled and I also cannot enable it (same issue as for the main component)

Might offer a clue ?

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #18 on: June 06, 2019, 12:29:11 AM »
Well that's embarrasing!
Issue solved - it was my own code disabling the component!!!!!!
I am sorry  ::)

Right I'm off to get some performance tests done

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #19 on: June 06, 2019, 07:53:19 AM »
Initial tests indicate that using the native shadow map option gives many benefits in my case:
- Terrain now casts shadows into the fog using CTS
- All other shadowcasters cast shadows into the fog too (I was being selective before to reduce impact on performance)
- overall scene performance is significantly better by around 20% (no significant drop in FPS now when using sun shadows)
- Shadows are read in real-time with no spiking

I will do some more tests, but itís looking like this was a very good move!!!!
Thanks for implementing it 👍
« Last Edit: June 06, 2019, 07:57:15 AM by Frozenempire »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6642
    • View Profile
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #20 on: June 06, 2019, 08:27:29 AM »
Looks like the new implementation should be the default setting. Thanks for your feedback and glad it turned out into an important improvement!

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #21 on: June 07, 2019, 09:56:21 AM »
Did some more tests last night, definitely a better solution to catch shadow casting objects 😎

I then noticed in my environment that the volume fog was not being shadowed by the clouds as they passed overhead which takes away some realism... It seems thatís because Enviro uses a simple directional light cookie as the mechanism for cloud shadows, ie not writing to the shadow map.

I played with other cloud shadows solutions like screen space solutions and projector solutions, but they create other artefacts. Light cookies does seem like the best solution for cloud shadows.

So todayís question 😉... is how can VFM sample the directional light cookie when calculating the lighting at any given position... is that even possible?

Then I think we have all the bases covered for a fully accurate fog with most common shadow sources compatible 👍

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6642
    • View Profile
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #22 on: June 07, 2019, 11:29:15 PM »
You ask, I deliver :)

Cookie support added to 10.4 b1.

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #23 on: June 07, 2019, 11:56:57 PM »
😮

Wow! Unbelievable fast.
Checking out right now.

frozenempire

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • The Frozen Empire
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #24 on: June 08, 2019, 12:31:32 AM »
You sir, are a genius!

I am so happy with these latest 2 changes - sun shadows have never looked so good and all at almost zero cost.

Huge thanks to you  :)

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6642
    • View Profile
Re: VFM Sun Shadows from CTS Terrain ?
« Reply #25 on: June 08, 2019, 12:44:26 AM »
Great. Glad to see they work as expected!
Cheers