i have tried to import .dae with 2 UV sets.
Somehow I only get the first UV coordinates in my HLSL Shader.
Attached to this post my (hand-made) collada file and the shader:
Is it generally possible to import 3d objects with multiple UVs ?
If yes, any idea whats wrong with my code or file ?
Cheers,
Bastian
Code: Select all
float4x4 WorldViewProjection : WORLDVIEWPROJECTION;
texture Texture0;
sampler Sampler0 : register (s[0]) = sampler_state
{
Texture = <Texture0>;
};
texture Texture1;
sampler Sampler1 : register (s[1]) = sampler_state
{
Texture = <Texture1>;
};
struct VS_INPUT
{
float4 Position : POSITION;
float2 UV0 : TEXCOORD0;
float2 UV1 : TEXCOORD1;
};
struct VS_OUTPUT
{
float4 Position : POSITION;
float2 UV0 : TEXCOORD0;
float2 UV1 : TEXCOORD1;
};
VS_OUTPUT VS( VS_INPUT Input )
{
VS_OUTPUT Output;
Output.Position = mul(Input.Position, WorldViewProjection);
Output.UV0 = Input.UV0;
Output.UV1 = Input.UV1;
return Output;
}
float4 PS( VS_OUTPUT Input ) : COLOR
{
float4 c0 = tex2D(Sampler0, Input.UV0.xy);
float4 c1 = tex2D(Sampler1, Input.UV1.xy);
return c0+c1;
}
technique Tech1
{
pass pass0
{
vertexshader = compile vs_3_0 VS();
pixelshader = compile ps_3_0 PS();
}
}