I was just making the fix I described in part 3 when I stumbled across something in the shader.
As I explained I had determined that the texture cords were (0,0) and so I wanted to change then to be inside the yellow arrow. The first time I did it I just placed the following adjustment into the vertex shader after
Out.TexBase = In.Tex;
Out.TexBase = float2(0,0);
#if defined(VT_VERTEXCOL) && defined(SHD_BASE) && defined(SHD_PRELIT) && defined(SHD_DOUBLE_SIDED)
// PROG TAXI
Out.TexBase = float2(0.5f, 0.5f + In.vPosition.y/5.0f);
When I came to prepare a release I decided to tidy it all up and merge with the lines above. To my surprise the fix keep failing. I had naturally assumed that since the drawcall had a texture that the shader it used would have been compiled with options that would lead to VS_INPUT_CONTAINS_TEXTURECOORD being TRUE. I eventually realised that it wasn’t true – which meant that the texture coordinates being passed to the pixel shader were being set to (0,0) in the vertex shader.
Now the input parameters for a shader compiled with VT_VERTEXCOL clearly include texture coordinates as input
float4 vPosition : POSITION;
float4 vNormal : NORMAL;
float4 cColor : COLOR;
float2 Tex : TEXCOORD;
Which opened up a new possibility – that the texture coordinates were valid after all but a simple shader bug was setting them to zero… and indeed that is the case
So here is the latest version of DX10 progressive taxi – its now 100% identical to DX9