Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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 476 times)
0 Members and 1 Guest are viewing this topic.
Offline DrewLols

Junior Member


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?
Online matheus23

JGO Wizard


Medals: 72
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

Junior Member


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!
Try the Free Demo of Titan Attacks
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.


Online matheus23

JGO Wizard


Medals: 72
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

Junior Member


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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (131 views)
2013-05-17 21:29:12

alaslipknot (140 views)
2013-05-16 21:24:48

gouessej (170 views)
2013-05-16 00:53:38

gouessej (164 views)
2013-05-16 00:17:58

theagentd (174 views)
2013-05-15 15:01:13

theagentd (159 views)
2013-05-15 15:00:54

StreetDoggy (203 views)
2013-05-14 15:56:26

kutucuk (227 views)
2013-05-12 17:10:36

kutucuk (227 views)
2013-05-12 15:36:09

UnluckyDevil (230 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.104 seconds with 21 queries.