Aller au contenu

Photo

Model Oddities


  • Veuillez vous connecter pour répondre
65 réponses à ce sujet

#1
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
While other development is in progress on Arms and Armor and I'm waiting to hear back from my alpha testers, I've been working on trying to get some of the new models into the game. I've run into a few oddities I wanted to run by everyone:

Mesh Orientation

Ok, this one has me bewildered. I have four meshes in the game so far. And if I were to export the mesh back into a format I can load into a 3D app, EVERY ONE OF THEM will have a different orientation. They all appear correctly in-game, but if I load them all into Blender, Milkshape or AC3D, each one is going to end up rotated differently.

Has anyone found ANY sort of rhyme or reason as to which direction the meshes should be pointing?! So far it appears to be completely arbitrary, even though every mesh starts off pointed the same direction. My modeling procedure is:

1) Modeled as AC format in AC3D 
2) Export a final mesh as a Wavefront OBJ
3) Convert to FBX using Autodesk's FBX converter
4) Convert to MMH and MSH files using Taz's FBX utility
5) Import the MSH into Blender to reset the smoothing groups and Export again

Invariably, I end up having to load the OBJ into Milkshape to rotate it again.

This is rather time consuming, because getting the mesh rotated correctly ends up being an exercise of trial and error. It's frustrating enough with weapons that are mirrored. I don't want to even THINK about how much of a pain it's going to be once I get into weapons that are asymetrical....

Spec Maps

Spec Maps are once again a bit of trial and error to get the proper look--shiny, but not that irritating mirror-finish you see on a lot of really cheap swords. More of a satin finish--although I'm more or less getting along fairly well (well, at least on simple ones. The new Cousland Family Sword mesh has a fairly complex hilt with varying degrees of specularity that takes some time and effort to get right).

However in the case of one sword, the pommel and blade end up lit differently than the guard. I don't have an in-game image of the lighting, but here's what the mesh looks like:

Posted Image

As you can seel, the pommel, guard and blade are all relatively flat along the same plane. I would THINK that all three would therefore react the same under the lightsource. However in-game the blade and pommel are ALWAYS lit the same, while the guard is ALWAYS either brighter or darker. Not only would a real not respond to lighting in this way, but it just doesn't look as good in the game.  I've double-checked the Spec Map and the three components are all set to the same specularity.

Any thoughts on either of these issues?

#2
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
#1 your model pipeline is very convoluted. There are so many places where rotation could be changed that its not gonna be easy to fix it. Why not just do all your modeling in blender? There really is no excuse not to since its free.



#2 Different smoothing groups will always look differently. If you use the same smoothing group on the pommel and blade, they will look the same while the guard will not.

#3
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
1) I find Blender very awkward and unintuitive to use for many features (heck, just rotating my view has proven to be a pain). Milkshape is easier and I've used it before, however I've only JUST recovered my license key, so it wasn't an option until recently. I may go ahead and start modeling just in MS from now on, unfortunately there's the issue with MS not being able to export directly to the MSH file, so since Taz's utility doesn't directly convert from OBJ or 3DS and doesn't retain smoothing groups I'm sort of stuck with several of these steps. Is anyone working on export plug-ins for Milkshape?



2) Odd thing is, the pommel and blade DON'T share smoothing groups. In fact to reproduce the way light would react to the blade, I've been using separate smoothing groups for the different features (Left Edge, Right Edge, Left Side of Fuller, Right Side of Fuller, with separate Top and Bottom sets of each). The effect comes across PERFECTLY, too, when I compare it to one of my real swords.

#4
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
This should better illustrate what I'm seeing:

Posted Image

Three of the new meshes, all taken from the same camera angle under the same light source (I just switched out the equipped weapon and left the perspective the same).

The REALLY important comparison is between the first and second swords. BOTH of these have blades and hilts that are more or less overall the same grayish color (possibly some minor variation in the exact shades used). Although the mesh have obvious differences, both swords were constructed in pretty much the same way. Even though different smoothing groups were used on the pommel and guard components of swords 2 and 3, note that there's still a generally consistancy in the color under lighting.

Something is completely changing the colors of the pommel and blade of the first sword. Both of those SHOULD be the same color as the guard, yet in this image, both are golden in color. The second sword is also overall grayish-silver, but its blade comes out much more of a light blue than the hilt (I REALLY want it to be identical to the hilt! That color is almost perfect).

Something VERY bizzare is happening. The blades are coming back as a MUCH lighter color on all three swords than what I've specified in both the diffuse and spec maps, the first sword's hilt colors are being completely changed, and you CAN see on the third sword that the pommel is somewhat lighter in coloration than the guard and bands around the grip. The latter isn't a significant difference, but it is there.

Modifié par Ambaryerno, 01 mai 2010 - 04:58 .


#5
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Is your texture fully greyscale (not light blue or green)? I know some engines colour their specular with a coloured spec map. Also, post your mao, this isn't a smoothing issue, its a material issue.



I can guarantee that you haven't actually tried to use blender for more than 10 mins. Its different, obviously, but its not harder or more awkward for most if not all of what you are gonna be doing and it would completely solve your first problem problem.

#6
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
The first two swords have a spec map that are tinted VERY slightly blue for the blade and hilt. In fact the first sword is using a much darker spec that is nearly gray. I'll try converting to grayscale and see what happens.

This is the MAO from all three swords:

<?xml version="1.0" encoding="UTF-8"?>
<MaterialObject
Name="***">
<Material
Name="Weapon.mat"/>
<DefaultSemantic
Name="Blend"/>
<Texture Name="mml_tDiffuse"
ResName="***"/>
<Texture Name="mml_tNormalMap"
ResName="***"/>
<Texture Name="mml_tSpecularMask"
ResName="***"/>
<Vector4f Name="mml_vFalloffParams"
value="0.00 1.00 1.30 1.27"></Vector4f>
<Float
Name="mml_fSpecularReflectionMult" value="0.54"></Float>

</MaterialObject>

Replace the "***" with the respective weapon's texture name. This was copied from one of the tutorials I found.

Modifié par Ambaryerno, 01 mai 2010 - 05:40 .


#7
tmp7704

tmp7704
  • Members
  • 11 156 messages

Ambaryerno wrote...

Has anyone found ANY sort of rhyme or reason as to which direction the meshes should be pointing?! So far it appears to be completely arbitrary, even though every mesh starts off pointed the same direction.

I've imported a number of weapon .msh files which come with the game; they all seem to be arranged with the tip of blade pointing towards -Z axis, with handle towards +Z. Sides of the blade are facing X axis, and blade edges are facing Y axis.  The +Z/-Z thing may be specific to import into Lightwave since it uses flipped coordinate system compared to game's own (meaning you might need to have tip pointing towards +Z instead) but the rest appears true for all sword and dagger models at least.

#8
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
I THINK I found the problem. When I opened this sword in the Material Editor, its bounding box was rotated 90 degrees from the mesh itself. I'm hoping if I get that fixed, it takes care of the rest.

But OMFG this sword is CURSED! Everything I try to do with it it just gets screwed up even MORE. I try to re-export it with Taz's utils and it keeps losing track of the texture data and won't show correctly in the toolset. I try to fix it in Milkshape and the OBJ gets corrupted and keeps crashing. I import into Blender from the MSH file and it won't smooth when I tell it to.

I just tried re-exporting from scratch again and the bounding box is STILL rotated 90 degrees when exported fresh from Taz's converter. In addition, I have a second sword that the box is rotated 180 degrees. The two other completed swords both have boxes oriented correctly in regards to the mesh. WTF?

Modifié par Ambaryerno, 02 mai 2010 - 04:37 .


#9
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Ok, never mind. Fixing the mesh to match its bounding box had NO effect whatsoever with the lighting. The pommel and blade are still being turned DRASTICALLY different colors than the guard in the Material Editor.

#10
tmp7704

tmp7704
  • Members
  • 11 156 messages
Just curious, but why can't you just model your item in whatever program you find suitable, then save that as .obj or whatever. Then import any existing DA sword into Blender, replace the geometry with your .obj sword, set up the smoothing groups and export that as new model... skipping the whole convoluted business with the fbx conversion?

#11
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
There's not going to be enough models in the game to do that. Every weapon in the mod is getting a unique model, so you're not going to have five swords that point to the model for Longsword 1, etc.

#12
tmp7704

tmp7704
  • Members
  • 11 156 messages
I understand, that's why i said you'd export each of your items as a new model, not replacement for existing mesh. The import part would be simply to reuse existing .mmh data/structure, since it appears this is the part where things go awry for you due to overcomplicated creation process.

(i'm not sure if Blender exports the .mmh file actually. If it doesn't then it can be done yet another way, by making manual copy of existing .mmh and editing it with Toolset to point to your mesh and/or .mao files, still skipping the whole .fbx business)

Modifié par tmp7704, 02 mai 2010 - 01:03 .


#13
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
The latest version of the Blender tools can work with the MMH, but not reliably. There's also still a matter of they PHY file.

#14
tmp7704

tmp7704
  • Members
  • 11 156 messages
You can reuse .phy files of existing item just like the .mmh files. I'm not sure if they're even used by game where it comes to melee weapons, tbh.

#15
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Chewy,



I installed GMAX and tried using your export tools. I'm running into a couple problems however, and I don't see anything on them in the instructions:



When I tell it to Add Collision Parameters it gives: -- Unknown property: "Obj" in undefined



When I go to export the MMH and MSH files it gives an error about no file name being specified. However I don't see anywhere in the export TO specify the file names. In addition, the Save Path field doesn't appear to actually do anything. It says it successfully exported, but where does it actually PUT them?!

#16
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
The GMax version of the script uses the Listener window, as GMax can't export files (that's why it's free - it's a cut down version of Max v4). You have to copy the contents of the Listener window and save it as an XML. You can do it manually, or get one of the Listener grabber apps floating around.

#17
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
I HATE this @$%&ing sword!!!!!



After using GMAX to export rather than putting it through several converters like I was before, not only is the lighting STILL hosed up as in the original version, but now it's not even centering on its origin. Instead it appears floating about 5 feet over the character's head in the Inventory panel, even though it's centered correctly in GMAX.



I swear to god this sword is frelling CURSED.

#18
Eshme

Eshme
  • Members
  • 756 messages
If you feel like it, you can upload so others can troubleshoot ? And give tips?



I have alot of troubleshooting behind me with writing the gmax importer.

#19
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Well, I finally got the sword turned the right way around, so now I'm just back to my original problem of the lighting being all wonky.



I'm going to try setting my smoothing groups using GMAX and see if maybe it's something Blender is doing. If that still doesn't work, I'll put up the files to be looked at. Hopefully if a fix can be found for one, it can be applied to them all.

#20
tmp7704

tmp7704
  • Members
  • 11 156 messages
I doubt smoothing groups are responsible for this kind of colour change, smoothing might account for change in brightness of texture but not really the hue.

If possible, check what happens with your swords if they are given completely blank (black) specular texture, i.e. when they are effectively textured just with the diffuse texture. Also, see if your tint mask texture is fully black in both cases, it's possible one of your swords (or both) are affected by the tint from sword in-game material in some way.

Modifié par tmp7704, 03 mai 2010 - 03:38 .


#21
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Blender IS doing something. I used GMAX to set my smoothing groups and exported it, and everything came back exactly as it should have. However when I then imported the MSH into Blender and modified one of the groups, (Blender correctly recognized the smoothing groups I'd set so Taz's converter DID retain the originals set by GMAX) the color change returned.



Now maybe it's not necessarily the smoothing groups THEMSELVES doing it, but something else in Blender.



Also, as an FYI, none of my weapons are being set up to utilize the material tints.

#22
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Incidentally, here's how it looks if I just use the GMAX converter:

http://social.biowar...t_media_id=4182Posted Image

The colors are just about right here, minus a few tweaks on the grip, and the spec is a bit shinier than what I want, but MUCH better than when I re-run through Blender to set the smoothing groups.

Upon further investigation, it appears that GMAX applies smoothing to the entire mesh as one big group. It's hard to tell here, but as a result it treats the blade like one flat surface, rather than the more complex geometry it ACTUALLY possesses, and keeps the light source from acting as it should.

Modifié par Ambaryerno, 06 mai 2010 - 02:16 .


#23
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
In GMAX (and 3dsmax), smoothing just changes the normals for vertices. I don't know what blender does, but it might be different and thus cause the problem. Also, smoothing tends to reduce complexity by eliminating shading lines. Try exporting without smoothing groups, then progressively add them back to see if its the blade specific one or another one causing the issue there.

#24
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Ok, just tried it. I cleared all smoothing groups in GMAX and exported first to the XML, then converted with Taz's tool. I checked the model in-game and the collors were correct.

I then imported into Blender. The model appeared as all-smoothed. I set one of the eight smoothing groups on the blade (I'm setting it as left edge, right edge, left fuller, right fuller, mirrored top and bottom. This causes the light source to interact more realistically with the blade) and exported back to the MSH.

Although I only changed ONE smoothing group on the blade, it caused the same color change under lighting as before. It definitely looks like Blender is doing SOMETHING, as one would think that if it were the smoothing group itself, it would have ONLY changed it for the group I just added.

I have to head to work now, so I'm going to attempt an import/export through Blender WITHOUT changing the smoothing groups at all later to see if it does the same thing.

Modifié par Ambaryerno, 06 mai 2010 - 12:47 .


#25
tmp7704

tmp7704
  • Members
  • 11 156 messages
Out of curiosity, could you upload that .msh exported from Blender to somewhere? I'd import it and have a look, to maybe see what exactly is happening there.