[MOD] Transparent Windows

Show off your mod creations or just a work in progress.
Post Reply
User avatar
PRAEst76
Posts: 27
Joined: Fri May 27, 2022 7:19 pm
Location: Suomi
Contact:

Re: [MOD] Transparent Windows

Post by PRAEst76 »

Macadaynu wrote: Mon Oct 17, 2022 4:26 pm The problem is a lot of buildings have differing layouts between interiors and exteriors for this to be viable. There is a project underway that is looking to overhaul the interiors of houses to match the exteriors, but it would take a long time to complete due to the sheer amount of buildings that need to be altered. If that project were ever to be finished then this kind of thing would certainly be possible.
I've been working on the overhaul with the possibility of viewing the buildings from outside in mind, however I never planned to do taverns or shops. That's another huge mod for someone to pick up as many of them have poor or no interior window placement.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Transparent Windows

Post by DunnyOfPenwick »

Macadaynu,

My recent Tempered Interiors mod is incompatible with the Transparent Windows mod due to the disabling of combined models (dfUnity.Option_CombineRMB = false).

I scanned your code and I think it can be made to work with or without combined models.

For SetupExterior() and SetupInterior(), instead of grabbing the Combined model you could call a function that returns an array/list of one or more models (a single combined model or multiple non-combined) and iterate.

For the ApplyClipBox() method, it looks like you are only interested in the Bounds of the interior.
A function like the following should give you the equivalent interior building bounds:

Code: Select all

        public static Bounds GetCombinedModelBounds()
        {
            var models = GameManager.Instance.InteriorParent.GetComponentsInChildren<Transform>()
                    .Where(c => c.gameObject.name == "Models").FirstOrDefault();

            Bounds combined = new Bounds();

            for (int i = 0; i < models.childCount; ++i)
            {
                GameObject model = models.GetChild(i).gameObject;
                Bounds bounds = model.GetComponent<MeshRenderer>().bounds;
                if (combined.size == Vector3.zero)
                    combined = new Bounds(bounds.center, bounds.size);
                else
                    combined.Encapsulate(bounds);
            }

            return combined;
        }

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

Re: [MOD] Transparent Windows

Post by Macadaynu »

DunnyOfPenwick wrote: Wed Oct 19, 2022 6:52 pm Macadaynu,

My recent Tempered Interiors mod is incompatible with the Transparent Windows mod due to the disabling of combined models (dfUnity.Option_CombineRMB = false).

I scanned your code and I think it can be made to work with or without combined models.

For SetupExterior() and SetupInterior(), instead of grabbing the Combined model you could call a function that returns an array/list of one or more models (a single combined model or multiple non-combined) and iterate.

For the ApplyClipBox() method, it looks like you are only interested in the Bounds of the interior.
A function like the following should give you the equivalent interior building bounds:

Code: Select all

        public static Bounds GetCombinedModelBounds()
        {
            var models = GameManager.Instance.InteriorParent.GetComponentsInChildren<Transform>()
                    .Where(c => c.gameObject.name == "Models").FirstOrDefault();

            Bounds combined = new Bounds();

            for (int i = 0; i < models.childCount; ++i)
            {
                GameObject model = models.GetChild(i).gameObject;
                Bounds bounds = model.GetComponent<MeshRenderer>().bounds;
                if (combined.size == Vector3.zero)
                    combined = new Bounds(bounds.center, bounds.size);
                else
                    combined.Encapsulate(bounds);
            }

            return combined;
        }
Ok, I don't have much free time right now but I can take a look whenever I return to modding.

Out of interest, can I ask why you need to disable the combined models? I've not used your mod so not sure how it works.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: [MOD] Transparent Windows

Post by DunnyOfPenwick »

Certain models may get deleted or shifted around depending on building quality.
Carpets, banners, paintings, organs, etc.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Transparent Windows

Post by Daniel87 »

Image

Is this a known bug? (black sky, no skybox - showing the echo of foreground images when moving the camera).
I installed the WorldData files as well (which I assume are there to fix this?) but am still having this issue in Sentinels Taverns and Temples when looking out the windows. Not sure if I am doing something wrong, my loadout causes this problem or if it is a bug of the mod itself.

Additionally I wanted to ask if its normal that the interior of shops is completely bright as if there was no light-bake. The lamp light is added to this, but basically there is no shadow at all inside ships, basements of buildings, normal buildings, etc.
In dungeons the lighting seems to work correctly though.
In Julianos we Trust.

User avatar
King of Worms
Posts: 4747
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [MOD] Transparent Windows

Post by King of Worms »

Hi, its not a bug per se, these windows are just a holes in a wall. But I agree it should look better...
About the light - make sure that in the game options > Video > "Simplify interior lights" is not turned on.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: [MOD] Transparent Windows

Post by Daniel87 »

No, I thin you misunderstood me. The problem is not the wall/window texture but the sky outside. It is black (but it is daytime outside, I think there is a problem between the dynamic skies mod and the transparent window texture mod. I installed the patch to make both of them work together but I still have this problem.
In Julianos we Trust.

User avatar
King of Worms
Posts: 4747
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [MOD] Transparent Windows

Post by King of Worms »

Oh I see, thought it was night :D
Sry no idea, I dont use this mod, in my experience, it produced immersion breaking bugs - some interior walls at certain time of a day were too bright etc

Post Reply