Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Why does antialiasing not work?

Author
Message
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Oct 2011 01:14
I am forced to use
Quote: "dbSetRenderState(D3DRS_MULTISAMPLEANTIALIAS,D3DMULTISAMPLE_NONMASKABLE);"

each frame to make antialiasing work consistantly. This is what I am using to change my resolution for my game:
Quote: "dbSetDisplayModeAntialias (ScreenW, ScreenH, ScreenD, 1,D3DMULTISAMPLE_NONMASKABLE,0);"

ScreenW/H/D are variables I set earlier in the program and are NOT the issue. When the game loads, I get good antialiasing and then it stops the AA. I would love to not have to use dbSetRenderState(..), but until someone tells me what the bug is, I'll have to use it each frame.

The fastest code is the code never written.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 19th Oct 2011 04:03
Probably not a bug, maybe your graphics cards default settings. Check them for AA defaults. Okay some cards don't have them.

This is logged for my future reference and I'll follow this in case I'm wrong which is most likely...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Oct 2011 15:40
How can I check the card defaults?

Even so, I have another computer with a different brand of card and it does the same. If you want to check it yourself, I have the old (without my aforementioned fix) at http://forum.thegamecreators.com/?m=forum_view&t=183217&b=8. I would like someone to verify the problem. When you start a new game, you begin at "Starport". If you leave, the AA goes away and doesn't come back. My fix doesn't seem to slow down the game, but on slower computers it might cause problems.

The fastest code is the code never written.
Neotron
14
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 20th Oct 2011 12:21
As far as i know.

My old pentuim 4 has Geforce FX 5500 and it does not support anti aliasing while my new pc has Geforce 520gt and supports it.

So WLGfx is right.

They asked me for a proof.
Now i am making one........
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Oct 2011 14:03
Quote: "If you want to check it yourself, I have the old (without my aforementioned fix) at"


Is it really necessary for us to download an umpteen megabyte zipped game file to demonstrate this problem?

Wouldn't a few lines of code be enough?
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Oct 2011 14:06 Edited at: 20th Oct 2011 14:06
It sounds like the default AA setting is overriding your custom one, so as suggested check your card's control panel.



Support a charitable indie game project!
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 20th Oct 2011 17:19 Edited at: 20th Oct 2011 20:02
I have tinkered with my card settings and no matter what I do, I can't get AA to work consistantly. I even tried to override my program and force AA on the card-- no change.

@Green Gandalf:
I'll try to make an app that gives me the same result. It'll be posted as soon as I get the result.

EDIT: Here it is. It occurs when you try to render a 2D box beyond the edge of the screen. This demo shows the problem. Once you get in, get a good spot to look at and press the left arrow key and AA will go away. Since I found the problem, I have fixed it in my game.

BTW, you may need to change the resolution if you don't use 1080.

EDIT2: Correction. It occurs ANYTIME you show a 2D box.
EDIT3: Correction. There is a problem with dbBox(x,y,x2,y2,Color1,Color2,Color3,Color4); It doesn't cause problems when I use dbBox(x,y,x2,y2);

The fastest code is the code never written.

Attachments

Login to view attachments
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 20th Oct 2011 21:24
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Oct 2011 15:14 Edited at: 21st Oct 2011 15:15
@Hawkblood

Thanks for the download.

I can't seem to reproduce the problem. I can only get AA by using the appropriate AA setting on the GFX card control panel (nVidia) - various options in the DGDK seem to have no effect.

When set in the control panel, AA persists however many times I press the left key.

Here are some typical screenshots:



What exactly is the D3DMULTISAMPLE_NONMASKABLE option supposed to do? I've checked the DX9 SDK docs and I'm none the wiser. I experimented with the other values, e.g.



and couldn't see any obvious change.

Attachments

Login to view attachments
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Oct 2011 04:08
It has always had the same affect with me, I've played Unreal Tournament on every computer / laptop I've had and I've noticed various graphics glitches between the graphics cards. This also reminded me of the dot, line, and circle functions not working on certain cards.

That's why I tend to write and test all my code on a very low-end laptop.

If there's a way to set those settings from within DBP (via plugin) it would be handy for these circumstances... I aint'nt gotten that far yet with DX...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 23rd Oct 2011 15:05
@GG:
Your vid card should have an option to allow the application to control AA. Overriding it will give you what you select in the vid card and nothing more/less.

The fastest code is the code never written.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Oct 2011 13:28
Quote: "Your vid card should have an option to allow the application to control AA."


Yes. As I said the only way for me to get AA with that demo was to set it on the Graphics card. I was not able to get AA using the application controlled setting.

I couldn't find a Help file for the command dbSetDisplayModeAntialias

I'll see if I can find something with the search button

Anyway, I couldn't reproduce this problem at all:

Quote: "Here it is. It occurs when you try to render a 2D box beyond the edge of the screen. This demo shows the problem. Once you get in, get a good spot to look at and press the left arrow key and AA will go away."


I either had AA or no AA all the time. None of the settings would make it change while the program was running.

Sounds you've solved your problem though.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Oct 2011 17:33
Quote: "Sounds you've solved your problem though."

Yes. I would think DGDK could correct those problems internally, but I can't expect the world when it's so big. This issue would have probably happened even if I used pure DX. It appears that not all vid cards have this issue (ref. yours). I suppose it's good that I found it on mine so I could resolve it.

The fastest code is the code never written.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 27th Oct 2011 19:53 Edited at: 27th Oct 2011 19:54
http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf
this could be of some help, anti aliasing as post-processing, this is for Direct3D11, but i think you can port it over to 9, i implemented it and it worked fine for my engine, download source code from here:
http://developer.nvidia.com/nvidia-graphics-sdk-11-direct3d
(second sample)

is this off-topic? haha, anyhow, this could be faster than regular AA, you should check it out ^^

Login to post a reply

Server time is: 2024-10-02 21:37:31
Your offset time is: 2024-10-02 21:37:31