[solved(hair part)]Hair-Transparency with TGA-Alpha Mask

Khorram

25-06-2007 16:38:24

Hi!

I have tried everything I found in the forum. But none of them solved my problem. I am trying to get some nice hair. With a smooth aphlablending.
A two-sided material exported from oFusion / 3D Max 8.

Please take a look at the screenshot. I don't know why it casts a shadow. I did not activate any shadow-casting.

http://khorram.lima-city.de/transparency.jpg

I hope somebody knows how to solve this problem.

Thanks for help :wink:

Lioric

25-06-2007 16:47:34

Do you mean you have not set any shadow casting technique or that do you dont have any shadow casting on the object (but a shadow technique is enabledin the scene)?

From the pictures it seems the alpha blend is working, is the alpha blend part of your issues?

Khorram

25-06-2007 16:56:31

Thanks for that fast reaction :!:

The light in the scene has no shadowcasting and shadow-technique is "none".
I need a smooth alphablending considering the alphamap.
I can change the Alpha rejection value to control the alpha-blended area, but I need to blend only the mask. and that should be as smooth as possible.
The edges are too sharp. :?

It seems that the alpha-map is not 100% correct and somehow iterpulated.

Lioric

25-06-2007 19:19:01

Probably you have a depth issues in your scene, are the hair layers a single object?

Using alpha maps with the correct blend mode should produce the smooth alpha blend you need

Are you using your latest video drivers?

Khorram

26-06-2007 10:21:44

The woman is a single object with 3 materials(eyes/hair/body).

The video driver is the latest. I tested the exported scene with a GeForoce 8800 GTS.

Do you now the Chroma-Key in Adobe Pemiere? The Alphablend here has the same effect. The parts which should be masked just "melt" away like ice or something.

Khorram

26-06-2007 14:41:49

NEWS!

I found out, that the shadow-like black something below the hair is not shadow. it is the nonlighted backside of the Materail(two-sided).

http://khorram.lima-city.de/transparency.jpg (same shot as before)

If I turn off two-sided, I have holes in her hair from some views...
I will experiment more and hope!

kevinlan

27-06-2007 08:41:48

About this issue. Can I force the drawing order of object to avoid depth issues in scene like layers of human hair?

Lioric

27-06-2007 16:33:47

Do you mean the drawing order between passes of a single object or between objects?

Khorram

27-06-2007 17:04:10

drawing order between polygons from the same object -> back to front rendering

kevinlan

28-06-2007 04:50:34

Do you mean the drawing order between passes of a single object or between objects?

I mean the drawing order between objects.
For example , We've built sky dome with multiple layer in previous project with other 3d engine. It should forcing drawing order form outer layer to inner layer, to avoid all scene alpha sorting fail (camera place in the inside of the models). It's very similar with transparent object's of human hair but drawing order from inner to outer. We have the request to control drawing order since we are making UI in our project with many planes using 3dsmax.

Khorram

09-07-2007 11:40:39

I solved the Problem with the black edges around the alpha-maped-area.
http://khorram.lima-city.de/transparency.jpg <- same as above

The modeller had modelled the front side of the hair with 2 sides with welded vertixes instedt of settig culling to none.

Our shader programmer coded something in the material and it worked fine.
So the problem was housemade by our modeller!

Here is his code, I hope it would held you somehow!


material null_10Mtl/Standard_1
{
receive_shadows off
technique
{
pass
{
alpha_rejection greater_equal 128
cull_hardware none
cull_software none
depth_write on
depth_func less
colour_write off

texture_unit
{
texture_alias 0
texture Hair.tga
tex_address_mode clamp
}
}

pass
{
ambient 0.5 0.5 0.5 1
specular 0 0 0 1 5
cull_hardware none
cull_software none
depth_write off
depth_func equal

texture_unit
{
texture_alias 0
texture Hair.tga
tex_address_mode clamp
}
}

pass
{
ambient 0.5 0.5 0.5 0
specular 0 0 0 1 5
cull_hardware clockwise
cull_software none
depth_write off
depth_func less_equal
scene_blend alpha_blend

texture_unit
{
texture_alias 0
texture Hair.tga
tex_address_mode clamp
}
}

pass
{
ambient 0.5 0.5 0.5 0
specular 0 0 0 1 5
cull_hardware anticlockwise
cull_software none
depth_write on
depth_func less_equal
scene_blend alpha_blend

texture_unit
{
texture_alias 0
texture Hair.tga
tex_address_mode clamp
}
}

}


}


I'll check this post as solved, thanks for helping :D

Lioric

09-07-2007 16:49:09

Good job :) (this will go in the wiki section)

When you use cull set to none to render from either side, the same polys are rendered (no new gemetry is created), thus the object uses the same normals (for the light), and the side where the normals points to will produce different lighting results