Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (208)
games submitted by our members
Games in WIP (781)
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 3479 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: 113
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.

Galdo (420 views)
2017-01-12 13:44:09

Archive (575 views)
2017-01-02 05:31:41

0AndrewShepherd0 (1048 views)
2016-12-16 03:58:39

0AndrewShepherd0 (972 views)
2016-12-15 21:50:57

Lunch (1104 views)
2016-12-06 16:01:40

ral0r2 (1339 views)
2016-11-23 16:08:26

ClaasJG (1433 views)
2016-11-10 17:36:32

CoffeeChemist (1420 views)
2016-11-05 00:46:53

jay4842 (1503 views)
2016-11-01 19:04:52

theagentd (1252 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!