ReflectionBump maps in Morrowind

Post » Wed Jun 19, 2013 8:24 pm

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
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Thu Jun 20, 2013 11:21 am

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 /happy.gif' class='bbc_emoticon' alt='^_^' />). 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
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Thu Jun 20, 2013 6:08 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. /ohmy.gif' class='bbc_emoticon' alt=':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. /tongue.gif' class='bbc_emoticon' alt=':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
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Thu Jun 20, 2013 7:51 am



Hello! Are there any news?
User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am

Post » Thu Jun 20, 2013 12:04 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. /tongue.gif' class='bbc_emoticon' alt=':P' />

Once again I am trying something waaaaaaaaaaay over my skills... /tongue.gif' class='bbc_emoticon' alt=':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
Ernesto Salinas
 
Posts: 3399
Joined: Sat Nov 03, 2007 2:19 pm

Post » Thu Jun 20, 2013 7:41 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!!!
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Thu Jun 20, 2013 8:47 am

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
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Thu Jun 20, 2013 10:07 am


Try one of PainKillers coin models, it is as simple as it gets. /fing34.gif' class='bbc_emoticon' alt=':goodjob:' />
User avatar
marie breen
 
Posts: 3388
Joined: Thu Aug 03, 2006 4:50 am

Post » Thu Jun 20, 2013 9:34 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
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Wed Jun 19, 2013 10:40 pm

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
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm

Post » Thu Jun 20, 2013 10:09 am

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
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Thu Jun 20, 2013 12:53 am

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
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm

Post » Thu Jun 20, 2013 2:36 am

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
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Thu Jun 20, 2013 7:51 am

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.

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
Nicole Mark
 
Posts: 3384
Joined: Wed Apr 25, 2007 7:33 pm

Post » Thu Jun 20, 2013 6:08 am

Bumping this to not get pruned.

User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am

Post » Thu Jun 20, 2013 3:37 am

I don't really like bumping old threads, I'd actually kind of like to see some of the annals of our forum recorded properly. Like they were once here: http://www.yacoby.net/es/forum/12/

User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Thu Jun 20, 2013 3:15 am

so you're volunteering? That's really nice of you Wolli :D

User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Thu Jun 20, 2013 5:58 am

Meh, sure.

User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Thu Jun 20, 2013 6:06 am

Better to give them life thru bumping than to let them disappear forever, especially when they have little nuggets of good info.

User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am

Post » Thu Jun 20, 2013 7:20 am

This is all obsolete. We got reflective bump maps and even per pixel lighting.
User avatar
lolli
 
Posts: 3485
Joined: Mon Jan 01, 2007 10:42 am

Previous

Return to III - Morrowind