I'm using MakeHuman and Blender for modelling, and I'm using Ogre to display my model. There is nothing wrong with the way I load into Ogre (make an entity from the .mesh file).
Most Recent Update:
I have solved the issues mentioned below with my model's eyelashes, hair, and eyebrows. I must keep all materials separate instead of combining the textures into one if I want the "further" pixels to show through the closer transparent ones. However, I am still having one issue.
Now that I am using separate materials for different parts of my mesh, my model's eyes are white or black (AGAIN) depending on the type of
scene_blend I choose in the eye material's pass or the texture unit's
I have figured out WHY it is doing this - there is a transparent layer being drawn over the eyes as white (or black) which is supposed to represent the cornea - but I don't know how to fix it.
I know I can unwrap the UV for the mesh before joining them in blender and correct it that way, but I'd have to do this for every model I make using MakeHuman. Besides, the eyes were showing up just fine when I was using the combined texture I made (look below at picture).
I'm assuming since the eyes showed fine before, there has to be a way for the blending to show them correctly. However, I have tried many
Does anybody else know what might be different with the material this time, causing the transparent part of the texture to do this?
--End Updated Question--
Here's what I have done so far:
- Create model in MakeHuman (v1.1.0) and export as .mhx2
- Import model in Blender (2.7) with defaults. It shows up as many meshes - each with their own material, UV map, and texture. I didn't want a bunch of materials and meshes when I export it - I just want one .mesh file for Ogre, so
- I used Gimp to combine all the textures into one, side by side. I then moved each mesh's UV map to correspond to the correct location on the new texture.
- Just to be sure this worked, I linked every material to the same texture (the newly created one) and rendered. This worked fine.
- I joined all of the meshes into one to get one spread out UV map (before doing it this way I got an overlapped one, which is why I followed this procedure this time). This gave me multiple materials for the one mesh, and each material was linked to the same texture. The only differences between the different materials are their levels of ambience etc.
- I tried using each material for rendering(and deleting all the rest), and though some are more reflective than others, they look basically the same on rendering.
So at this point, I came to the conclusion that any material should work just fine. However, when I export to a .mesh, .material, and .skeleton file and load it into Ogre, the hair has gray streaks in the front and the eyes and eyebrows are gray. This happens no matter which material I keep and which ones I delete.
I don't know what could possibly be the problem, but all I can think is that it might be related to the way the different meshes were UV mapped.
Additional info that might help:
I also tried baking to auto-generate my texture for me. I actually tried this before just combining the textures in Gimp. When I created a new material and used texture baking(with or without UV unwrapping of different kinds), the same thing happened in Blender - the gray eyes etc but the rest rendered correctly. The weird thing is, when I made a texture using Full Render baking, the eyes actually showed up in render in Blender and in Ogre for that material. The only problem is, I can't get the right even lighting to bake. Even with a constant light source, the part of the eyes covered by eyelids (and other covered pieces) came out black on the texture.
I tried exporting a larger MakeHuman model (using inches instead of decimeters for units) and following the same steps. I now see the eyes' texture...perhaps the model was too small? the eyelashes, hair, and eyebrows show as partly gray still, and I think the problem is that in the separate materials, the eyelashes, hair and eyebrows were "invisible" materials (not sure how) and since I changed to a material that isn't, I get a gray background. I will now try messing with the settings of my material.
I've figured out that there are some material settings associated with Ogre that came with the Ogre exporter (ioDotScene), I had just needed to check the box to get the options (which now show up in the Options panel at the bottom of the materials tab). Now, my problem is this: I am able to export my model using alpha_blending for the scene blending, but it doesn't work. If I set the alpha to 0, my person is invisible, and with the alpha set to 1, the texture isn't see-through at all where I need it to be.
I think the reason alpha_blending won't work for me is that I can't get away with turning "depth write" off. When I do, I get a mesh that's all inside-out (I can see my person's internal mouth textures and don't see the hair or eyes).
The ONLY thing that remotely solves my problem is opening the .material file and manually entering
alpha_rejection greater 64 under the line that says
Though it works, there are some problems with that solution:
- I don't know that the same alpha number will work every time I export a model with transparency,
- I don't even know how to begin to edit the export script after giving it a once-over, and
alpha_rejectiondoesn't solve it perfectly the way I would like it to, and when I'm close to the model's eyes I can still see a little bit of gray.