Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (739)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (820)
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  
  Achieving such effect  (Read 4319 times)
0 Members and 1 Guest are viewing this topic.
Offline Quarry
« Posted 2012-10-21 05:24:32 »

What I got is 2, what I want is 1, how do

Offline Phased
« Reply #1 - Posted 2012-10-21 05:27:25 »

Cant tell the difference? I'm assuming the top one is drawn with some graphic  program. maybe explain more then.

how do
Offline Quarry
« Reply #2 - Posted 2012-10-21 05:30:55 »

The image got scaled so it might not be clearly visible if that's what you mean

However if you are asking how I got the top image, I simply resized the second image down by 2 and then resized it back up

I want to get the pixellation effect of 1
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DazKins
« Reply #3 - Posted 2012-10-21 06:21:22 »

The pixellation effect of 1 would only have been created when you scaled the image around. If you want to achieve a pixelly 3d style you have two options, use AWT to write out a basic 3D environment using Math, or use some kind of shader in OpenGL to make it look pixelly. Im not entirely sure how you would do that, im not that experienced with GLSL


Check out my Dev Blog:
Offline Quarry
« Reply #4 - Posted 2012-10-21 06:29:00 »

I know what I should be using however I'm not sure how I'll do that
Offline kappa
« League of Dukes »

JGO Kernel

Medals: 119
Projects: 15


« Reply #5 - Posted 2012-10-21 06:42:06 »

A nice simple way to get a pixelated effect is using render to texture (using a Frame Buffer Object or PBuffer). Render to a smaller texture size then the window size and then drawing the texture stretched to the window size (using GL_NEAREST filtering). This should give you a pixelated effect. The smaller the texture the larger the pixels will be.

There is an example on how to Render to Texture on the LWJGL wiki here.
Offline StumpyStrust
« Reply #6 - Posted 2012-10-21 06:51:17 »

kappa you beat me to the punch was a bout to say go for a frame buffer.  Undecided

Offline Quarry
« Reply #7 - Posted 2012-10-21 07:18:22 »

It turned out way too good! Almost exactly the same as my mockup

Anyways, here's the code, I would like to know if I put things in a wrong order or something (the Cube class is simply an utility class for drawing cubes)
Offline Danny02
« Reply #8 - Posted 2012-10-21 08:20:49 »

btw, there is no need to draw a fullscreen quad, you can easily copy a framebuffers data to another one(which is handy, because you won't need any shaders for that and probably faster)

requires the framebuffer blit extension
glBindFramebuffer(GL_READ_FRAMEBUFFER, frameBufferID);
glBindFramebuffer(.GL_DRAW_FRAMEBUFFER, 0);//0 is the id of the default framebuffer
glBlitFramebuffer(0, 0, framebufferWidth, framebufferHeight, 0, 0, monitorWidth, monitorHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);
Offline Quarry
« Reply #9 - Posted 2012-10-21 08:51:41 »

Ooh! That's really neat too
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Quarry
« Reply #10 - Posted 2012-10-21 14:16:27 »

Shameful revival, I recently attempted to rewrite the whole thing to make it look neater

However it doesn't seem to work, did I miss something? I did a completion check on it and it all seemed quite fine
Offline Danny02
« Reply #11 - Posted 2012-10-21 17:22:30 »

I think you are doing the blitting wrong, because you bind the default framebuffer as read and write buffer (glBindFramebuffer(GL_FRAMEBUFFER, 0))

what you want to do is only change the write buffer. At the programm start bind your fbo as read an write buffer(with GL_FRAMEBUFFER) and then only change the write buffer with GL_DRAW_FRAMEBUFFER
Offline Quarry
« Reply #12 - Posted 2012-10-21 18:41:55 »

I have no idea how I'm supposed to do that, but I noticed that I didn't set a depth buffer

Still no luck though
Offline Quarry
« Reply #13 - Posted 2012-10-22 13:55:27 »

   public void renderScaledFBO() {
      glViewport(0, 0, S_WIDTH * S_SCALE, S_HEIGHT * S_SCALE);
      glBindFramebuffer(GL_READ_FRAMEBUFFER, drawFBO);
      glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
      glBlitFramebuffer(0, 0, S_WIDTH, S_HEIGHT, 0, 0, S_WIDTH * S_SCALE,

Changed the stuff to what you asked but still no luck
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Ecumene (46 views)
2017-09-30 02:57:34

theagentd (69 views)
2017-09-26 18:23:31

cybrmynd (180 views)
2017-08-02 12:28:51

cybrmynd (178 views)
2017-08-02 12:19:43

cybrmynd (186 views)
2017-08-02 12:18:09

Sralse (191 views)
2017-07-25 17:13:48

Archive (740 views)
2017-04-27 17:45:51

buddyBro (868 views)
2017-04-05 03:38:00

CopyableCougar4 (1417 views)
2017-03-24 15:39:42

theagentd (1313 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!