Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  (Slick2D) setFilter Resource not found?  (Read 746 times)
0 Members and 1 Guest are viewing this topic.
Offline DrewLols

Senior Member


Medals: 1
Projects: 1


Noob going through metamorphosis...


« Posted 2012-11-09 20:22:05 »

Seems that whenever you create a new image in slick that has no texture, setting its filter throws an exception that complains about the resource not being found.  I am trying to double buffer something.  Any thoughts as to how to apply a filter to a buffer image?

Did you know that 90% of statistics are wrong?
Offline matheus23

JGO Wizard


Medals: 96
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2012-11-09 22:00:02 »

I'm sorry, I have no answer for your question.

And I know those questions are often somehow contra-productive, but:
Why are you trying to double buffer something in OpenGL? OpenGL's framebuffers in LWJGL are ALL doublebuffered.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline DrewLols

Senior Member


Medals: 1
Projects: 1


Noob going through metamorphosis...


« Reply #2 - Posted 2012-11-09 22:34:07 »

I'm trying to avoid visual artifacts.  I either have to settle for making my tiles 32x32, or 64x64.  32x32 is too small, and 64x64 is too big, so I want to scale the entire screen down by about 30%.  Well, TiledMaps generally don't scale well, so I decided to buffer all the content to an offscreen buffer, then scale the buffer.

Did you know that 90% of statistics are wrong?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2012-11-09 22:36:31 »

Creating a Slick image with no texture should not be possible; it will likely throw a null pointer since Texture is expected to be non-null.

For offscreen buffers where you plan to use getGraphics, you should use the new Image.createOffscreenImage utility and specify a filter there.

I don't understand why you don't just use non-power-of-two tiles, e.g. 45x45. Huh

P.S. In future, always post the exception.


Offline matheus23

JGO Wizard


Medals: 96
Projects: 3


You think about my Avatar right now!


« Reply #4 - Posted 2012-11-09 22:39:14 »

Also the artifacts are propably only because you didn't create mipmaps or you didn't enable antialiasing.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline DrewLols

Senior Member


Medals: 1
Projects: 1


Noob going through metamorphosis...


« Reply #5 - Posted 2012-11-09 22:42:57 »

Creating a Slick image with no texture should not be possible; it will likely throw a null pointer since Texture is expected to be non-null.

For offscreen buffers where you plan to use getGraphics, you should use the new Image.createOffscreenImage utility and specify a filter there.

I don't understand why you don't just use non-power-of-two tiles, e.g. 45x45. Huh

P.S. In future, always post the exception.




Non power of two tiles don't fit quite as well on my sprite sheets...  Well, that WOULD solve my problem, but let me play the devil's advocate for a moment.  What would be the best course of action if I wanted my game's camera to zoom in and out occasionally?

Edit:  Before I forget, I would like to point out that I've never been able to download a copy of slick that has the method createOffscreenImage() located in the Image class.  Am I perhaps downloading the incorrect distribution?  I always try to find the latest, but I can't seem to find one with that method.  I only every see it in examples.

Did you know that 90% of statistics are wrong?
Offline Cero
« Reply #6 - Posted 2012-11-10 01:08:44 »

Non power of two tiles don't fit quite as well on my sprite sheets...  Well, that WOULD solve my problem, but let me play the devil's advocate for a moment.  What would be the best course of action if I wanted my game's camera to zoom in and out occasionally?

You probably talk about Bleeding, I made a thread once: http://www.java-gaming.org/topics/bleeding/26823/view.html
There are things you can do, but its all... not that straightforward... well unless you just use NEAREST filter and screw the quality

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!