Hello everyone, I am currently teaching myself some graphics programming with HLSL, which my current knowledge has been learned almost exclusively from post processing mods like ENB, SweetFX, and ReShade.
Now for my question, is there a way to use custom filters in the sampler or bypass the sampler altogether/create a custom sampler?
As I understand it, textures are declared towards the beginning of a file, then the samplers are what make it so a pixel shader can read the texture.
Here is an example if my sentence above didn't make sense.
// My declared texture
texture texExample
{
width = 1920;
height = 1080;
};
// The sampler that makes it readable by a pixel shader
sampler samplerExample
{
Texture = texExample;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
// Then a pixel shader that uses the sampler to get the texture information
float4 ExamplePS(in float4 pos : SV_POSITION, in float2 texcoord : TEXCOORD0) : SV_Target
{
float4 example = tex2D(samplerExample, texcoord);
return example;
}
// Then the technique and stuff...
The reason I want to know this is so that I can play around with mipmapping which I don't fully understand yet either.