If I set my device to use 4x FSAA for example, can I temporarily disable it when rendering primitves or somehow make primitives that isn't affected by the FSAA I have a graphical user interface that render text and quads with point filtering, that way making it "pixel perfect". Much like blitting a sprite but I'm using triangles instead. However this method breaks miserably when I add antialiasing, since the pixel precision is lost and it looks horrible.
I would like to render the GUI and text triangles without FSAA and terrain / player / whatever else with FSAA enabled... I'm using MDX if that matters.
Any help / ideas are appreciated.

Disable FSAA for some primitives each frame? (disable it temporarily)
Scott Gunn
device.SetRenderState(RenderStates.MultisampleAntiAlias, false);
Thanks
Renata Yasa Putra
Yes you have to apply the offset to the position and let the texture coordinate’s unchanged.
If you want to draw from pixel 0 to 4 you have to use -0,5 to 3,5 as positions if you have pretransformed vertices.
Sonnet
I've tested my gui system on some cards now, the renderstate seems to work on at least these cards: 6800, 6800GT, 6800Go, 5950, and Radeon 9800Pro. The cards are very similar but I haven't had any chance on others yet, and the radeon is the only card which has the capability.
Anyway, I've made a screenshot comparsion image that is available here:
http://img92.imageshack.us/img92/986/gui6qp.png
The top row shows the result with 0.5f texel offset, the bottom row does not use this texel offset. The right column uses four samples multisampling (4x antialiasing).
We clearly see that the topleft image is looking correct, in the bottomleft image the texcoords are clearly off by a pixel. We also see that when we enable multisampling the image is worse, less pixel correct so to speak. We see this most clearly with the thinnest font lines, however the multisampling effect is about the same for both the upper and the lower row.
JeffCurrier
Maybe I should know this but I don't... What happens if I try to set that renderstate on a system that doesn't have that capability Does it crash, throw an exception or is it just ignored / set without any effect
And to add to that question, I have a similar one. I guess all cards doesn't support anisotropic filtering, what happens if I set texture filtering to anisotropic on a system that doesn't have caps for it Does it crash, throw an exception or fall back to linear filtering
TomAStraw
However, this is very neat and pixel perfect. That way small fonts are made up of 1px thin lines, these lines and the pixel perfection in general gets screwed if I add antialiasing. Thats why I would like to disable AA for the user interface but still have it on the terrain in my game, e.g. And on my card atm, it works really good.
I will try to find a friend with an older gfx-card that doesn't support this state and try what happens.
SimpleBits
I am not sure why the newer GeForce does not report this Caps if it work. Maybe it does not work always.
I don’t know what’s going wrong with your GUI elements but my own GUI works the same way and it is still smooth as it should with any kind of AA enabled. Have you check that you use a half pixel offset on every screen coordinate This is a common Direct3D mistake which can make the GUI blurry.
benwalker
Http://msdn.microsoft.com/library/en-us/directx9_c/Directly_Mapping_Texels_to_Pixels.asp frame=true
You don't need to look for a old card. All cards based on nVidia chips does not support this caps bit.
Vimm
If I see it right you use Managed DirectX.
It will not crash but you should expect an exception anytime you call a Managed DirectX method but it is even possible that the runtime will ignore it silently. As exception handling is “slow” in .Net you should avoid this.
Anyway to make sure that your program runs on as many systems as possible you will have to check the caps and don’t use anything that is not available.
To come back to your primary question. Why do you want to disable FSAA
Kirk Quinbar
Interesting...
First of all, I have read that document (or a version o fit ) and thats how I got my point filtered gui to work. So that is really neat but is as I said earlier kinda pointless as fast as antialiasing is applied to it. The point of the gui rendering was that it should only render primitives textured by an equal big texture area and that it should point filtering so everything would be "blocky". When filtering / antialiasing is applied the smoothness appear and it just destroys the gui look.
Well, to the other part. I have a GeForce 6800GT and this renderstate works perfectly for me. I've also tried on an ATI card which has this capability and it (of course) works there aswell. How come this works on my nvidia card that does not have this capability
David Streeter
Lovie
I've not tried using it myself, and it's in native-DX .. but you might want to try looking at:
( for the SetRenderState() calls...)
hth
Jack
HSA4733
But you can not count on this because this renderstate have an Caps bit associated.
D3DPRASTERCAPS_MULTISAMPLE_TOGGLE need to be set in the RasterCaps and there are many hardware out there without this feature.
Len Z.
Have you add this offset to the texture coordinate or the position I am asking because you write texel offset and not pixel offset.
Mark Asztalos
I thought that was correct, but maybe I'm doing it wrong