OpenKeeper icon indicating copy to clipboard operation
OpenKeeper copied to clipboard

Figure out the material flags

Open tonihele opened this issue 10 years ago • 7 comments

Figure out the material flags. KMF material has some interesting information about the material applying, however we don't understand it. Might not be an easy task.

/edit by ufdada: See Material.java

Value Description/Guess
UNKNOWN2(0x0002) Some sort of shininess
UNKNOWN4(0x0008)
UNKNOWN5(0x0010)
UNKNOWN6(0x0020)
UNKNOWN7(0x0040)
UNKNOWN8(0x0080) Some sort of glow
UNKNOWN9(0x0100) Environment mapped, invisible guys have this

tonihele avatar May 23 '15 07:05 tonihele

How about this: modify original kmf's, try out different bit combinations and run dk2 to see what the difference.

codenamecpp avatar Aug 11 '15 19:08 codenamecpp

That is probably doable. But would require repacking the WAD archive. I'm not sure if we are able to pull that off. Especially if the archive is compressed.

tonihele avatar Aug 11 '15 20:08 tonihele

I've found interesting note here : http://keeper.lubiki.pl/html/dk2_tools_extrct.php (DK2 Official WAD Tool): "... It is possible to have DK2 load the files individually rather than from the WAD files by using the command line switches '-enablefilepatching' and '-enableartpatching'." Although I have not tested this feature.

codenamecpp avatar Aug 11 '15 20:08 codenamecpp

Then it would be doable. We don't have the specific byte locations in the code, but it should be easy enough to follow the structure to find the material flags. And we do have the possible values already, although marked as unknown.

tonihele avatar Aug 12 '15 10:08 tonihele

No need to repackage the WAD files. If the game folder contains the unpacked files, the game takes them

ArchDemons avatar Aug 12 '15 15:08 ArchDemons

As @belgianguy made the list of flags, we can (for some) quite easily compare what the flags do to the material. We just need some shader knowledge, I'll doubt the JMEs Lightning material can replicate the effects :) We can try and/or modernize effects also.

Main menu light beams is a good playground for example.

tonihele avatar Apr 13 '17 22:04 tonihele

Maybe somebody could try the DirectX PIX tool to see if we can find out anything?

https://www.youtube.com/watch?v=dNwAq_2rvJ0 https://www.youtube.com/watch?v=-3PISvNTeB0

PIX seems to be too new, perhaps we'll have more luck with: http://graphics.stanford.edu/~mdfisher/D3D9Interceptor.html https://github.com/apitrace/apitrace

I'm on Linux, sadly, so I'm unable to.

belgianguy avatar Apr 14 '17 16:04 belgianguy