I've been going through these tutorials (only 2 links allowed for me): https:// http://ift.tt/1LIr4ht
and reading through the Direct3D 11 Graphics Pipeline: http://ift.tt/1B0R2Ta
I currently have a Pixel (aka. Fragment) Shader coded in HLSL, consisting of the following code:
//Pixel Shader input.
struct psInput
{
float4 Position: SV_POSITION;
float4 Color: COLOR;
};
//Pixel (aka. Fragment) Shader.
float4 PS(psInput input): SV_TARGET
{
return input.Color;
}
What I (think I) would like to do is multisample and access nearby pixel data for each pixel in my Pixel Shader so that I can perform a sort of custom anti-aliasing like FXAA (http://ift.tt/1m1OZfb). From my understanding, I need to pass a texture to HLSL using PSSetShaderResources for each render, but beyond that I have no idea.
Being able to do this kind of thing would also be extremely beneficial to my understanding of how c++ and HLSL interact with each other beyond the standard "pass some float4's to the shader" that I find in tutorials. It seems that this is the most crucial aspect of D3D development, and yet I can't find very many examples of it online.
I've considered traditional MSAA (MultiSample Anti-Aliasing), but I can't find any information on how to do it successfully in D3D 11 beyond that I need to be using a "BitBlt" (bit-block transfer) model swap chain first. (See DXGI_SAMPLE_DESC1 and DXGI_SAMPLE_DESC; only a count of 1 and a quality of 0 (no AA) will result in things being drawn.) Additionally, I would like to know how to perform the above for general understanding in case I need it for other aspects of my project. Answers on how to perform MSAA in D3D 11 are welcome too though.
Please use D3D 11 and HLSL code only.
Thank you!
Aucun commentaire:
Enregistrer un commentaire