I think we can agree that the fake sky in Daggerfall doesn't look or feel all that nice. I just compared the behavior between the original game and Daggerfall Unity, and they appear to be roughly the same (i.e., same function, slightly different magnitudes), but maybe we can do better (and yes, I'm aware of the modern sky mod).
Perhaps we could deviate from the original behavior by seeing if Y-shearing would be a better solution to the problem. Basically, Y-shearing uses the tangent of the player's angle relative to the horizon instead of some linear function, and in theory it should provide a better approximation for where the horizon is on-screen (although I'm not sure; it could look completely wrong).
If you show me where the fake sky position is calculated, I could try experimenting with it some. I just need to be able to get the field of view and the angle of the camera relative to the horizon. I don't know if it'll look any good, but I guess we'll find out!
Try Y-shearing for fake sky?
- afritz1
- Posts: 43
- Joined: Thu Nov 24, 2016 1:19 am
- Contact:
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: Try Y-shearing for fake sky?
I was told nothing can be done about it, but I refuse to believe that we cant align a background to the foreground in 2018. Im glad you opened this, lets see where it will lead
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Interkarma
- Posts: 7243
- Joined: Sun Mar 22, 2015 1:51 am
Re: Try Y-shearing for fake sky?
Even small improvements would be most welcome. If you'd like to trial some ideas, everything is calculated in DaggerfallSky class.
Sky offset is calculated in UpdateSkyRects() which ultimately sets the eastRect and westRect fields used by DrawSky(). The sky is just a 2D backdrop behind the 3D scene like classic.
Just let me know if any more information is needed. Good luck, let me know how you go!
Sky offset is calculated in UpdateSkyRects() which ultimately sets the eastRect and westRect fields used by DrawSky(). The sky is just a 2D backdrop behind the 3D scene like classic.
Just let me know if any more information is needed. Good luck, let me know how you go!
- afritz1
- Posts: 43
- Joined: Thu Nov 24, 2016 1:19 am
- Contact:
Re: Try Y-shearing for fake sky?
Okay, I was able to get it working. See this pull request:
https://github.com/Interkarma/daggerfall-unity/pull/578
It's kind of a subtle change, but I think it helps make the fake sky look a little nicer, and feel a little bit less nauseating. On another note, this was the first time I pulled down Daggerfall Unity and got it running! Maybe I could find some other things to help with in the future.
https://github.com/Interkarma/daggerfall-unity/pull/578
It's kind of a subtle change, but I think it helps make the fake sky look a little nicer, and feel a little bit less nauseating. On another note, this was the first time I pulled down Daggerfall Unity and got it running! Maybe I could find some other things to help with in the future.
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: Try Y-shearing for fake sky?
Great cant wait to see it ingame!!
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Interkarma
- Posts: 7243
- Joined: Sun Mar 22, 2015 1:51 am
Re: Try Y-shearing for fake sky?
That was fast!
I'll get this merged soon, looking forward to trying it out.
I'll get this merged soon, looking forward to trying it out.
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Try Y-shearing for fake sky?
Wow, that's so much better! Nice work.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- afritz1
- Posts: 43
- Joined: Thu Nov 24, 2016 1:19 am
- Contact:
Re: Try Y-shearing for fake sky?
I'm glad it worked! I guess my hunch paid off. The Y-shearing algorithm is already being used by my own software renderer, so it was only a matter of tweaking it some to work with Daggerfall Unity's graphics. I think more people will be okay playing with the old sky now instead of depending on the modern sky mod.