If someone has any hint for me
Code: Select all
vs2ps Out;
for( uint i = 0;i < 4; i++ )
{
PosO = PosO + MyPos[i];
}
//transform position
Out.Pos = mul(PosO, tWVP);
//transform texturecoordinates
Out.TexCd = TexCd;
return Out;
}
Moderator: Support
Code: Select all
vs2ps Out;
for( uint i = 0;i < 4; i++ )
{
PosO = PosO + MyPos[i];
}
//transform position
Out.Pos = mul(PosO, tWVP);
//transform texturecoordinates
Out.TexCd = TexCd;
return Out;
}
Code: Select all
vs2ps VS(
float4 PosO : POSITION,
float2 TexCd : TEXCOORD0)
{
//declare output struct
vs2ps Out;
for( int i = 0;i < 2; i++ )
{
PosO = PosO + MyPos[i];
//transform position
Out.Pos = mul(PosO, tWVP);
//transform texturecoordinates
Out.TexCd = TexCd;
return Out;
}
I imagined : if I use an already declared object like a ventuz rectangle (4 vertices + indices + uv), when i'll spread it the vertex shader will re-use those indices for each new object (the way to connect the vertices is the same for every object)Sure, doing that all the time. Check out some of the Glare plugins in the Store