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!

Q: Morphing via shader

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

Moderator: Support

Post Reply
mofo7777

Q: Morphing via shader

Post by mofo7777 » 24 Oct 2012, 17:53

Hello.

With SlimDx, i can use this declaration :

Code: Select all

private static readonly VertexElement[] morphElements = new VertexElement[]
		{
			// base from stream 0
			new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
			new VertexElement(0, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0),
			new VertexElement(0, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),

			// target1 from stream 1
			new VertexElement(1, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 1),
			new VertexElement(1, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 1),
			new VertexElement(1, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 1),

			// target2 from stream 2
			new VertexElement(2, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 2),
			new VertexElement(2, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 2),
			new VertexElement(2, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 2),

			// target3 from stream 3
			new VertexElement(3, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 3),
			new VertexElement(3, 12, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 3),
			new VertexElement(3, 24, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 3),
			
			VertexElement.VertexDeclarationEnd
		};
I've got 4 mesh (.X file) and i associate each with this :

Code: Select all

device.SetStreamSource(0, Mesh1.VertexBuffer, 0, Mesh1.NumberBytesPerVertex);
				device.SetStreamSource(1, Mesh2.VertexBuffer, 0, Mesh2.NumberBytesPerVertex);
				device.SetStreamSource(2, Mesh3.VertexBuffer, 0, Mesh3.NumberBytesPerVertex);
				device.SetStreamSource(3, Mesh4.VertexBuffer, 0, Mesh4.NumberBytesPerVertex);
And here is the Shader declaration :

Code: Select all

struct a2vMorph
{ 
	float4 position     : POSITION0;
	float3 normal	    : NORMAL0;
	float2 tex0         : TEXCOORD0;   
    
	float4 T1position   : POSITION1;
	float3 T1normal	    : NORMAL1; 
    
	float4 T2position   : POSITION2;
	float3 T2normal	    : NORMAL2; 
    
	float4 T3position   : POSITION3;
	float3 T3normal	    : NORMAL3;  
};
I want to do Morphing in Ventuz.

Is there a way to select stream source level in Ventuz, associate each level with a mesh and applie a shader on it ?

Thank you.

User avatar
Dierk Ohlerich
Posts: 74
Joined: 10 Jul 2012, 09:01
Location: Hamburg, Germany

Re: Q: Morphing via shader

Post by Dierk Ohlerich » 08 Oct 2013, 08:39

Unfortunately, Ventuz can't handle multiple vertex streams or other more complex vertex formats. :(
-- Dierk Ohlerich

Post Reply