Author Topic: Applied Textures are Blurring  (Read 1818 times)

Offline Tale

  • byte
  • *
  • Posts: 6
    • View Profile
Applied Textures are Blurring
« on: December 26, 2009, 09:44:58 pm »
I have been doing some tests with jpct before applying it to one of my games and have ran into a problem.  During my games I will often times have windows displayed and have been trying to create these using a plane with a textured image.  The problem is that the texture becomes very pixelated if I zoom in on the window.  Even if my camera is far away, parts of the texture are slightly out of order.

Is there a way to prevent this or is there a better way to display my game windows?

Thanks for any help that is provided.

(Also, I am limited to the software renderer.)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Applied Textures are Blurring
« Reply #1 on: December 26, 2009, 09:49:18 pm »
Maybe blitting them is an option (FrameBuffer has some blit()-methods)? That way, they'll have the same size as your bitmap has. That will prevent any pixels from going crazy but you can't scale them of course.

Offline Tale

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Applied Textures are Blurring
« Reply #2 on: December 26, 2009, 09:59:40 pm »
Ok, I will try that.

Thank you!

Offline Tale

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Applied Textures are Blurring
« Reply #3 on: December 26, 2009, 10:18:09 pm »
That cleared up the blurring, but I seem to be restricted to a set region that my image is squeezed to fit.  Am I able to turn this region off or change its size?

I also noticed that I can get the graphics from the buffer.  Would it be just as effective to use the Java built-in Draw methods using the graphics that I get from the buffer to draw my images?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Applied Textures are Blurring
« Reply #4 on: December 26, 2009, 10:29:54 pm »
Blitting works with textures which are limited to a power of 2. That is of course a restriction. If you are sure, that you'll never want to or have to switch to the hardware renderer and that you don't need Java 1.1 compatibility, then you can work with the graphics-instance that the frame buffer provides to draw your own stuff using Java2D. You can even use Swing or AWT instead. However, once you decide to take the OpenGL-route instead, you'll get stuck...

Offline Tale

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Applied Textures are Blurring
« Reply #5 on: December 26, 2009, 10:42:20 pm »
Ok.

Thanks Egon for all your help.