Page 1 of 19

[MOD] Realtime Reflections

Posted: Sun Sep 13, 2015 9:01 pm
by Nystul
----------------------------------------------------------------------------------------------------------------------------------------------------------

Realtime Reflections mod:
newest version - get it from nexus: https://www.nexusmods.com/daggerfallunity/mods/121

old version for dfunity 0.10.24:
https://drive.google.com/file/d/13WxbPi ... sp=sharing

----------------------------------------------------------------------------------------------------------------------------------------------------------
Gallery:
Image
Image
Image
Image
Image
Image
Image
Image

----------------------------------------------------------------------------------------------------------------------------------------------------------
legacy discussion:

I was investigating (realtime) reflections in unity the last couple of weeks since I plan to do a reflection mod.

things that would be nice to have ingame:
  • water reflections for water terrain tiles near the player (should be possible)
  • floor reflections (should as well be possible)
  • outdoor window reflections (may be possible with some restrictions)
  • reflections on every wall (pretty impossible to make it work correctly I fear)
I took a look at: These are my findings on the different techniques in interplay with DFTFU:
All techniques are not cheap in terms of performance, but some are more performant than others, see below:

Planar Reflections:
pros:
  • correct reflections on a plane
  • good quality
  • runtime performance is acceptable
cons:
  • custom shader required (not working with standard shader out of the box)
  • every seperate reflection plane needs an additional render to texture pass (although it is possible to share the rendertextures in reflective surfaces on the same extended virtual plane to a certain degree and even on parallel planes with the same surface normal )
see a screenshot with dummy reflection quads:
Image

Realtime Reflection Probes:
pros:
  • out of the box support of standard shader and unity pipeline (no custom shader necessary)
cons:
  • poor runtime performance (one realtime probe is basically the max already)
  • poor quality
  • per probe only one reflection plane for which reflections are correct (so can effectively only be used for correct floor reflections)
see this screenshot:
Image

Custom Reflection Probes:
pros:
  • out of the box support of standard shader and unity pipeline (no custom shader necessary)
  • acceptable quality
cons:
  • runtime performance better than realtime reflection probes but still not good
  • per probe only one reflection plane for which reflections are correct (so can effectively only be used for correct floor reflections)
see this screenshot:
Image

Screen Space Reflections (ssr):
pros:
  • out of the box support for unity pipeline
  • pretty good runtime performance (everything is done in the fragment shader)
  • reflections in all directions
cons:
  • requires deferred shading
  • ssr method inherent limitations (missing information is the biggest issue)
  • only works indoors well enough (outdoor reflections are mostly wrong due to missing information)
  • heavy artifacts with daggerfall's billboards (see torch and npc reflection in the screenshot)
see this screenshot (please ignore the incorrect shadows on the floor - these are independent of the ssr - i forgot to switch off the sunlight):
Image

There is no best technique as you can see. While it is possible to mix ssr and reflection probes it is not possible to do the same for planar reflections and reflection probes as it seems.
I may go for planar reflections outdoors (since they are the only technique that might allow for the window reflections) and custom reflection probes indoors.
ssr will be a viable option indoors once all billboards have a model replacement...

The nice thing about the reflection probes is that they are fully integrated in the workflow - you can tweak the parameters inside the editor, e.g. smoothness adjustment:
smoothness 1.0:
Image
smoothness 0.8:
Image

So hope it was an interesting read!
I will keep you informed when there is more progress!

Re: Investigations on Realtime Reflections in Unity

Posted: Sun Sep 13, 2015 10:48 pm
by LypyL
Just....WOW! Holy @#$%! :D That reflective floor in the mages guild looks incredible.

Re: Investigations on Realtime Reflections in Unity

Posted: Sun Sep 13, 2015 11:06 pm
by Interkarma
Well that's fairly stunning. I love the mage guild floors also. Great work!

Re: Investigations on Realtime Reflections in Unity

Posted: Tue Sep 15, 2015 3:04 pm
by Arl
This is getting fancy, I like it!

Re: Investigations on Realtime Reflections in Unity

Posted: Tue Sep 15, 2015 4:11 pm
by Nystul
hmm buildings with a 2nd floor are a big problem for reflection probes... maybe I should give planar reflections a try indoors as well...

Re: Investigations on Realtime Reflections in Unity

Posted: Tue Sep 15, 2015 4:48 pm
by Arctus
Getting fancy. I'm assuming nothing is reflected for the player though, correct?

Re: Investigations on Realtime Reflections in Unity

Posted: Tue Sep 15, 2015 6:13 pm
by Nystul
Arctus wrote:Getting fancy. I'm assuming nothing is reflected for the player though, correct?
you are assuming right. I will be happy if I can get it to work even without the player ;) there are lots of unsolved problems and every approach has its issues :(

Re: Investigations on Realtime Reflections in Unity

Posted: Thu Sep 17, 2015 9:11 pm
by Nystul
made some progress today...
reflected billdboards are a bit too dark in contrast to reflected models - no idea where that comes from.
(the texture seams are caused by my dated graphics card)

Image

Image

Image

Image

Re: Investigations on Realtime Reflections in Unity

Posted: Thu Sep 17, 2015 9:50 pm
by Interkarma
Wowsers! That is looking HOT!

Re: Investigations on Realtime Reflections in Unity

Posted: Thu Sep 17, 2015 9:56 pm
by Arl
Did my eyes just met an ilusion?
Can this be for real?

If I'm in a dream, don't wake me up!
If I'm awake, don't put me to sleep!

(I'm trying to say that this is beyond awesome).