Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Import 3D Objects with multiple UVs

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
GlareTechnologies

Import 3D Objects with multiple UVs

Post by GlareTechnologies » 21 Aug 2012, 11:23

Hi,

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();
	}
}
Attachments
object3.dae.zip
It is an uncompressed file. Just remove .zip.
(5.8 KiB) Downloaded 419 times

Post Reply