[MOD] Realtime Reflections

A curated forum for approved mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
User avatar
Nystul
Posts: 1345
Joined: Mon Mar 23, 2015 8:31 am

Re: Investigations on Realtime Reflections in Unity

Post by Nystul » Sun Sep 27, 2015 7:05 pm

i'm quite surprised how natural the reflections feel - don't want to miss them anymore...

Image

User avatar
Nystul
Posts: 1345
Joined: Mon Mar 23, 2015 8:31 am

Re: Investigations on Realtime Reflections in Unity

Post by Nystul » Sun Sep 27, 2015 7:43 pm

ReflectionsMod version 0.2:
outdoor ground and sea reflections
indoor reflections in some buildings (check out daggerfall castle)

https://drive.google.com/file/d/0B1QjwG ... sp=sharing

installation:
  • import the package
  • drag&drop prefab ReflectionsMod into the hierarchy at root level
  • add this function to MaterialReader.cs:

    Code: Select all

            public bool SetCachedMaterial(int archive, int record, int frame, CachedMaterial cachedMaterialIn, int alphaIndex = -1)
            {
                int key = MakeTextureKey((short)archive, (byte)record, (byte)frame);
                if (materialDict.ContainsKey(key))
                {
                    materialDict[key] = cachedMaterialIn;
                    return true;
                }
                else
                {
                    return false;
                }
            }
    
  • if you are using the game branch of DFTFU change lines "using DaggerfallWorkshop.Demo;" into "using DaggerfallWorkshop.Game;"
notes:
without the enhanced sky mod reflections are pretty dark...

User avatar
Interkarma
Posts: 4433
Joined: Sun Mar 22, 2015 1:51 am

Re: Investigations on Realtime Reflections in Unity

Post by Interkarma » Mon Sep 28, 2015 5:07 am

This is great, thank you for the update. :)

User avatar
epicurius7
Posts: 11
Joined: Sun Aug 02, 2015 4:18 am

Re: Investigations on Realtime Reflections in Unity

Post by epicurius7 » Mon Sep 28, 2015 7:33 am

Interkarma wrote:That is beautiful! I actually feel sorry for the fictional cleaners who have to keep that level of shine with grubby adventurers stomping all through the place. :D
We need a 'Muddy Footprints' mod now, and janitors that shout 'halt!'

User avatar
LypyL
Posts: 514
Joined: Sun Mar 22, 2015 3:48 am

Re: Investigations on Realtime Reflections in Unity

Post by LypyL » Mon Sep 28, 2015 6:21 pm

Looking good! One thing I was thinking of that would be a nice touch is when stores / guilds /temples are implemented, would be to make it so that lower quality buildings have non-reflective floors and increase the reflection strength as the quality increases.

User avatar
Nystul
Posts: 1345
Joined: Mon Mar 23, 2015 8:31 am

Re: Investigations on Realtime Reflections in Unity

Post by Nystul » Mon Sep 28, 2015 8:07 pm

LypyL wrote:Looking good! One thing I was thinking of that would be a nice touch is when stores / guilds /temples are implemented, would be to make it so that lower quality buildings have non-reflective floors and increase the reflection strength as the quality increases.
nice idea ;)
should be possible to extend the script in some way then
will be challenging to make reflections look good on wooden floor textures :D
I am not too happy with the way i calculate the output color by combining albedo and reflection color in the shader - I wonder how it is done in the standard shader for the reflection probes. I tried to understand what is going on in there but I need to spend more time on it.
It was a struggle to get textures without reflections to look similar bright compared to textures with reflections. Just alpha-blending didn't do the trick...
I want to support optional custom metal/smoothness maps for textures in the next version, so that parts of a texture can be more reflective/smooth than other parts. Just have to find the time to implement it

User avatar
Nystul
Posts: 1345
Joined: Mon Mar 23, 2015 8:31 am

Re: Investigations on Realtime Reflections in Unity

Post by Nystul » Fri Oct 09, 2015 9:03 am

update:

ReflectionsMod version 0.24:
outdoor ground and sea reflections
indoor reflections in some buildings (check out daggerfall castle)

0.24 changes:
shadows are working again correctly now

0.23 changes:
lots of bugfixes, improvements
outdoors:
  • no more pink shaders on terrain tiles when loading new terrains
  • working with FloatingOrigin and PositionUpdate script now, still working without also ;)
  • location reflections can be seen from other map pixels as long as it is the largest neighbor location and no location is at the current player location's map pixel
indoors:
  • reflection plane determination for lower level is now more robust
    • much less cases where lower level reflection plane computation is wrong
    • holes in walls, floors in daggerfall's indoor geometry are handled correctly much more often
    • mages guild with 4 floors also works now
    • reflections "around the corner" work now in most cases
https://drive.google.com/file/d/0B1QjwG ... sp=sharing

installation:
  • import the package
  • drag&drop prefab ReflectionsMod into the hierarchy at root level
  • add this function to MaterialReader.cs:

    Code: Select all

            public bool SetCachedMaterial(int archive, int record, int frame, CachedMaterial cachedMaterialIn, int alphaIndex = -1)
            {
                int key = MakeTextureKey((short)archive, (byte)record, (byte)frame);
                if (materialDict.ContainsKey(key))
                {
                    materialDict[key] = cachedMaterialIn;
                    return true;
                }
                else
                {
                    return false;
                }
            }
    
  • if you are using the game branch of DFTFU change lines "using DaggerfallWorkshop.Demo;" into "using DaggerfallWorkshop.Game;"
notes:
without the enhanced sky mod outdoor reflections are pretty dark...

User avatar
LypyL
Posts: 514
Joined: Sun Mar 22, 2015 3:48 am

Re: Investigations on Realtime Reflections in Unity

Post by LypyL » Sun Oct 11, 2015 9:15 am

Awesome work!

User avatar
Nystul
Posts: 1345
Joined: Mon Mar 23, 2015 8:31 am

Re: Investigations on Realtime Reflections in Unity

Post by Nystul » Wed Oct 14, 2015 7:45 pm

working hard to get version 0.3 out as soon as possible...

metallic gloss map in action (ok, maybe I overshot a bit with the reflectivity on the floor texture):

Image

Image

User avatar
Interkarma
Posts: 4433
Joined: Sun Mar 22, 2015 1:51 am

Re: Investigations on Realtime Reflections in Unity

Post by Interkarma » Wed Oct 14, 2015 11:41 pm

Looking great as usual! :)

Post Reply