Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Texture sampler
- var textureSamplerDsc = new SamplerDescription()
- {
- Filter = D3D11Filter.Anisotropic,
- AddressU = TextureAddressMode.Wrap,
- AddressV = TextureAddressMode.Wrap,
- AddressW = TextureAddressMode.Wrap
- };
- var textureSampler = SamplerState.FromDescription(device, textureSamplerDsc);
- context.PixelShader.SetSampler(textureSampler, 0);
- // Load texture
- var texture = Texture2D.FromFile(device, "texture.jpg");
- var resourceView = new ShaderResourceView(device, texture);
- // Pass it to graphic pipeline
- context.PixelShader.SetShaderResource(resourceView, 0);
- device.ImmediateContext.PixelShader.SetShaderResource(resourceView, 0);
Add Comment
Please, Sign In to add comment