Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 17th, 2018 59 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. // Texture sampler
  2. var textureSamplerDsc = new SamplerDescription()
  3. {
  4.     Filter = D3D11Filter.Anisotropic,
  5.     AddressU = TextureAddressMode.Wrap,
  6.     AddressV = TextureAddressMode.Wrap,
  7.     AddressW = TextureAddressMode.Wrap
  8. };
  9.  
  10. var textureSampler = SamplerState.FromDescription(device, textureSamplerDsc);
  11. context.PixelShader.SetSampler(textureSampler, 0);
  12.  
  13. // Load texture
  14. var texture = Texture2D.FromFile(device, "texture.jpg");
  15. var resourceView = new ShaderResourceView(device, texture);
  16.  
  17. // Pass it to graphic pipeline
  18. context.PixelShader.SetShaderResource(resourceView, 0);
  19. device.ImmediateContext.PixelShader.SetShaderResource(resourceView, 0);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top