I'm in final step of writing an exporter but I'm still struggling with a couple of material issues. Look at the attached image. While the transparency for the hair renders correctly, the shadow projected on the left cheek of the subject is completely solid, there are no strands visible.
The material is defined as a mix with a grayscale jpeg providing the trans map. I have to use this configuration as my exporter takes a pre-existing model and exports it, I have no way of changing the original model and update the textures to support alpha channels. Here is the generated code
- Code: Select all
# Material "Hair_33.mat2"
Texture "Hair_33.mat2.Kd" "color" "imagemap" "string filename" ["SFH_LightBrown.jpg"] "string mapping" ["uv"] "string wrap" ["repeat"] "string filtertype" ["bilinear"] "float uscale" [1.0] "float vscale" [-1.0] "float gain" [1] "float gamma" [2.2]
Texture "Hair_33.mat2.Kd.scale" "color" "scale" "texture tex1" ["Hair_33.mat2.Kd"] "color tex2" [1.000 1.000 1.000]
MakeNamedMaterial "Hair_33.mat2" "string type" ["matte"] "texture Kd" ["Hair_33.mat2.Kd.scale"]
# Hair_33.mat1
MakeNamedMaterial "Hair_33.mat1" "string type" ["null"]
Texture "Hair_33.map" "float" "imagemap" "string filename" ["SFH_Trans.jpg"] "string mapping" ["uv"] "string wrap" ["repeat"] "string filtertype" ["bilinear"] "float uscale" [1.0] "float vscale" [-1.0] "float gain" [1] "float gamma" [2.2]
# Hair_33
MakeNamedMaterial "Hair_33" "string type" ["mix"]
"texture amount" ["Hair_33.map"] "string namedmaterial1" ["Hair_33.mat1"] "string namedmaterial2" ["Hair_33.mat2"]
Any suggestion on how to solve this issue will be greatly appreciated.
