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.

DarkBASIC Professional Discussion / Turning off the anti aliasing

Author
Message
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 18th Mar 2010 22:34 Edited at: 18th Mar 2010 22:34
Is there anyway of turning off the anti aliasing when running your program in a low resolution?


Kira Vakaan
17
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 19th Mar 2010 11:22
Er, how did you get the second image then?

Anyway, I'm not sure that there is any anti-aliasing going on, but rather the texture is being interpreted through some kind of mip filter. Use a texture flag of 1 in load image to disable mipmaps.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Mar 2010 14:26
If I remember correctly, antialiasing smoothes out edges of a mesh so that you don't get jagged lines when they are supposed to be a single line....

The fastest code is the code never written.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 19th Mar 2010 15:23
I think Hawk is right about this and i`m very curious what are the commands in dbpro for antialiasing?I never used it, because i never really find anything about it.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Mar 2010 15:26 Edited at: 19th Mar 2010 15:30
Quote: "Er, how did you get the second image then?"


MS Paint

Quote: "If I remember correctly, antialiasing smoothes out edges of a mesh so that you don't get jagged lines when they are supposed to be a single line...."


Lol, I don't know what to name this problem, but I think the picture did it's job.

Quote: "Anyway, I'm not sure that there is any anti-aliasing going on, but rather the texture is being interpreted through some kind of mip filter. Use a texture flag of 1 in load image to disable mipmaps."

You'd say it's a texture problem, but it's not. If I print some text in there it comes out blurred too. (Not that I didn't try your advice)

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Mar 2010 15:35
I'm still amazed at the number of people who ask for fixes while giving absolutely no information at all.

What is needed to fix this is:
- Code.
- Media.

If we can reproduce your problem then we can provably fix your problem, all without that unnecessary and time-wasting flailing around with random suggestions.

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Mar 2010 15:55 Edited at: 8th Apr 2010 20:09
Here you go sir. Not the exact same code, it's only a portion.


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 19th Mar 2010 18:11
Id hazard a guess and say the issue is with your window scaling code.

My signature is NOT a moderator plaything! Stop changing it!
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Mar 2010 20:20 Edited at: 19th Mar 2010 20:21
The reason I made the directx resolution half the size of the window is because then I don't have to do anything fancy to the pasting code (paste image 1,x*16,y*16), meaning it'll go faster.

If I would just scale everything up instead of scaling every tile up.

Am I making any sense? If not, look at the picture in my first post.

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 19th Mar 2010 20:38
you can't get rid of the blur when the dx views get scaled, i'd just make it the real size. what is this for, exactly? because using paste image is really slow, depending on what this will be there are some alternatives.

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Mar 2010 20:56 Edited at: 19th Mar 2010 20:56
It's for a tile engine.

the engine itself uses paste sprite, but for the example I used paste image for simplicities sake

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 19th Mar 2010 21:38 Edited at: 19th Mar 2010 21:46
When loading your texture, there are flags to change to prevent this. just check out the load image command. Also there is a multisampling flag on set display mode. Never tried it but i would assume it is for this.

http://s6.bitefight.org/c.php?uid=103081
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 19th Mar 2010 21:57
Yeah, what you're seeing is NOT the result of anti-aliasing. Standard AA smooths out the edges of objects (though it applies to any line, it's run for the edges of objects, not the textures of objects).

The problem is mipmaps - mipmaps are generated when you load an image (if they're not already generated), so that when you view the image on a textured object from far away, it won't show up as grainy pixels. To see how mipmaps are useful, try randomizing a matrix, and then texturing that matrix with an image containing random colored dots. I'm pretty sure that the matrix will appear all grainy and nasty looking, because it doesn't use mipmaps (I'm *pretty* sure).

So... it should be as simple as doing what kira vakaan and DVader said:

load image "Grass.bmp",ImageNumber,1


Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Mar 2010 22:45 Edited at: 19th Mar 2010 22:48
Quote: "[quote]If I remember correctly, antialiasing smoothes out edges of a mesh so that you don't get jagged lines when they are supposed to be a single line...."


Lol, I don't know what to name this problem, but I think the picture did it's job.

Quote: "Anyway, I'm not sure that there is any anti-aliasing going on, but rather the texture is being interpreted through some kind of mip filter. Use a texture flag of 1 in load image to disable mipmaps."

You'd say it's a texture problem, but it's not. If I print some text in there it comes out blurred too. (Not that I didn't try your advice)[/quote]

So is there any other option than scaling every sprite, turning off mipmaps and paying in speed?

Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 19th Mar 2010 23:18
I don't think the code sample you provided turns anti-aliasing on, so I don't think the problem lies in how to turn it off. I believe one turns anti-aliasing on by using the optional 5th argument in the Set Display Mode command.

One way to test is to try to do a screen grab. If anti-aliasing is on then the program should crash with an error accusing you of trying to read an illegal surface.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 20th Mar 2010 00:39 Edited at: 20th Mar 2010 00:40
This is the result of the posted code on my machine:



It seems closer to what the OP wants, but not quite perfect. I'm missing occasional rows and columns of pixels. It seems like different machines will have different results.

I'm not sure how to fix the issue though.

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Mar 2010 00:50 Edited at: 20th Mar 2010 00:51
In general it's not smoothed for me. Try adding a '1' flag to the end of your LOAD IMAGE and GET IMAGE calls. It'll disable stretching and filtering.
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 20th Mar 2010 03:11
The issue is bilinear filtering done on the actual window surface which you cannot alter using DBPro(to my knowledge), under Vista(and maybe 7) the window defaults to nearest neighbour filtering thus giving what the OP wants. But in XP and lower, bilinear filtering is used thus making the pixels look smoothed out when the display dimensions don't match the windows dimensions, this has nothing to do with loading images or anti-aliasing.

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Mar 2010 03:42
O... I assumed the texture was on a plain (because of the blue background in the first image)... so nm I guess.


Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 20th Mar 2010 04:54 Edited at: 20th Mar 2010 05:01
regardless of what his issue is, to answer his question wether or not you can turn off anti aliasing from within DBPro, didn't someone recently make a .dll for this? I remember seeing a post, but, can't find it in search. I'll keep looking but I remember it was all the rage. It worked well.
Off to the search feature....

edit:
nevermind, I think it was kaedroho's anisotropic filter plugin I was thinking of.
Sorry.
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Mar 2010 05:44 Edited at: 20th Mar 2010 06:27
Actually, I'm pretty sure that after years of bugging TGC to add a way to adjust AA someone else did it (Styx had a command for it if I remember correctly?).
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 20th Mar 2010 15:02 Edited at: 20th Mar 2010 15:02
bilinear filtering! Thank you so much. That's what I'm looking for.
Searches came up empty of course, so any way of turning it off trough a hack perhaps?

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th Mar 2010 18:02 Edited at: 20th Mar 2010 18:06
Use kaedroho's Anisotropic filtering DLL. It doesn't override DBPro's bilinear filtering but it makes things look MUCH nicer.

[Edit] Nevermind, I just remembered you aren't using Objects, so this wouldn't do you any good.

http://forum.thegamecreators.com/?m=forum_view&t=159383&b=5

Kira Vakaan
17
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 20th Mar 2010 22:50
Quote: "regardless of what his issue is, to answer his question wether or not you can turn off anti aliasing from within DBPro"

I think he asked that because he wasn't sure of what the issue was. dark coder established that the issue has nothing to do with DBPro, so anti-aliasing is irrelevant.
Visigoth
21
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 21st Mar 2010 07:54
yes, I know. I was just wondering if there was a .dll to turn off anti-aliasing, thats all.
Krilik
20
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Arizona, USA
Posted: 22nd Mar 2010 04:08
I'm not sure I understand what you are trying to accomplish by trying to scale a low resolution window, but why don't you just apply a scale to your images before you render them instead?
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 22nd Mar 2010 16:29
Quote: "I'm not sure I understand what you are trying to accomplish by trying to scale a low resolution window"

I'm hoping I can save a little possessing power by not scaling everything x2.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 26th Mar 2010 23:10 Edited at: 26th Mar 2010 23:16
Can you not just create your sprites twice as big in your art package?
Oh in your code you also use get image.

GET IMAGE Image Number, Left, Top, Right, Bottom, Texture Flag

The texture flag on this command also change how the image is displayed.

Texture Flag
Integer
The value of the texture flag to use (0-use stretching, filter, colorkey, or 1-no stretching, no filter, colorkey, or 2-use stretching, no filter, no colorkey, or 3-no stretching, no filter, no colorkey.

You can certainly use this option to make your images clearer.

http://s6.bitefight.org/c.php?uid=103081
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 8th Apr 2010 20:19
The issue was resolved by rewriting the engine to use 3d plains and setting the texture filtering to 0.

Login to post a reply

Server time is: 2026-07-26 15:30:26
Your offset time is: 2026-07-26 15:30:26