SamplerState in code or HLSL?

Started by
12 comments, last by KaiserJohan 9 years, 8 months ago

Since you're using a second vertex stream, the input layout should reflect that:


  inputDescription[1].InputSlot = 1;
  inputDescription[1].AlignedByteOffset = 0;
Such troubles are better analyzed with a graphics debugger where you can see if your texture upload succeeded and if your vertices are correct.

Thats it. Thanks.

The result is not as good as I hoped it to be, even with anisotropic filtering set to 16. Here's an example:

ansitropic.jpg

In the background you see its very blurry. Is there any way to get better visuals?

Advertisement

At the grazing angles the undersampling is going to be very extreme, and even 16 samples won't be enough. So you'll get either aliasing artifacts, or blurring due to the hardware using a lower-resolution mip level. You'll also get issues from the hardware using various approximations and "optimizations". Usually you can turn these off in the driver control panel. Typically they'll have some sort of "quality" slider that you can turn up to get better filtering results at the cost of additional performance.

MJP is right and also It looks great by the way! There's different sampler states you can also use if you want a texture rendered differently like point sampling amongst others. What are your settings for your device upon initialization? My sample count is 8 and sample quality is 32 getting the 8x MSAA and I'm hooking it where the player can change the settings inside the options menu.. However, your texture suppose to look like that do to the furtherest edge away from the camera gets blurred. Let me show you an example of mine from my editor.

If you can see the checkboard texture is blurred at the end? It's using the same sampler like yours but the texture isn't streamed like yours. So, you're looks normal like it should be.

Awesome job getting it solved!

Also, I have a hard time viewing your images so time so I have to go into Tamper Data to actually get the link - you can post images easily on here. Just click on attach files on the bottom of the reply. If you don't see the attach files above the add reply - click on Advanced Reply Options. Just helping out the next time whenever you post images.

Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX

Sorry for all the persistant questions, there are just a couple of things left I need to clear up.

1) So there really is no way to achieve better visuals than the 16x anisotropic filtering when sampling textures? The image I posted still looks really muddled.

2) I create the textures with the usage flag D3D11_USAGE_DEFAULT. This dosn't feel optimal considering its a static texture, but I need it due to mipmap generation. Is there any performance issues with that usage versus D3D11_USAGE_IMMUTABLE, and is there any easy way of fixing it?

This topic is closed to new replies.

Advertisement