Hmm, interesting. Is it one light per slot though? How does that work,as 1024 is the number of lights, but you say there are only 5 slots.
I only added 8 slots to save on memory. If a quick way (say using a std::map) is found to manage all the lights, that will be possible. I didn't know how many Morrowind used, so for the test DLL I added 8 pre-allocated spaces.
So with this we could possibly support things like ambient occlusion? If so, whoo!
Ambient occlusion has more to do with depth than lighting. If the depth buffer is found (something apparently no one can do), then things are possible (I'm still searching, but given that it's made on the video card, not in system memory, it's extremely hard to read).
you said you could try to do this just yesterday, you sure are good!
if this works it's going to change morrowind graphic as musch as distant land did
This isn't as major of a breakthrough as it may appear. The code is already mostly there (the sun position and color are already intercepted). I don't know why whoever added that didn't do regular lights. There may be some issue I haven't run into yet.
Wait wait wait, do I have this straight, you may have found a way for mge to intercept morrowinds lighting calls, that could allow for mge to possibly overide those calls with more realistic lighting? Or even allow it to display paralax/bump mapping oppropriately based on light position ect...........this may make Open Morrowind obsolete if the possibilities that I'm thinking of are actually....possible. Peachy, you should just rename yourself to astonishing morrowind breakthrough provider, and start charging for your services(kind of like a cable provider, only with dish like channel options).
MGE can intercept all light calls to DirectX, yes. It may be possible to improve lighting, I'm not sure.
It can certainly supply position and color data to shaders and scripts, which
should allow parallax and bump mapping to a limited extent.
The maps would still have to be on the texture, hence vertex shaders and hooked textures loading. Unless a universal texture is applied, say as the base for all texture, and MGE gives it texture info.
Example:
- Morrowind loads model
- Model has texture tA.dds
- MGE loads fx_parallax.fx (shader) and gives it the texture variables:
- - baseTexture = "tA.dds"
- - mapTexture = "tA_n.dds"
It would slow the game down quite a bit, I think, but if a shader (similar to a UT3 material) is loaded and that shader performs all texturing, as well as bump/normal mapping, then all texture effects that are possible on the GPU would be possible, at the cost of speed. Simply using the vertex shader to texture objects shouldn't be too hard on performance, and only applying this technique to ones that need special effects (parallax, specular, bump, halo, motion blur, refraction, reflection, etc) would certainly speed things up.
The only possible downside is ENB incompatibility. However, I think many people may be willing to trade a bit of bloom for essentially unlimited graphical effects.
Now, before people start getting to excited (this'll save your pants here):
This is only debug info from the beginning of testing. The entire thing may not work, say if Morrowind internally handles lighting. It is likely that lights can be supplied to shaders, but I make no promises or guarantees.
I can tell you, if this is all possible, it'll cost. Probably in memory and framerate. The more effects, the slower it will go.
And I cannot, for the life of me, use Subversion, so I haven't any clue how I'll spread any improvements I may make.
I may just branch the code. PKGE. It has a nice ring to it.