Area :: Header
Discover the Difference with
3ds Max 2015
Upgrade now and save
Discussion Groups

FBX Plug-ins Import-Export Discussions

Reply
Active Member
Eugeni
Posts: 10
Registered: ‎02-04-2009

Vertex Color not exported when Vertex Alpha is zero with FBX 2012.2

399 Views, 4 Replies
02-23-2012 07:55 PM
Hello.
I found that vertex color exported only when vertex alpha not equal zero. But before(when I used with 3DS MAX 2010 and FBX 2010) vertex color was presented even when vertex alpha is zero.

The process looks so:
1. Create a mesh in 3DS MAX 2012 SP1.
2. Coloring vertex color by using VertexPaint modifier.
3. Coloring vertex alpha by using VertexPaint modifier.
(I want to note, it is looks great with my shader in 3DS MAX viewport)
4. Export with FBX Plug-in 2012.2 to fbx file.
5. Render in XNA under my shader with input pre-vertex semantic “COLOR


struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
#ifdef _MAX_
float2 Tex : TEXCOORD0;
float4 Color : TEXCOORD1; //sampler number(Red - Rock, Green - Grass, Blue - Dirt)
float3 Alpha : TEXCOORD2; //sampler number(Alpha - Road)
#else
float2 Tex : TEXCOORD0;
float4 Color : COLOR0; //sampler number(Red - Rock, Green - Grass, Blue - Dirt, Alpha - Road)
#endif
float3 Tangent : TANGENT0;
float3 Binormal : BINORMAL0;
};


If vertex alpha is zero(was painted in black(0,0,0) color in 3DS MAX), then the vertex color painted black in XNA under my shader(although in 3DS MAX it was not painted in black), if vertex alpha was painted in white(255, 255, 255), then it is looks normal, all colors is present, but for multytexturing with four textures I need have vertex color even when vertex alpha of this vertex is zero. It was be possible in 3DS MAX 2010 with FBX Plug-in 2010.

Is it the feature, bug or I just miss some thing?

P.S.
If my question is unclear, just tell me, I'll try to rephrase.

Thanks.
Please use plain text.
Distinguished Contributor
CarlosC_1
Posts: 148
Registered: ‎09-07-2011

Re: Vertex Color not exported when Vertex Alpha is zero with FBX 2012.2

02-24-2012 12:36 PM in reply to: Eugeni
Hello Eugeni!

We've tried to duplicate your problem but have not been succesful. We were able to export our vertex colors regardless if the alpha was at 1 or at zero.

Could you please do a test where you use the same workflow but with a simple triangle, with 3 vertices it will be very easy to see the information. Export your test scene as an FBX in ASCII format at in a text editor look for the code that resembles the following:
LayerElementColor: 0 {
Version: 101
Name: ""
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "IndexToDirect"
Colors: *12 {
a: 0,0,1,0,0,1,0,0,1,1,1,0
}
ColorIndex: *3 {
a: 1,2,0
}


You'll notice that this " a: 0,0,1,0,0,1,0,0,1,1,1,0" indicates that our alphas were at zero but the colors were exported nonetheless.

Let us know what your results are. My tests were run with Max 2010 and Max 2012. On Monay, I wil run one with Max2012SP1 to see if there is a difference. If there is, then this will probably mean that the problem lies with Max, not FBX. But, we'll cross that bridge when we get there.

Regards,
Carlos.
Please use plain text.
Active Member
Eugeni
Posts: 10
Registered: ‎02-04-2009

Re: Vertex Color not exported when Vertex Alpha is zero with FBX 2012.2

02-24-2012 03:19 PM in reply to: Eugeni
Hi Carlos!
I did what you asked and looks like FBX and 3DS MAX is unguilty. The FBX file contains a vertex color even when alpha is zero.

Vertex number 3 in triangle with zero alpha:

LayerElementColor: 0 {
Version: 101
Name: ""
MappingInformationType: "ByPolygonVertex"
ReferenceInformationType: "IndexToDirect"
Colors: 1,1,1,1,0,0,1,1,1,1,1,0
ColorIndex: 2,0,1
}

It seems XNA 4.0 pleased us one more bug or maybe it's one more "nice" new limitation. Looks like I should go and struggle with XNA 4.0 FBX importer.

Anyway I know what should I do now. I'll post the reason here when I'll find it.
Thanks!
Please use plain text.
Active Member
Eugeni
Posts: 10
Registered: ‎02-04-2009

Re: Vertex Color not exported when Vertex Alpha is zero with FBX 2012.2

02-27-2012 08:03 AM in reply to: Eugeni
Please use plain text.
Distinguished Contributor
CarlosC_1
Posts: 148
Registered: ‎09-07-2011

Re: Vertex Color not exported when Vertex Alpha is zero with FBX 2012.2

02-27-2012 08:36 AM in reply to: Eugeni
Excellent, I am happy to see you found a solution, don't hesitate to contact us again if you have any questions.

Regards,
Carlos
Please use plain text.