hi all,
I want to sample from texture array with vertex id. I can access them in VS but not in PS or GS. Do I have to pass the streams on manually each stage, or am I missing the correct shader base? I thougt streams would take care of that themselves.
Here is a stripped down version with everything stream related.
Everything works, except accessing VId and IId in PS
[Summary("")]
shader A_DrawFX : VS_PS_Base, ColorBase, ShaderUtils
{
stream float4 PosW : POSITION1;
stream float2 TexCd : TEXCOORD0;
stream uint VId : SV_VertexID;
stream uint IId : SV_InstanceID;
override stage void VSMain(){
uint vid = streams.VId;
uint iid = streams.IId;
streams.ShadingPosition = mul(p, World);
}
[maxvertexcount(4)]
void GSMain(point Input input[1], inout TriangleStream<Output> pointStream)
{
streams = input[0];
for(int i=0; i<4; i++)
{
streams.ShadingPosition = mul(float4(quadP, 1), ViewProjection);
streams.TexCd.xy = QuadUV[i];
pointStream.Append(streams);
}
pointStream.RestartStrip();
}
override stage void PSMain(){
//uint vid = streams.VId;
float2 uv = streams.TexCd;
streams.ColorTarget = glyphs.Sample(sLw, float3(uv, 0) ,0 );
}
};