Adding DREAM window emission texture

Discuss modding questions and implementation details.
User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Adding DREAM window emission texture

Post by King of Worms »

I think it works with DREAM because I forced it by adding the emission maps for that window. But since the base game doesnt fire up the orange background light, it appears white (the emission map is white and gets mixed with yellow when everything is working) - tested.

And this is also why the windows stay black without DREAM mod.

I agree that having it white doesnt look too bad, and its better than nothing for now.

User avatar
Seferoth
Posts: 665
Joined: Fri Nov 22, 2019 5:45 pm
Location: Finland

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by Seferoth »

I too agree that Mage's Guild windows that emit white light looks pretty cool.

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

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by King of Worms »

Seferoth wrote: Mon Dec 09, 2019 2:28 pm I too agree that Mage's Guild windows that emit white light looks pretty cool.
I was thinking about making all mages guild windows blue-ish. But I dont know what color I need to mix with yellow to get blue.
Plus I will wait if this specific window gets fixed.

User avatar
Seferoth
Posts: 665
Joined: Fri Nov 22, 2019 5:45 pm
Location: Finland

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by Seferoth »

King of Worms wrote: Mon Dec 09, 2019 6:03 pm
Seferoth wrote: Mon Dec 09, 2019 2:28 pm I too agree that Mage's Guild windows that emit white light looks pretty cool.
I was thinking about making all mages guild windows blue-ish. But I dont know what color I need to mix with yellow to get blue.
Plus I will wait if this specific window gets fixed.
White or blue, both are great. Makes Mage's Guilds look a bit more mysterious.

User avatar
DigitalMonk
Posts: 111
Joined: Sun Nov 10, 2019 8:01 pm

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by DigitalMonk »

King of Worms wrote: Mon Dec 09, 2019 6:03 pm
Seferoth wrote: Mon Dec 09, 2019 2:28 pm I too agree that Mage's Guild windows that emit white light looks pretty cool.
I was thinking about making all mages guild windows blue-ish. But I dont know what color I need to mix with yellow to get blue.
Plus I will wait if this specific window gets fixed.
Not sure how emission maps work in this setting. I think you'll need negative values, 'coz blue is across the color wheel from yellow. Was trying to think if additive vs multiplicative would matter, but not in the big scheme of things. Additive would require balancing values against the expected levels of yellow light to cancel it out, where multiplicative would be easier -- negative one would conceptually turn yellow into blue. Sort of. After re-normalization... (Without re-normalization, you'd technically have windows that were absorbing yellow out of the black, leaving infra-blue? Which would be incredibly eerie and magically delicious in the "real" world but probably just breaks the rendering pipeline for us...)

All assuming RGB color space. Never tried color mixing in HSV/HSL or YUV spaces...

OK, quick scan at Unity (which may be invalid, if the versions don't match what DFU uses, but as a starting point):
https://docs.unity3d.com/Manual/Standar ... ssion.html
Leads me to two thoughts:
  • If color is controlled completely by the emission map, as in the computer terminal examples, then no mixing is involved, so they could be any color (I like the idea of using the predominant color of the associated Daedra on summoning days :lol: )
  • If the OBJECT (building) has emission turned on and the TEXTURE (window) is filtering that, then the object should always use white as its emission color so that the texture can mix down from there to whatever makes sense.
Pardon my babbling. The thought of infra-blue mage windows excited me :D

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

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by King of Worms »

Haha well I think it works simply on mixing. So at night the base texture changes to yellow. You lay a emissive texture over it. If that texture is white u get yellow as a end result, just a bit brighter.

So if I want a blue as a result, I need to know a color, which when mixed with yellow produces blue.

Yellow + x = blue
And I need to know the "x"

User avatar
DigitalMonk
Posts: 111
Joined: Sun Nov 10, 2019 8:01 pm

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by DigitalMonk »

King of Worms wrote: Mon Dec 09, 2019 10:17 pm Haha well I think it works simply on mixing. So at night the base texture changes to yellow. You lay a emissive texture over it. If that texture is white u get yellow as a end result, just a bit brighter.

So if I want a blue as a result, I need to know a color, which when mixed with yellow produces blue.

Yellow + x = blue
And I need to know the "x"
If yellow + white mixes to "somewhat brighter white", then it sounds like it's averaging the two colors, an additive process. If that math is correct, then you can't get there from here. Yellow is red+green with no blue, and blue is just blue with no red or green. If you average those, you get 50% gray. That's why I think the texture's emission should really be allowed to provide the entire emission color, not just be part of the mixture.

As a sort of solution, the best I can give you is that if you use full intensity cyan (0% red, 100% green, 100% blue), the result of mixing with yellow will be a pastel green (50% red, 100% green, 50% blue). Not what you wanted, but green lights are still kinda weird.

Full details and workups of additive color mixing of light for people who are into that sort of thing:
For anyone reading who thinks of adding colors of paint, the process of adding colors of light is a bit different. Instead of red, blue, and yellow paint (which really should be magenta, cyan, and yellow pigment, as you see in color laser toner cartridges), the primaries of light are red, green, and blue. For our example colors, it helps to know that yellow is red+green in even amounts (for pure yellow -- an orangish yellow will have more red in it). So the actual equations you want to solve, including the averaging process, are a little more involved -- not really, there's just three of them.

Let's look at the yellow+white example (I hope this table layout at least sort of works -- gotta use some kind of character other than space to provide horizontal spacing):
.................yellow...........white.........average
red............100%.............100%.............100%
green.......100%............100%..............100%
blue..............0%.............100%...............50%

So you end up with a brighter, but desaturated yellow. Which intuitively makes sense.

Let's try with yellow+blue:
.................yellow...........blue.........average
red...........100%..................0%...............50%
green.....100%...................0%...............50%
blue............0%...............100%...............50%

The best strange color I can come up with, if yellow is locked down, is a pastel green:
.................yellow...........cyan.........average
red...........100%...................0%...............50%
green.....100%...............100%.............100%
blue............0%...............100%...............50%

Or, if you used magenta, you'd get a pastel red, but that doesn't really stand out much...

User avatar
DigitalMonk
Posts: 111
Joined: Sun Nov 10, 2019 8:01 pm

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by DigitalMonk »

DigitalMonk wrote: Mon Dec 09, 2019 10:50 pm As a sort of solution, the best I can give you is that if you use full intensity cyan (0% red, 100% green, 100% blue), the result of mixing with yellow will be a pastel green (50% red, 100% green, 50% blue). Not what you wanted, but green lights are still kinda weird.
For what it's worth, this is what color you'd get. Wish I could set the background, but this is the best I can do without inserting a picture... I think that might catch the wandering eye as you strolled through town at night...

This is the rather lame pink that you'd get if you used a magenta addition...

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

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by King of Worms »

Thats really interresting, thanks for that info.

I guess I will try that cyan and see how it looks. I think the point of this is to get some other color than standard yellow for a mages guild windows, and the experimentation will show what works and what doesnt.

But trying cyan would not come to my mind, so this is a great idea.

User avatar
Jay_H
Posts: 4072
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Dragonbreak #92 Win, x64 version, missing window emission texture

Post by Jay_H »

I'm going to split this off into a modding section, since the discussion doesn't deal with the mentioned bug per se ;)

Locked