FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Solved] Problem with Blurry Sprites/Textures

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Wed May 28, 2008 2:24 pm    Post subject: [Solved] Problem with Blurry Sprites/Textures Reply with quote

Currently, whatever sprites I try and draw to the screen come out extremely blurry. I searched around the forums a bit, and found a thread or two advising to only use sprites with sizes a factor of two. I converted my test sprite to a 32x32 .png file - but to no avail.

I'm currently using the v.2 Arclib for Phobos (I plan to move to Tango once v.3 comes out). My source code right now is extremely simply, as I'm just testing out functions and trying to get a feel for Arclib. Here is my code:

Code:
module main;

import
    arc.input,
    arc.window,
    arc.font,
    arc.sprite.sprite,
    arc.math.point,
    arc.draw.color,
    arc.types;

int main()
{
    // Open window with title, screen width, height, and bits per pixel
    arc.window.open("Test", 800,600,0);

    // Open input handling
    arc.input.open();

   // Sprite setup
   Sprite s = new Sprite(COLLISION_TYPE.BOX);
   s.addFrame("IsaacFS.png", "standing", 1000, null);
   s.setPosition(Point(400,400));
   

    // while the user doesn't press the QUIT button
    while (!arc.input.keyDown(ARC_QUIT))
    {
        // process input
        arc.input.process();

        // clear the current screen
        arc.window.clear();

        // Draw the Sprite
        s.draw();

        // swap window buffers
        arc.window.swap();
    }

    // close font system
    arc.font.close();

    // clean ourselves up and exit
    arc.window.close();

    return 0;
}


For reference, this is the image I'm using:

And this is what it ends up looking like:


Thanks in advance to any one who provides any insight =)
Meow!


Last edited by KuroKitten on Sun Jun 01, 2008 11:04 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address MSN Messenger
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 28, 2008 8:11 pm    Post subject: Reply with quote

Not sure. If arclib is using opengl to draw the surface, it may draw based on overridden settings in your display drivers settings box (win32). For example, if you have some sort of filtering (bilinear, trilinear) set to "on" in driver's opengl settings, perhaps this might occur?

Just a guess. Perhaps the developers have a better idea.

-JJR
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu May 29, 2008 6:37 am    Post subject: Reply with quote

Yes, all rendering is done using OpenGL.

ArcLib v.3 will never be released, as I've decided to split ArcLib up into a main 'core' module and a various number of compatible extensions, all these can be found and installed using DSSS net install.

"Development" of Arc, in the traditional sense, is no longer needed. All of the packages or Arc are complete. "Development" will simply mean maintenance to existing packages or creating a new ArcLib extension. All of the extensions that I need are pretty much complete.

The reason your image is blurry is because that was an old ArcLib bug and the phobos version of arclib is not maintained. I'm going to recommend you to install the latest Tango release and grab ArcLib via DSSS net install. If you do so, your images will render like this instead:



The one on the left being the ArcLib render, the one on the right being the actual image. They should be identical.
Back to top
View user's profile Send private message AIM Address
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Thu May 29, 2008 2:15 pm    Post subject: Reply with quote

Ah, thank you very much Clay =) I'll work on getting Tango set-up and downloading the Tango version of Arc today. I was just a little confused on the way you were releasing things - I figured that v.2 was as is, and that the next version (what I was thinking of a v.3) would release with Tango only support in much the way you just explained. My bad >.<

Thanks for the help =)
Mew.
Back to top
View user's profile Send private message AIM Address MSN Messenger
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Thu May 29, 2008 9:40 pm    Post subject: Reply with quote

I downloaded the Tango version of arc off of dsss, finally got everything to compile nicely, and...

It's still comes out blurry =( I'm using exactly the same code as above, just this time with Tango.

I'm not sure what it is I'm doing wrong...
Mew...
Back to top
View user's profile Send private message AIM Address MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Fri May 30, 2008 7:58 am    Post subject: Reply with quote

That's odd...

can you tell me the result of typing 'dsss installed' on the command line?

Here's the code that I use

Code:

module main;

import
    arc.all,
    sprite.all;

int main()
{
   // Open window with title, screen width, height, and bits per pixel
   arc.window.open("Test", 800,600,0);

   // Open input handling
   arc.input.open();

   // Sprite setup
   Sprite s = new Sprite(COLLISION_TYPE.BOX);
   s.addFrame("IsaacFS.png", "standing", 1000, null);
   s.setPosition(Point(400,400));
   
   // while the user doesn't press the QUIT button
   while (!arc.input.keyDown(ARC_QUIT))
   {
     // process input
     arc.input.process();

     // clear the current screen
     arc.window.clear();

     // Draw the Sprite
     s.draw();

     // swap window buffers
     arc.window.swap();
   }

   // clean ourselves up and exit
   arc.window.close();

   return 0;
}


I would try...

dsss uninstall arc
dsss uninstall arclib
dsss uninstall sprite
dsss uninstall etc.

then..

dsss net install arclib-core
dsss net install arclib-sprite

dsss net list (will let you view all available packages)

but those 2 are the only required for the code above.
Back to top
View user's profile Send private message AIM Address
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Fri May 30, 2008 4:57 pm    Post subject: Reply with quote

Alright, well, the first thing I noticed is that the mirrors 1 and 2 for dsss net install actually have different sets of files. I was using number 2 since I had gotten errors with trying to install via number one. What I did with that was essentially download arclib-development (since dsss stopped installing at that point.) Then moved into each of the folders and typed "dsss install". After doing this with each folder, I was done - and that's the version of arclib I was using.

This time, however, I used mirror one again. Here is what I did in this order:

1) Downloaded and extracted DMD v1.030.
2) Downloaded and extracted DMC over DMD.
3) Downlaoded and extrected DSSS.
4) Chose Mirror 1 on DSSS net install.
5) Installed Tango via DSSS net Install.
6) Started installing arclib-core via dsss net install.

This is where I get an error. It gets as far as creating the imports for derelict, at which point I get this:

Code:
'lib' is not recognized as an internal or external command, operable program or batch file. Command C:\DProgramming\dmd\bin\rebuild.exe return with code -1, aborting.
Error: Command failed, aborting.


Also, at this point, typing in dsss installed gives me the following:
Code:
dsss
net-tango


Any ideas?
Mew?
Back to top
View user's profile Send private message AIM Address MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sat May 31, 2008 12:29 pm    Post subject: Reply with quote

I'd recommend against dsss net install tango, and instead recommend the pre-packaged Tango releases.

http://www.dsource.org/projects/tango/wiki/DmdDownloads

I'm assuming you are using DMD. Just unzip the tango stuff into your

C:\dmd\

folder to install tango, and it comes with the correct version of DMD that works with it too.
Back to top
View user's profile Send private message AIM Address
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Sat May 31, 2008 4:27 pm    Post subject: Reply with quote

Alright, I did as you said, and in a sense it fixed the problem; however, I now have a new one. This time, I installed DMC, then DMD, then the Tango files you linked me to (unzipping them over C:\dmd and telling it to replace files where necessary), then dsss.

This time, when I typed in dsss net install arclib-core it successfully installed all of derelict. and then I try and installed arclib-core via DSSS. It's at this point that things begin to Error. This is the output I have:

Code:
Installing arclib-core

Working in C:\DProgramming\dsss\tmp\DSSS_arclib-core
+ svn export http://svn.dsource.org/projects/arclib/trunk/arclib/arc/
svn: Destination directory exists; please remove the directory or use --force to
 overwrite
svn: 'arc' already exists
+ curl -k http://dsss.brainsware.org/mirror/arclib-core.tar.gz -o arclib-core.ta
r.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   223  100   223    0     0    532      0 --:--:-- --:--:-- --:--:--     0
+ bsdtar -xf arclib-core.tar.gz
bsdtar: Unrecognized archive format: Unknown error


It's at this point that it just repeatedly displays this message, pausing for a moment, then trying again, only to error out again.

I'm getting closer, at least! >.<
Meow =3

Edit: I did a little more inspection, and attempted to get just the arclib-core.tar.gz file. I typed the command line snippet from above while in a different test folder:
Code:
+ curl -k http://dsss.brainsware.org/mirror/arclib-core.tar.gz -o arclib-core.ta
r.gz

And after it downlaoded the tar.gz file, I attempt to extract it with WinRAR - at which point WinRAR told me that "The archive is either in unknown format or damaged."

I followed this up with a quick download of the linux version of tango just to make sure it wasn't a problem with WinRAR and that it could extract tar.gz files. It open and extracted it just fine. It would seem to me that somehow I'm getting a corrupted arclib-core.tar.gz file. Any ideas?
Back to top
View user's profile Send private message AIM Address MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sun Jun 01, 2008 10:08 am    Post subject: Reply with quote

Hrm... sometimes if dsource is being slow dsss will try to download from a mirror site, however I think DSSS mirroring ability is broken and so anything downloaded from that tar.gz file will not work.

Your options...

1. try 'dsss net install arclib-core' until you get this output, it may take 2 or 3 tries

Code:

Synchronizing...
+ curl -s -S -k http://svn.dsource.org/projects/dsss/sources/source.list -o D:\dsss\share\dsss\sources\source.list -z D:\dsss\share\dsss\sources\source.list
+ curl -s -S -k http://svn.dsource.org/projects/dsss/sources/pkgs.list -o D:\dsss\share\dsss\sources\pkgs.list -z D:\dsss\share\dsss\sources\pkgs.list
+ curl -s -S -k http://svn.dsource.org/projects/dsss/sources/mirrors.list -o D:\dsss\share\dsss\sources\mirrors.list -z D:\dsss\share\dsss\sources\mirrors.list

Working in D:\dsss\tmp\DSSS_arclib-core
+ svn export http://svn.dsource.org/projects/arclib/trunk/arclib/arc/
A    arc
A    arc\dsss.conf
A    arc\arcmacros.ddoc
A    arc\arc
A    arc\arc\internals
A    arc\arc\internals\input
A    arc\arc\internals\input\joystick.d
A    arc\arc\internals\input\keyboard.d
A    arc\arc\internals\input\signals.d
A    arc\arc\internals\input\all.d
A    arc\arc\internals\input\mouse.d
A    arc\arc\internals\input\constants.d
A    arc\arc\time.d
A    arc\arc\input.d
A    arc\arc\texture.d
A    arc\arc\text
A    arc\arc\text\all.d
A    arc\arc\text\routines.d
A    arc\arc\types.d
A    arc\arc\memory
A    arc\arc\memory\freelist.d
A    arc\arc\memory\all.d
A    arc\arc\memory\routines.d
A    arc\arc\math
A    arc\arc\math\rect.d
A    arc\arc\math\matrix.d
A    arc\arc\math\angle.d
A    arc\arc\math\all.d
A    arc\arc\math\routines.d
A    arc\arc\math\point.d
A    arc\arc\math\size.d
A    arc\arc\math\collision.d
A    arc\arc\window.d
A    arc\arc\all.d
A    arc\arc\draw
A    arc\arc\draw\color.d
A    arc\arc\draw\shape.d
A    arc\arc\draw\image.d
A    arc\arc\draw\all.d
A    arc\arc\templates
A    arc\arc\templates\array.d
A    arc\arc\templates\singleton.d
A    arc\arc\templates\all.d
Exported revision 1427.
Creating imports for arc

arc => arc
+ D:\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -ID:\dsss\include\d -SD:\dsss\lib\  -ID:\dsss\include\d -SD:\dsss\lib  -oqdsss_objs\D arcmacros.ddoc -g  -clean -full  -explicit -lib arc\all.d arc\draw\all.d arc\draw\color.d arc\draw\image.d arc\draw\shape.d arc\input.d arc\internals\input\all.d arc\internals\input\constants.d arc\internals\input\joystick.d arc\internals\input\keyboard.d arc\internals\input\mouse.d arc\internals\input\signals.d arc\math\all.d arc\math\angle.d arc\math\collision.d arc\math\matrix.d arc\math\point.d arc\math\rect.d arc\math\routines.d arc\math\size.d arc\memory\all.d arc\memory\freelist.d arc\memory\routines.d arc\templates\all.d arc\templates\array.d arc\templates\singleton.d arc\text\all.d arc\text\routines.d arc\texture.d arc\time.d arc\types.d arc\window.d -ofarc.lib
Digital Mars Librarian Version 8.02n
Copyright (C) Digital Mars 2000-2007 All Rights Reserved
http://www.digitalmars.com/ctg/lib.html
Digital Mars Librarian complete. 
arc.lib                             

Installing arc
+ copying arc.lib
+ copying all.di
+ copying all.di
+ copying color.di
+ copying image.di
+ copying shape.di
+ copying input.di
+ copying all.di
+ copying constants.di
+ copying joystick.di
+ copying keyboard.di
+ copying mouse.di
+ copying signals.di
+ copying all.di
+ copying angle.di
+ copying collision.di
+ copying matrix.di
+ copying point.di
+ copying rect.di
+ copying routines.di
+ copying size.di
+ copying all.di
+ copying freelist.di
+ copying routines.di
+ copying all.di
+ copying array.di
+ copying singleton.di
+ copying all.di
+ copying routines.di
+ copying texture.di
+ copying time.di
+ copying types.di
+ copying window.di


2. Attempt to grab the source from svn yourself....

http://svn.dsource.org/projects/arclib/trunk/

each arclib package is in its own folder, so to get arclib you would do...

svn co http://svn.dsource.org/projects/arclib/trunk/arc arclib-core
cd arclib-core
dsss build & dsss install

Personally, I would try the first option, as it should definitely work and is easier, however if you get desperate, you can try the second option as well.
Back to top
View user's profile Send private message AIM Address
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Sun Jun 01, 2008 8:48 pm    Post subject: Reply with quote

Oi, I think Arclib must hate me XD

Alright, so, we have another batch of problems. First I tried installing via dsss net install arclib-core. This worked this time (miraculously) and installed fine. Then I typed in "dsss net install arclib-sprite" only to have dsss tell me that the package didn't exist. I tried this for various other arclib-<something> packets that were listed after typing in "dsss net list"; similar results.

I then decided to try the harder method. I typed in "svn co http://svn.dsource.org/projects/arclib/trunk/arclib/" to get all of the various different extension. Since some of the extensions require other ones (like sprite wanting to do audio through openal) I decided to just install each one.

First I typed in "dsss net install derelict" in order to download the complete derelict libraries and files. Then I, in order, went into each other files (arc, blaze, freetype, ... , sprite) and typed "dsss build" and then "dsss install". This worked like a charm and didn't cause any problems.

At this point I was excited that everything had worked. I moved into my project folder (after making sure I had all of the dll's I needed and the image was in there) and typed "dsss build main.d". It did it's thing, produced an .exe file (no errors!) and....

The sprite is still blurry =/ So, I got everything to work without any errors, but we still have the problem of the blurry sprite >.< Any more ideas on what might be going on?

Meow.

Edit:I sent the executable to a few friends, following a hunch I had, and it turns out that I'm the only one seeing the blurring effect. Everyone else seems to see the sprite without blur. I can't quite figure out what's up. Can you think of anything native to the PC that I might need to change?
Back to top
View user's profile Send private message AIM Address MSN Messenger
KuroKitten



Joined: 28 May 2008
Posts: 11

PostPosted: Sun Jun 01, 2008 11:03 pm    Post subject: Reply with quote

I finally figured it out. I'll go ahead and post the answer here, just in case someone else has the same problem and doesn't realize it.

After the whole mess of downloading over and over again, it turns out it was just my computer, and not the libraries I was using. I'm using ATI Tray Tools to overclock my graphics card. One thing ATT lets you do is also adjust settings for OpenGL. The two settings in question are under OpenGL->Texture Preferance (set it to High Quality) and OpenGL->MipMap Detail Level (set it to High Quality). Both of these were set to High Performance, and so ATT was lowering the quality of OpenGL textures in order to maximize performance.

Once I changed these settings, it worked like a charm =)

Thanks Clay for all of your help!
Meow!
Back to top
View user's profile Send private message AIM Address MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Jun 02, 2008 6:26 am    Post subject: Reply with quote

That's good that you figured it out. I'll try to figure out why DSSS net install is broken for all those packages in the meantime.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group