Morph Target Setup - SetVertexBuffers

Hi! AlienScribble, the creator of 2D shader water ^_^y

I’m now wondering if there is even any way to set a vertex buffer to a stream. ie: VertexPositionNormalTexture to stream 2 would put them into POSITION2, NORMAL2, etc…

I think using vertices is slow when the morph change, changing the morph target on vertices will eats up CPU or otherwise if baked it per frame/morph will eats up Memory.

I haven’t test or try StructureBuffer, since I’m not yet into morphing, but I think in HLSL Directx 11 Shader Model 5 has a StructureBuffer that can be use as a look table works just like passing the texture to shader.

I think it can be use something like this :

struct VertexShaderInput
{
    float4 Position : POSITION0;
    float3 Normal   : NORMAL0;    
    float2 TexCoord : TEXCOORD0;    
};

//

structurBuffer<float3> MorpTargetPos  : register (t0)
structurBuffer<float3> MorpTargetNorm : register (t1)

// position.w can be use as  vertices index no.

float3 m_Pos  = lerp( input.Position,  MorpTargetPos[input.Position.w], frame_tween );
float3 m_Norm = lerp( input.Normal,   MorpTargetNorm[input.Position.w], frame_tween );

Hope you find a good solution on morphing ^_^Y