Comments (14)
Oh, D3DCOLOR and SHORT4N, these are apparently the mysterious 4 byte and 8 byte fields I saw. :)
from xoreos.
Okay, I moved this information into our wiki here: https://wiki.xoreos.org/index.php?title=Jade_Empire/Research#Vertex_layout :)
I can also give you an account for the wiki, if you want to add more stuff yourself.
Can you find out in what order these fields are? There should be one fixed order, even if not all might be present everywhere.
from xoreos.
Yeah, I'll have a look a bit later today.
from xoreos.
There will be some delays.
Have got master built and running, but getting:
ERROR: No such archive file "chitin.key"!
I vaguely remember this issue, but no idea what the fix was...
from xoreos.
Errm, that's bad; that really shouldn't happen... :/
The file is there? The file permissions are okay?
If you could trace that issue, that would be great. Because that's kinda a catastrophic issue right there...
from xoreos.
Hmm, or do you have the file and/or directory symlinked? Or a subpath of that?
from xoreos.
Here is what I've got so far...
The block:
ctx.mdl->skip(8); // Unknown
uint32 offNormals = ctx.mdl->readUint32LE();
ctx.mdl->skip(4); // Unknown
uint32 offUV[4];
offUV[0] = ctx.mdl->readUint32LE();
offUV[1] = ctx.mdl->readUint32LE();
offUV[2] = ctx.mdl->readUint32LE();
offUV[3] = ctx.mdl->readUint32LE();
ctx.mdl->skip(20); // Unknown
is very probably:
ctx.mdl->skip(4); // Unknown
uint32 offAttribs[12] = ctx.mdl->readUint32LE(12);
The vertex attribute offsets offAttribs[12] look like this (as seen in players.mod):
0, 12, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0
0, 12, ~0, 16, ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0
0, 12, ~0, 20, ~0, ~0, ~0, ~0, ~0, ~0, ~0, 16
Which suggests the following vertex layouts:
16 = 12 + 4 + 0 + 0
24 = 12 + 4 + 0 + 8
28 = 12 + 4 + 4 + 8
40 = 12 + 4 + 0 + 0 + 24
52 = 12 + 4 + 4 + 8 + 24
The first 12 bytes are the position.
Then we have two times 4 bytes that are unknown, color?
Those are followed by 8 bytes texcoords.
The 24 bytes are probably 3 tangent space vecs. They are not in the offsets array, probably not supported by mdl file format as such.
The second 4 byte block is often 0 0 0 0
The "tangent space" block doesn't look like normalized vecs though, not sure what is going on there:
values 0-3 look ok
values 4-7 are often all zero???
values 8-11 are often close to zero
I think it will require a closer look at the shaders, to see what they are doing with those attributes.
from xoreos.
Hmm, very interesting, thanks! :)
from xoreos.
The second attribute (at offset 12) is not a color
http://i.imgur.com/iBGGwbW.jpg
from xoreos.
Huh, okay. Well, I have no clue what it could be, at this point.
Thanks looking into this, though :)
from xoreos.
I hope it is ok, if I keep spamming this issue :)
Assuming two 16bit values (ushort) we get this:
http://i.imgur.com/TQzYDmy.jpg
http://i.imgur.com/R3AmvAC.jpg
http://i.imgur.com/C0zX4oG.jpg
http://i.imgur.com/e9wrarD.jpg
And with a 32 bit value (uint):
http://i.imgur.com/GKMVu1z.jpg
http://i.imgur.com/Xnj5tYU.jpg
http://i.imgur.com/tkNBBIa.jpg
Looks like some kind of shading parameter (luminance factor / baked lighting)?
from xoreos.
I hope it is ok, if I keep spamming this issue :)
Very much so, thanks! While I'm currently focusing on something else, this is extremely useful for the future. :)
Looks like some kind of shading parameter
Hmm, possible, yes.
from xoreos.
The "last attribute" at offset 16 has often the value (4 bytes decimal): 0 0 128 63
Or 1.0 if interpreted as a float. The value is always <= 1.0 from what I've seen so far.
from xoreos.
Here is how it looks like:
http://i.imgur.com/ecSFcAI.jpg
http://i.imgur.com/6bAYn3f.jpg
Looks like another shading / material parameter.
from xoreos.
Related Issues (20)
- NWN: Use-after-free when dismissing legal fade quad too quickly
- Pathfinding issues in KotOR HOT 1
- Star Wars: The Old Republic MMORPG HOT 3
- BUILD: Can't find SDL.h in VS2017 HOT 7
- Not enabling XML causes errors in xml.cpp HOT 4
- BUILD: Automake Travis does not fail if unit tests fail HOT 2
- Boost link error, undefined icu reference HOT 6
- KOTOR: Target indicator is too high
- NWN: Error starting the engine when using the Steam version HOT 4
- BUILD: OpenGL not found on FreeBSD HOT 5
- Feature: update GFF fields for DA2 HOT 1
- KOTOR: Crash on New Game, hiding HUD parts HOT 12
- SONIC: Probe finds NDS file, but game instance fails indexing it HOT 2
- AURORA: Dragon Age II PS3 mesh format
- [macOS] Building on Arm / M1 / Apple Silicon requires extra cmake argument HOT 19
- Request: List of required files for each supported game HOT 2
- KOTOR: macOS: Mac App Store version of KotoR HOT 4
- KOTOR2: macOS: Mac App Store version of KotoR2 HOT 8
- GRAPHICS: RenderQueue compareDepth invalid comparison
- GRAPHICS: glm::mat4() does not produce identity matrix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xoreos.