KatsBits Community

Game Editing => 3D Modeling & Content Creation => Topic started by: boodrl on July 11, 2010, 02:36:07 PM

Title: [blender] Hair mesh too shiny
Post by: boodrl on July 11, 2010, 02:36:07 PM
Hello everyone,

Recently I've been using blender to edit and export a hair mesh that can be usable in another game. So far what I only do to the hair mesh is

1.)I import the mesh as a .obj file
2.)I scale, rotate and move the mesh file where I want it to go.
3.)Then I click on the "set smooth" button located in the "links and materials" tab. "Double sided" is also selected  in the mesh tab.
4.)Then I click on the "shading" button and  go to the "texture" tab I click add new. Then under the "Map input" tab I click on "UV"
5.) Then I click on the "texture" button and in the "Texture type" drop down list i select image. Then I load the texture I want on my mesh. The texture file is a .dds file.
6.) I click on the "editing" button and go back to the "Links and Materials" tab. I add a new vertex group, go into edit mode and select the hair mesh. I name the group BONE-0 and assign all the vertices to it.
7.) Then I select a .msh file and replace it with the new hair I've just edited.

For my mod to work I need a .mao file, .msh file, .mmh file and a .dds file. I put these files this into my override folder so I can view them in the game. The hair loads and the texture looks fine but the hair is too glossy and shiny.

Where did I go wrong? is this a problem related to the texture file or the mesh file? Does anyone know how I can fix this.
Title: Re: Hair mesh in blender
Post by: kat on July 11, 2010, 04:23:53 PM
This 'effect' is usually referred to as "Specular highlighting" and at a guess it's going to be one of two things;

1) If the exporter you're using is reading and interpreting Blender shaders then you need to play around with the "Spec" and "Hard" settings in the "Shaders" panel of the "Shading" buttons (F5); just reduce those values until you get something that approximates the look you need.

2) It's going to be a setting or value in the game itself. Depending on how they have their materials set up there should be a way to set the "Specular" value of the material applied to the models so you can reduce or increase the specular levels.

What game is this for? It helps if that is known, along with Blender version.
Title: Re: [blender] Hair mesh too shiny
Post by: pazur on July 11, 2010, 05:37:02 PM
Maybe post a screenshot too.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 12, 2010, 04:13:08 AM
I'm using blender 2.49.

<<kat>> Thank you for the advice I'll try it out. This is for Dragonage: origins
Here is a picture of my problem.
(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg46.imageshack.us%2Fimg46%2F8260%2Fissuee.png&hash=d00d451ea81b8e8358c134b5b660e9292a0f8d50)
Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 12, 2010, 05:04:55 AM
Ah right.. with that additional info (the game you're editing), your texture set is incomplete by the looks of things. I had a look through the Dragon Age toolset wiki (http://social.bioware.com/wiki/datoolset/index.php/Material_editor) and according to that it looks like you need a diffuse (the hair you've done), a normal map, and a specular map by default (http://social.bioware.com/wiki/datoolset/index.php/Material_editor#Specular). If you have one or more of those missing it'll cause rendering issues. So, I'm guessing that you've got that 'full' specular problem with the hair because the material settings for that object aren't complete - it can't find the DDS or TGA texture it needs.

I don't have any tutorials up yet on making simple specular maps but if you don't know what they are you can make one quickly and easily by just de-saturating your diffuse and making it into a gray-scale image; to do one properly you'd ideally need to take a bit of time with it to make sure your highlights are placed correctly.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 12, 2010, 01:30:51 PM
I created a diffuse, specular and normal map as well as added the alpha map as this tutorial has told me to do

http://social.bioware.com/1079/blog/4097/

I will edit my specular map and see if that makes a difference. Originally I made two layers for my specular map in gimp. first I would have a black background as my layer then the hair texture that was desaturated (with the levels altered a bit) would go on top of my background layer and I would merge the layers together. With the tips you've given me I'll change my black background layer.

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 12, 2010, 04:58:42 PM
Ah ok, looking at that, Dragon Age is pulling all the data it needs for the material from different colour channels in the texture ("R/G/B/A"), specular being the alpha-channel. Doing what it is, there's going to be an issue with your alpha - either its not there or there's some other problem with it, so check you do indeed have one - it should show up in whatever photoediting app you're using in the "Channels" panel.

I tested the process with CorelDraw and using the images from that link you posted managed to produce what looks like a correct image by splitting the channels into separate images using "Image >> Split Channels to >> RGB". I then dropped an actual normal map into the Red channel image, the Diffuse into the Green channel image and Alpha Mask into the Blue channel image. I then have to recombine the RGB channels back into a single image with "Image >> Combine Channels..." and then 'load' in the actual Alpha Channel image as a separate object over the top (from the "Mask" menu). Seems to work ok doing that.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 12, 2010, 08:50:33 PM
I checked my .dds file and you were right my alpha channel wasn't there. My red, blue and green channels had the normal, diffuse, and alpha map respectively. I use Gimp instead of coreldraw so I added a layer mask and pasted my specular map in then applied the layer mask. I'm still getting shiny glossy hair. Besides desaturating my diffuse layer like you said is there anything else I can do to the specular map?
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 12, 2010, 09:06:15 PM
So I made a new texture and everything worked out the hair is a bit shiny but a vast improvement to what it was. Here is an image of what it looks now. It's not the same mesh but it had the same problems and I was working on this one. It looks great and I couldn't have done it without you kat. Thank you so much for your help!

(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg28.imageshack.us%2Fimg28%2F6402%2Ffixedz.png&hash=19a11cce23600f57be4a911bd731ef4de07bfcaf)

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 12, 2010, 10:29:04 PM
Yeah, you'll need to play with the alpha channel mask but at least you know where the problem was happening now. Good Job.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 18, 2010, 12:47:33 AM
Hello again kat and fellow katsbits forum's community, I've mad another hairstyle but this texture has weird patches in it. Do you know what I can do to fix it?

(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg823.imageshack.us%2Fimg823%2F9435%2F68929034.png&hash=0948f5745f45dde3d7b3087e1ede7656e08b41e2)

Title: Re: [blender] Hair mesh too shiny
Post by: silicone_milk on July 18, 2010, 01:02:40 AM
Do those patches flicker while you move around or are they solid, non-changing patches that look like color stains on the texture?

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 18, 2010, 03:42:45 AM
In addition to silicone's comment, if you used DDS textures try using TGA's (or vice-versa if you can), that looks suspiciously like a compression artifact issue. Who would have thought hair would be so much trouble!
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 18, 2010, 03:54:22 AM
<<silicone_milk>> the patches are solid, non changing patches. They do look like color stains with square edges as the picture shows.

<<kat>> I will try TGA's but I believe this game only uses .dds files. However I'm not 100% sure about that. 
Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 18, 2010, 06:08:31 AM
According to the modWiki it should as there's references to both TGA and DDS in the material information (http://social.bioware.com/wiki/datoolset/index.php/Material_editor#Diffuse), you'll be able to test it to double check whilst you sort out this issue. If you can change format it'll be an easy way to initially test if it's compression issue (the problem will dissappear - unless the game utomatically converts TGA into properly formatted DDS files on import/use?) or something related to what silicone was quizzing you on (z-fight).
Title: Re: [blender] Hair mesh too shiny
Post by: silicone_milk on July 19, 2010, 12:33:03 AM
Yeah, I had thought it was z-fighting that I was looking at. I've never seen any extreme compression artifacts myself so that didn't even come to mind. Since they're not flickering it's not the z-buffer being upset with you so it's probably more than likely some funkadelic compression artifacts.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 24, 2010, 04:55:21 AM
I don't know if it is just coincidence or if this helps understanding the issue but I uploaded the image texture to the mesh in blender and then I selected render preview the same patches seemed to be an issue. Could this mean this is a blender issue?

This is the picture in the render preview. the textures were uploaded in blender
(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg85.imageshack.us%2Fimg85%2F7836%2F28393770.jpg&hash=03087ae38056678c4f19e2e63c0b57461f8bd602)

This is a picture with the texture and the mesh in dragonage.
(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg695.imageshack.us%2Fimg695%2F2789%2F71963873.png&hash=d6cd281ca809a217bff8c2ee372433482169a3f6)

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 24, 2010, 05:34:59 AM
That, I have to say, is very odd. Normally stuff like that just doesn't happen because all you're doing is effectively exporting a 'blank' mesh that has UVW map assigned. What appears to be different for Dragon Age specifically is the face-sorting (http://social.bioware.com/1079/blog/4093/)... that's actually the first time I've ever come across that for a game model by the way (and in Blender I might add), so I wonder if that's causing the issue somehow?

What I'd do to test this is try and 'reset' the sort order of the mesh (https://www.katsbits.com/tutorials/blender/scene-view-alpha-transparency.php#sortorder), re-export and see if the problem changes in some way. If it does then you know that's probably where the error is. If it doesn't then there's something else causing the issue.

Also.. I just noticed the the hair (mesh?) looks slightly 'faceted' so check your smooth groups, although that may be a direct result of the problem you're having.
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 24, 2010, 04:08:34 PM
kat you've done it again. Thank you for helping me understand this process. The advice about the .tga format was a big success and now I'm figuring out how to edit the face settings in blender.


there is already a great improvement
(https://www.katsbits.com/community/proxy.php?request=http%3A%2F%2Fimg716.imageshack.us%2Fimg716%2F3420%2F83998231.png&hash=7c1088f2d7bc9a6da9f4bf07b2a2e2f8eb19b941)

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 24, 2010, 05:19:17 PM
From reading the docs the hairs actual colouration comes from a separate 'tint' texture, is that right, in this case that's making the hair gold/blond, right?.

So where is the 'green' coming from? Is there, or are you standing in front of the green lightsource? Or have you got a green texture being used as part of the hair unit somewhere? If your character moves around in a scene, do those green spots move with the mesh or do they stay put?
Title: Re: [blender] Hair mesh too shiny
Post by: boodrl on July 26, 2010, 01:46:19 PM
The green spots move with the mesh.They stay on the same spot as the mesh and I don't have any green layers or channels in the texture file. I don't have a tint file because I believe that file is optional. I can also tell you that the green spots disappear as I am "face sorting" I'm having a little difficultly with the face sorting since this particular mesh as braids on the side.

Title: Re: [blender] Hair mesh too shiny
Post by: kat on July 26, 2010, 04:19:43 PM
Ah good, you're getting somewhere, at least you now know it's the face sorting that's causing the issue.