![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
10-17-11, 11:30 PM
|
#11 |
|
Black Magic
![]() |
well the moment of truth arrived.....
Success I read and parsed the GR2 file without the granny2.dll (or any DLL for that matter) or any other outside file. Did it strictly from reading the file itself. The pointers tell you everything you need to know. I haven't coded in the materials or textures yet that's why it's wireframe only. Will work on that tomorrow ![]() Also have to code in reading the extended data for everything so one can edit/view it also. That'll probably be day after tomorrow. This extended data has stuff like jitter, blur, and some other stuff that I'm curious to play around with and see what it does in game ![]() The indicies threw me for a loop for many hours. The pointer kept telling me they started at x offset but no matter what I couldn't find them. I kept finding the wrong data. After hours of this it finally hit me that they are probably like the vertex data and located in a different section. Yep, that was the case ![]() There seems to be many different names that can be used for texture coordinates 0 and 1. If while using the app you load a model and it says unrecognized vertex component name please make a note of it and which GR2 model you were trying to view and send that information to me please. I currently have 2 defined for each. So section 0 contains all the arttool info, file info, bindings, extended data, and texture and map info. Section 1 contains the vertex data. Section 2 contains the indicies. Haven't figured out what the other sections do yet. Maybe with the coding of the textures, materials, and extended data they will make themselves known. I'm going to code in some 'debugger' type things into this. Things like being able to extract all the pointers and it tell you what they are, a file manifest that will include the offset address and physical address in the file of everything loaded by pointers, and some other ideas. This way one can see the information I used to make this possible. The granny viewer is an SDK of sorts. It tells you the file structure, it tells you the structure of items, and it even tells you the data type of the items. Using that and the pointers you can find/make anything. You'll occassionally stumble into something where you expected to be reading a pointer but you see a hard coded int value in the file. I've come across this when granny viewer shows an item with (x) where x denotes the number of them. You'll find that you read the number of the item first, then you read a pointer that points you to where the items are. The end of that pointer then will have x amount of that type in succession. There are some other little annoyances that took some time to figure out but can't think of them currently. The app is still using the fixed-function pipeline of DirectX for rendering. I'll convert it over to programmable pipeline (aka shaders) here soon. This will allow me to use the actual shaders of SH5 to do the rendering so we can see items just like in game (or near to it). I really can't wait to code in the animations part of this. I really want to see the keyframes of these GR2 files. Actually I'm just very curious to 'see' how they do it. ![]() http://www.gamefront.com/files/20899...itorViewer_zip Let me know if you encounter any errors using it. How to use: left mouse click + mousemovement rotates 3D model right mouse click + forward/backward of mouse moves in/out on 3D model center mouse click + mouse movement changes camera focus point Last edited by TheDarkWraith; 10-18-11 at 12:49 AM. |
|
|
| Thread Tools | |
| Display Modes | |
|
|
