Reflection/Bump maps in Morrowind

Post » Fri May 27, 2011 6:56 am

Sure I'll try. This was my train of thought and experimentation that led to me my beliefs.
Morrowind and Freedom Force use the same graphics engine. Nif 4.0.0.2. Freedom Force supported gloss maps. That was, the ability to make a flat looking texture simulate reflection. So that polished leather might 'shine' without having to texture it to look like shine. (with standard art techniques used by good artists everywhere).

I was confident Morrowind also used gloss maps. The hated plastic wrap of enchantment, looked exactly like a Freedom force gloss map gone wrong. The usual mistake is to misname the gloss map texture, which controls which parts of the mesh reflect. With no texture, you get 100% reflection everywhere. The engine substitutes a simple fully white map. No mapping at all.

I looked for the gloss map for enchantment (to go with the caustxx files) but there wasn't one.
I examined the executable in a hex editor, trying to see if the simple map was created on the fly. No dice.
I made the slight configuration changes to Morrowind Nifs (in Nifskope - texture paths must be changed) required to view them in the Freedom Force Nif viewer and created light nodes, NiTextureEffect nodes and textures, and gloss maps and textures, as if Almalexia was an FF model. It worked! She glossed where I wanted her to!

Converted back to Morrowind. No dice. She glossed everywhere. No map. I wanted her clothes to shine but not her skin.

Came to the conclusion that Morrowind was NOT honoring the gloss map. That is throwing it away unused. The 'texture count is 2' messages I got with my Almexia made sense. It was finding my gloss map and throwing it away.
This is why people think a skinned mesh cannot have a gloss map.

I asked for the behavior to be traced and optionally disabled, which is now possible in the superb code patch.

Hope that explains a bit. Ask if that raises more questions than answers. Googling for freedom force and reflection and maps usually gets tutorials that explain how they are used. Remember, both games are different but use the same graphics engine, down to the version number.

So prior to the codepatch, it WAS impossible to use a gloss map in any meaningful way. Now it can be.
My Almalexia now has matte skin but glossy metal clothes!

Final edit: I will try to release some demonstrations to showcase the technique, but real life is tough at present. I resigned from my job on Thursday - a drastic step but I needed to for my sanity! (grin)
User avatar
Nathan Hunter
 
Posts: 3464
Joined: Sun Apr 29, 2007 9:58 am

Post » Fri May 27, 2011 2:27 am

Final edit: I will try to release some demonstrations to showcase the technique, but real life is tough at present. I resigned from my job on Thursday - a drastic step but I needed to for my sanity! (grin)

Sorry to hear that and hope you'll soon find a better job! (I know, doesnt help much to say that...) Don't worry about gloss mapped clothes for now, we will still be around when you have the time to experiment with them. What you posted is already very interesting. I think I understand what you mean, I'm just wondering why the method we are currently using to assign bump and gloss maps to creatures doesn't work with clothing meshes (as far as I know?). Couldnt it mean that maybe gloss and bump maps are simply disabled on clothes by morrowind unless they are enchanted? But I'm just guessing here (and as you know I'm not exactly an expert ^_^). And what doesnt make a lot of sense with this theory is that non skinned clothes can use gloss and bump maps without any problem (again, as far as I know)...
Anyways. Good luck with your real life situation!
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Fri May 27, 2011 7:57 am

I kind of made a breakthrough myself. Can I request a basic model which is using up to 4 textures on itself, or whatever the max number can be used on one mesh? Make them simple but distinguishable please. I can't promise anything, but I sense wonders ahead. :o

PS. And I might break old effects to introduce new effects. I don't think anybody would complain if I turn reflective bump maps into real bump maps though. :P
PPS. I'm more interested in textures in this stage.
PPPS. Maybe I can get dark maps to behave like bump maps. But I should do some tests to see if my exploit is real. A very simple mesh with all texture slots full is enough.
User avatar
Alessandra Botham
 
Posts: 3440
Joined: Mon Nov 13, 2006 6:27 pm

Post » Fri May 27, 2011 8:21 am

I kind of made a breakthrough myself. Can I request a basic model which is using up to 4 textures on itself, or whatever the max number can be used on one mesh? Make them simple but distinguishable please. I can't promise anything, but I sense wonders ahead. :o

PS. And I might break old effects to introduce new effects. I don't think anybody would complain if I turn reflective bump maps into real bump maps though. :P
PPS. I'm more interested in textures in this stage.
PPPS. Maybe I can get dark maps to behave like bump maps. But I should do some tests to see if my exploit is real. A very simple mesh with all texture slots full is enough.



Hello! Are there any news?
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Thu May 26, 2011 8:52 pm

Kind of busy, learning. Actually, still waiting for a test mesh. (A sphere or box with EMBM(reflective bump maps) on and a second mesh with all available texture slots full). I will find on my own then.

The method is the same with the methods of OldOblivion, but instead let's call it NewMorrowind. :P

Once again I am trying something waaaaaaaaaaay over my skills... :P I hope it works.

First question is:
How to re-compile, decompiled ps_1_1 shaders?

I think I will need lots of help. I will ask someone who can help.
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Fri May 27, 2011 8:24 am

Kind of busy, learning. Actually, still waiting for a test mesh. (A sphere or box with EMBM(reflective bump maps) on and a second mesh with all available texture slots full). I will find on my own then.

The method is the same with the methods of OldOblivion, but instead let's call it NewMorrowind. :P

Once again I am trying something waaaaaaaaaaay over my skills... :P I hope it works.

First question is:
How to re-compile, decompiled ps_1_1 shaders?

I think I will need lots of help. I will ask someone who can help.


I'm working in 3ds max for a long time but know nothing about NIFs... So I'm not quite understand what kind of model do you need... If you explain me it won't be hard to make it. The possibility of having normal mapping is the greatest step forward in improving Morrowind graphics!!!
User avatar
Ebony Lawson
 
Posts: 3504
Joined: Fri Feb 16, 2007 11:00 am

Post » Fri May 27, 2011 2:50 am

I'm working in 3ds max for a long time but know nothing about NIFs... So I'm not quite understand what kind of model do you need... If you explain me it won't be hard to make it. The possibility of having normal mapping is the greatest step forward in improving Morrowind graphics!!!

I think you would need nifskope skills to create the mesh I am looking for. But that's OK. I can use one of the rare mods with reflective bump mapping. But it would have been good to have a simple sphere or box mesh with EMBM(reflective bump mapping) activated.

Right now, what I need to find is how to recompile ps1_1 shaders.
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Thu May 26, 2011 10:25 pm

I think you would need nifskope skills to create the mesh I am looking for. But that's OK. I can use one of the rare mods with reflective bump mapping. But it would have been good to have a simple sphere or box mesh with EMBM(reflective bump mapping) activated.

Right now, what I need to find is how to recompile ps1_1 shaders.


Try one of PainKillers coin models, it is as simple as it gets. :goodjob:
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Fri May 27, 2011 5:02 am

Update:
I have good news and bad news.

Good news:
It worked.

Bad news:
It worked only for water.

I tried painkiller's mods, but they don't seem to be affected like water.

There are only 8 shaders, and all of them seems to be affecting water.

I don't know what can be achieved from this discovery. But at least we know there is shader support. Maybe further investigation can reveal more things. I will investigate more. I don't want to believe game is doing EMBM for water in shaders, but EMBM for armors, somewhere else in engine.

I can use alternate bump map methods, maybe painkiller's methods are not activating EMBM.
User avatar
Marion Geneste
 
Posts: 3566
Joined: Fri Mar 30, 2007 9:21 pm

Post » Fri May 27, 2011 7:35 am

Update:
I have good news and bad news.

Good news:
It worked.

Bad news:
It worked only for water.

I tried painkiller's mods, but they don't seem to be affected like water.

There are only 8 shaders, and all of them seems to be affecting water.

I don't know what can be achieved from this discovery. But at least we know there is shader support. Maybe further investigation can reveal more things. I will investigate more. I don't want to believe game is doing EMBM for water in shaders, but EMBM for armors, somewhere else in engine.

I can use alternate bump map methods, maybe painkiller's methods are not activating EMBM.

MW initial pixel shaded water is based on a Nvidia shader demo waaay back, it's likely it has little if anything to do with the .nif format. Which is probably why water is separate from any .NIF. (this theory can also be reversed and still proved working) if say you try to make .nif's using MW's pixel shaded water(I recall some tests done with this but nothing came of it).

There is also references all over the .exe that refers to the bumpmapping shader applying to the water so I'm pretty sure your right about your deduction.

Applying it is pretty far fetched, I'm still waiting for normalmap wonders to fall into the lap of us modders =)
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Thu May 26, 2011 11:17 pm

This is most likely the best thread about this topic that looks like something major may happen from it. I hope people post here with all new discoveries so we can all learn and share in how this can come to life. Please, lets not stop trying or posting about this.
User avatar
Shirley BEltran
 
Posts: 3450
Joined: Wed Jul 26, 2006 4:14 pm

Post » Thu May 26, 2011 10:23 pm

Hey vtastek, NIF bumpmaps all go through the fixed-function DX7 era pipeline, as an EMBM. The fixed-function pipe is incompatible with modern shader interfaces. Water is rendered separately with shaders. I hope you've had fun experimenting though.

You aren't going to see standard normal maps in Morrowind. As an exercise, if you research how normal mapping works you should be able to understand why. Check with me for answers. This doesn't exclude the possibility of hacks to approximate normal mapping with what we have; I do expect serious caveats.
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Thu May 26, 2011 10:05 pm

Hey vtastek, NIF bumpmaps all go through the fixed-function DX7 era pipeline, as an EMBM. The fixed-function pipe is incompatible with modern shader interfaces. Water is rendered separately with shaders. I hope you've had fun experimenting though.

You aren't going to see standard normal maps in Morrowind. As an exercise, if you research how normal mapping works you should be able to understand why. Check with me for answers. This doesn't exclude the possibility of hacks to approximate normal mapping with what we have; I do expect serious caveats.

It was fun, I got excited for one second there. I learned lots of things, but it was weary too. Just to find psa.exe, I downloaded whole 2006 DX SDK. I love how it works as mod installing though, I just placed the files and Morrowind loaded them as it loads other mod files.

When someone mentions fixed function pipeline, I imagine something like this:
http://www.knowledgerush.com/wiki_image/b/b7/Alaska_Pipeline.jpg

I assume, you tell hardware "do EMBM" and it does. I think fixed function pipelines are not used or advised not to be used anymore. Because it doesn't let you tweaking.

I think there must be some way to include GFX card 'as in shaders' to the equation. I had some test files from darknut, when I tested them in game, it caused a serious FPS hit.

I am learning and searching, I am excited to see what you have in mind.
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Thu May 26, 2011 11:59 pm

When someone mentions fixed function pipeline, I imagine something like this:
http://www.knowledgerush.com/wiki_image/b/b7/Alaska_Pipeline.jpg

That's a decent image. The fixed function pipeline on your GPU does a particular job in a particular way and never changes (unless attacked by polar bears).
It's fast, as the hardware is dedicated to that rendering setup, but inflexible.

I assume, you tell hardware "do EMBM" and it does. I think fixed function pipelines are not used or advised not to be used anymore. Because it doesn't let you tweaking.

Basically you do. I don't remember the exact function, but with DX8, you turn EMBM on and let it go.
And actually, using the fixed function vertex pipeline still generally works. If you want a vertex shader, obviously not, but for regular meshes it isn't a problem. Pixel shaders are far more powerful IMO.


To get normal maps working on MW, I think MGE is definitely the easiest path. If the lighting code can be cached without crashes and supplied to shaders properly, that last obstacle will be void. Unfortunately my VC won't compile MGE without breaking distant land and a few other things.
To approximate normal maps in MW without MGE might be possible, my only worry would be loading extra textures or re-interpreting the shader input/output to allow for normal mapping.
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Previous

Return to III - Morrowind