# Strangeness when texturing a billboard in a vertex shader

This topic is 4123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, with the help from another member I offloaded some of my billboard code to the vertex shader. The strange thing happens when I texture the billboard. The billboard gets textured in a way that shouldn't be possible from my texcoords. Here is my vertex shader:
float4x4 g_transform;

float3 g_offsets[4];
float2 g_texCoords[] =  { (0.0f, 1.0f), (0.0f, 1.0f), (0.0f, 0.0f), (0.0f, 1.0f) };

struct VS_Output
{
float4 pos     : POSITION;
float4 diffuse : COLOR0;
float2 tex     : TEXCOORD0;
};

VS_Output vertexShader(float3 pos : Position, float4 color : Color0, float3 info : TexCoord0, float2 index : TexCoord1)
{
VS_Output output;

output.pos = mul(float4(pos + g_offsets[index.x] * info.x, 1.0f), g_transform);

output.diffuse = color;
output.tex = g_texCoords[index.x];

return output;
}

technique Billboard
{
pass P0
{
}
}


And here is a picture of the result. How can the whole texture be mapped with coordinates like this? Thanks for any help.

##### Share on other sites
Nobody has somehting to say to this?
I wonder how those texturecoordinates can produce such a result.
{ (0.0f, 1.0f), (0.0f, 1.0f), (0.0f, 0.0f), (0.0f, 1.0f) }

##### Share on other sites
I do not know the inner workings of your code, but those texcoords makes no sense to me. what are you trying to map?

are you sure you don't need the (0, 0) ( 1, 0 ) ( 1, 1 ) ( 0, 1 ) texcoords?