Quarry
|
 |
«
Posted
2012-10-21 07:24:32 » |
|
What I got is 2, what I want is 1, how do 
|
|
|
|
|
Phased
|
 |
«
Reply #1 - Posted
2012-10-21 07:27:25 » |
|
Cant tell the difference? I'm assuming the top one is drawn with some graphic program. maybe explain more then. how do
|
|
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
DazKins
|
 |
«
Reply #3 - Posted
2012-10-21 08: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
|
|
|
|
Quarry
|
 |
«
Reply #4 - Posted
2012-10-21 08:29:00 » |
|
I know what I should be using however I'm not sure how I'll do that
|
|
|
|
|
kappa
|
 |
«
Reply #5 - Posted
2012-10-21 08: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.
|
|
|
|
|
StumpyStrust
|
 |
«
Reply #6 - Posted
2012-10-21 08:51:17 » |
|
kappa you beat me to the punch was a bout to say go for a frame buffer.
|
|
|
|
|
Quarry
|
 |
«
Reply #7 - Posted
2012-10-21 09: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) http://pastebin.com/FeuymYkg
|
|
|
|
|
Danny02
|
 |
«
Reply #8 - Posted
2012-10-21 10: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 1 2 3
| glBindFramebuffer(GL_READ_FRAMEBUFFER, frameBufferID); glBindFramebuffer(.GL_DRAW_FRAMEBUFFER, 0);glBlitFramebuffer(0, 0, framebufferWidth, framebufferHeight, 0, 0, monitorWidth, monitorHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST); |
|
|
|
|
|
Quarry
|
 |
«
Reply #9 - Posted
2012-10-21 10:51:41 » |
|
Ooh! That's really neat too
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Quarry
|
 |
«
Reply #10 - Posted
2012-10-21 16:16:27 » |
|
Shameful revival, I recently attempted to rewrite the whole thing to make it look neater http://pastebin.com/MqKWphytHowever it doesn't seem to work, did I miss something? I did a completion check on it and it all seemed quite fine
|
|
|
|
|
Danny02
|
 |
«
Reply #11 - Posted
2012-10-21 19: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
|
|
|
|
|
Quarry
|
 |
«
Reply #12 - Posted
2012-10-21 20:41:55 » |
|
I have no idea how I'm supposed to do that, but I noticed that I didn't set a depth buffer http://pastebin.com/Eb4cbh7NStill no luck though
|
|
|
|
|
Quarry
|
 |
«
Reply #13 - Posted
2012-10-22 15:55:27 » |
|
1 2 3 4 5 6 7
| 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, S_HEIGHT * S_SCALE, GL_COLOR_BUFFER_BIT, GL_NEAREST); } |
Changed the stuff to what you asked but still no luck
|
|
|
|
|
|