Disable / Hide Exterior Building

Discuss modding questions and implementation details.
User avatar
Macadaynu
Posts: 263
Joined: Sun Mar 07, 2021 1:18 pm

Re: Disable / Hide Exterior Building

Post by Macadaynu »

Magicono43 wrote: Tue Jan 04, 2022 12:29 pm Show a screenshot of what it looks like in action now, pretty curious :P
As you can see, all exterior textures are rendered apart from those inside of the cube:
daggerfall-unity-0.12.3-beta - DaggerfallUnityGame - PC, Mac & Linux Standalone - Unity 2019.4.28f1 Personal [PREVIEW PACKAGES IN USE] _DX11_ 04-Jan-22 5_20_33 PM.png
daggerfall-unity-0.12.3-beta - DaggerfallUnityGame - PC, Mac & Linux Standalone - Unity 2019.4.28f1 Personal [PREVIEW PACKAGES IN USE] _DX11_ 04-Jan-22 5_20_33 PM.png (1.29 MiB) Viewed 1103 times

So now I just need to calculate the size of the box and centre of the building, which is all available I believe.
BadLuckBurt wrote: Tue Jan 04, 2022 1:05 pm All credit to Pango, I just threw the idea out there without any idea how to implement it. My brain melted a bit reading Pango's posts but happy to hear that it works. If it all works out, this will be the first TES game that has this feature. Lord knows people ask for this in every TES game :D
Yeah my first time looking at shader code so my head also hurt a bit haha,

The only main problem left now is an aesthetic one: The sky texture does not load when indoors, it's not a major issue seeing as the background colour still loads, but would look nicer if we could look out of the window and see a proper sky texture.

I've looked at the DaggerfallSky script and can't see why not, I'll keep trying but I'll probably end up back here begging for help :lol:

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Disable / Hide Exterior Building

Post by Magicono43 »

Very interesting, hope this technique allows you to do the mod you were working on, and maybe allows some others to think of other creative ways to mess with the town block structures.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Disable / Hide Exterior Building

Post by BadLuckBurt »

Macadaynu wrote: Tue Jan 04, 2022 5:30 pm Yeah my first time looking at shader code so my head also hurt a bit haha,

The only main problem left now is an aesthetic one: The sky texture does not load when indoors, it's not a major issue seeing as the background colour still loads, but would look nicer if we could look out of the window and see a proper sky texture.

I've looked at the DaggerfallSky script and can't see why not, I'll keep trying but I'll probably end up back here begging for help :lol:
I'll see if I can learn anything about the sky. Other than that, things are looking bright. One question, since those exterior polygons are not being drawn, is there still collision from them? If so, it should be possible to turn off collision on the exterior mesh when you're in the interior.

Also, I remembered this:

Code: Select all

Etherealness
Duration: %bdr + %adr per %cld level(s)
Chance: %bch + %ach per %clc level(s)
Magnitude: N/A + N/A per N/A level(s)
"Turns caster ethereal, thus able to walk through
walls. Chance of success is %bch, plus %ach every
%clc level(s) of the caster. Caster will remain
ethereal for %bdr round(s), plus %adr round(s) for
every %cld level(s) of caster."
If there's no collision when the polygons aren't drawn, this might be the ticket to adding this :lol:
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Macadaynu
Posts: 263
Joined: Sun Mar 07, 2021 1:18 pm

Re: Disable / Hide Exterior Building

Post by Macadaynu »

BadLuckBurt wrote: Tue Jan 04, 2022 8:46 pm
One question, since those exterior polygons are not being drawn, is there still collision from them? If so, it should be possible to turn off collision on the exterior mesh when you're in the interior.
Yeah I've been turning off the exterior collisions when debugging easily, should be easy to do in code

One thing I did not anticipate, is that door textures are considered both Exterior and Interior (understandably), so I'll have to use some exceptions when deciding what to not render, otherwise we'll end up with invisible doors indoors :lol:

User avatar
Macadaynu
Posts: 263
Joined: Sun Mar 07, 2021 1:18 pm

Re: Disable / Hide Exterior Building

Post by Macadaynu »

BadLuckBurt wrote: Tue Jan 04, 2022 8:46 pm I'll see if I can learn anything about the sky. Other than that, things are looking bright.
Just letting you know I figured out the problem with the sky :D

It was to do with the Player Advanced game object masking it, so the sky was in fact working, you just couldn't see it in action.

I needed to change the Player camera's Rendering Path to 'Forward', and the Clear Flags to 'Depth Only', just in case that helps someone in future.

Tested and also works with Enhanced Sky, yay

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Disable / Hide Exterior Building

Post by BadLuckBurt »

Macadaynu wrote: Thu Jan 06, 2022 11:25 pm Just letting you know I figured out the problem with the sky :D

It was to do with the Player Advanced game object masking it, so the sky was in fact working, you just couldn't see it in action.

I needed to change the Player camera's Rendering Path to 'Forward', and the Clear Flags to 'Depth Only', just in case that helps someone in future.

Tested and also works with Enhanced Sky, yay
Nice find! I never would've thought to look there. It does make sense that DFU hides it, some interiors have holes to the void so you'd see the sky gradient instead of darkness through those holes. Thats a very small price to pay and we can always fix the most offending interior meshes
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
XJDHDR
Posts: 258
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: Disable / Hide Exterior Building

Post by XJDHDR »

I just wanted to throw in some different ideas, even though Macadaynu did make his cube occluder work in the end.

The reason this was needed was because the game combined the RMBs' models together and thus, can't disable individual buildings. But I started thinking: What if that option can be feasibly switched off during gameplay?

So I took this baseline from inside Daggerfall where I had 79 FPS:
Baseline.jpg
Baseline.jpg (98.12 KiB) Viewed 920 times
I then took another measurement from the same spot with "Combine RMB" disabled. FPS dropped to 60.
Combine RMB off.jpg
Combine RMB off.jpg (97.72 KiB) Viewed 920 times
I then kept that option disabled but also enabled Unity's Vulkan rendering path. This gave me back around 6 FPS at the same spot (which was honestly disappointing). Unfortunately, the DX12 rendering path dropped FPS further to around 42.

Finally, I tried switching back to DX11 and simulating the effects of Occlusion Culling by disabling most of the buildings that I couldn't see. This increased FPS to 92:
Combine RMB off + Culling.jpg
Combine RMB off + Culling.jpg (95.96 KiB) Viewed 920 times
Perhaps some sort of OC could be implemented in DFU, not necessarily for this mod. Unfortunately, Unity's built-in OC won't work because it requires scene data that needs to be baked in at build time. I did manage the find this project which implements OC using shaders. Maybe something like that could be added.

What are your thoughts?

Post Reply