Say I have a texture with 4 samples:
Texture2DMS<float, 4> GDepth;Texture2DMS<float4, 4> GNormal;
With custom resolves:
float4 light = float4(0, 0, 0, 0);for (int i = 0; i < 4; i++) { depth = GDepth.Load(texCoord, i); normal = GNormal.Load(texCoord, i); //... light += pointLight(position, normal, ...)}return light / 4;
At least that's the theory, I haven't tried it yet.
My question is, is it possible to make the sample amount dynamic?
I don't want to write different shaders for each level of sampling I want to offer.
I'd like to something like:
Texture2DMS<float, sampleCount> GDepth;Texture2DMS<float4, sampleCount> GNormal;//...float4 light = float4(0, 0, 0, 0);for (int i = 0; i < sampleCount; i++) { depth = GDepth.Load(texCoord, i); normal = GNormal.Load(texCoord, i); //... light += pointLight(position, normal, ...)}return light / sampleCount;
Is there a way to do this?
I don't see how I could pass a variable to my shader and use it as soon as in texture declaration.
Cheers,
Hyu