- Home /
Transparent bumped specular on hair
Hi,
I'm trying to accomplish a basic hair effect for my characters but I can't make it work properly with the transparent materials in Unity3D. I've got a tga file with the diffuse texture in the RGB channel and the transparency I want in the Alpha channel and a different file for the normal map. All of these work fine all together in a Transparent Bumped Diffuse but when I want to add the specular map I can't figure out where to put it. Transparent Bumped Specular seems to be the one done for this aim but it gets both specular and transparent from the same channel (alpha channel in diffuse texture). The Cutout version of it is not an option since the type of transparency I need is not B/W only.
Any idea how can I get this done with no quality lost?? Thanks a lot!!
Answer by Kuba · Feb 12, 2010 at 10:45 AM
Here is a forum thread where I have posted a shader that uses the alpha channel from the main texture to define transparency and a separate gloss map to define glossiness: Specular + Opacity uses the same Alpha map? How?
Answer by Ricardo · Feb 12, 2010 at 10:53 AM
Good news and bad news in a sinusoidal manner.
- The good news is that the Unify wiki has a Bumped Colored Specular.
- The bad news is that it doesn't consider transparency.
- The good news is that simple transparency is relatively easy to add.
- The bad news is that if your hair is a single object, you're likely to end up with hair that looks like it's made of glass.
- The good news is that you could have each strand of hair be an object and get it looking right.
- The bad news is that's insane. And slow.
- The good news is that there is a pretty good presentation from a few years ago over at the AMD site about how to build a hair shader to consider that case.
- The bad news is that I don't know enough about Cg to write such a shader.
- The good news is eventually I'll need to pay someone to write such a shader, and will probably end up releasing it, but of course would be happy if anyone gets the shader done before that.
(Thought it would be best to end up with a positive one)
Hopefully that'll save you a few trial and error cycles.
Thanks lot for your answers!! for the time being i'm using cutout transparency working a bit more on the texture and it looks ok but I will take a look and those materials asap and have a talk with the coder to see what he thinks about it.
i'll post further details if we find out something interesting.
thanks again!!