Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (727)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (796)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 6 7 [8] 9 10
 71 
 on: 2017-05-16 12:33:42 
Started by Chennorris - Last post by Chennorris
Wow, feeling impressed by the speed at which you spotted the point Shocked
I'm gonna think about putting your name in the thanks part of my project (if it's released one day Grin)

Now, I have a Missing attachment error, but it seems far better than this 1280 error code


_____________________
EDIT :

I just un-commented the part where I was creating a texture and attaching it to the framebuffer and now I get the GL_FRAMEBUFFER_COMPLETE.
Thanks a lot Wink

 72 
 on: 2017-05-16 12:19:09 
Started by Chennorris - Last post by elect
1280 is GL_INVALID_ENUM

from the doc:
Quote
For glCheckFramebufferStatus, the framebuffer checked is that bound to target, which must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.

You are passing instead the fbo id/name and that's why the error

 73 
 on: 2017-05-16 12:00:06 
Started by Chennorris - Last post by Chennorris
Hello everyone,

I'm currently working on a new part of my JOGL project, following tutorials about Framebuffers (this one looks rather good to me). I'm stuck at the very beginning of this tutorial, with a strange status for my framebuffer (1280 does not seem to correspond to any status).

To understand a bit more my problem, here's how my code looks like :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
public static void renderAll(GLAutoDrawable drawable) throws NullPointerException {
    GL3 gl = drawable.getGL().getGL3();
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
    gl.glClearColor(0.3f, 0.3f, 0.3f, 0);

    // Enabling alpha transparency
    gl.glEnable(GL3.GL_BLEND | GL3.GL_PROGRAM_POINT_SIZE);
    gl.glBlendFunc(GL3.GL_SRC_ALPHA, GL3.GL_ONE_MINUS_SRC_ALPHA);
    gl.glPolygonMode(GL3.GL_FRONT_AND_BACK, isInPlayMode() ? GL3.GL_FILL : GL3.GL_LINE);

    // Updating camera position, direction and zoom
    CameraManager.updateCamera();

    SceneManager.renderIntoFramebuffer(gl, mainWindow.getWidth(), mainWindow.getHeight());

    gl.glFlush();
}

...

SceneManager.renderIntoFramebuffer(GL3 gl, int viewportWidth, int viewportHeight) {
    // Creation of the framebuffer
    IntBuffer idFramebuffer = GLBuffers.newDirectIntBuffer(1);
    gl.glGenFramebuffers(1, idFramebuffer);
    gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, idFramebuffer.get(0));

    // Checking the framebuffer status
    int framebufferStatus = gl.glCheckFramebufferStatus(idFramebuffer.get(0));
    switch (framebufferStatus) {
        case GL3.GL_FRAMEBUFFER_COMPLETE:
            logger.info("Framebuffer is complete :)");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
            logger.error("Incomplete attachment");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
            logger.error("Incomplete dimensions");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
            logger.error("Incomplete draw buffer");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
            logger.error("Incomplete layer targets");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
            logger.error("Incomplete read buffer");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
            logger.error("Missing attachment");
            break;
        case GL3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
            logger.error("Incomplete multisample");
            break;
        case GL3.GL_FRAMEBUFFER_UNDEFINED:
            logger.error("Undefined");
            break;
        case GL3.GL_FRAMEBUFFER_UNSUPPORTED:
            logger.error("Not supported");
            break;
        default:
            logger.warn("Unknown framebuffer status (" + framebufferStatus + ")");
    }
    gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
    gl.glDeleteFramebuffers(1, idFramebuffer);
}


In my logs, the only result I obtain is "Unknown framebuffer status (1280)".
Do you see anything I could have forgotten / made wrong ?

Thanks in advance for your help Smiley

 74 
 on: 2017-05-16 09:38:12 
Started by 0AndrewShepherd0 - Last post by KaiHH
By "stretching the screen" you likely mean: Upon changing the aspect ratio of the viewport/window, you do not want the rendered objects to be stretched but keep their respective length ratios.
Or in short: No matter how you resize your window, a rendered unit square should always remain a unit square and not a stretched rectangle.

If so, then you can achieve this by changing the GL_PROJECTION matrix like so:
1  
2  
3  
4  
5  
GL11.glMatrixMode(GL_PROJECTION);
GL11.glLoadIdentity();
float aspect = (float)windowWidth/windowHeight;
GL11.glScalef(1/aspect, 1, -1);
/* Do any other coordiante system transformations... */


or if you want to specify the coordinate system bounds (left, right, bottom, top), you can use glOrtho which gives the same result:
1  
2  
3  
4  
GL11.glMatrixMode(GL_PROJECTION);
GL11.glLoadIdentity();
float aspect = (float)windowWidth/windowHeight;
GL11.glOrtho(-aspect, aspect, -1, 1, -1, 1);


Also interesting to note is that all of the above is also equivalent to this:
1  
2  
3  
4  
5  
GL11.glMatrixMode(GL_PROJECTION);
GL11.glLoadIdentity();
float aspect = (float)windowWidth/windowHeight;
GL11.glScalef(1/aspect, 1, 1);
GL11.glOrtho(-1, 1, -1, 1, -1, 1); // <- or any other bounds

However, now you can specify the visible bounds as if you had a square viewport and then still react to changing aspect ratios.

Now, if you do not want to use OpenGL's matrix stack and instead use shaders, there are other Java matrix libraries to build matrices for sending to a shader. But in essence, they all do the same as the above.

If by "stretching the screen" you mean that the viewport should always fill the window's client area, then do:
1  
GL11.glViewport(0, 0, windowWidth, windowHeight);

 75 
 on: 2017-05-16 07:31:38 
Started by Ecumene - Last post by EpicGuru
Great, thanks! That cleared some things up, I'll be glad to get some feedback to you. Best of luck!

 76 
 on: 2017-05-16 05:10:51 
Started by simulatoralive - Last post by 65K
My thoughts:

When finding a solution for versionising data, these are two different things:
The concept itself and the way to store data. Using text, binary, json or xml is not part of the design at first place.

One main part of a data version concept is about processing the data.

Your approach is actually not using zip files, but a file system (thats what you get with zip files). Nothing fundamentelly wrong with that of course.

Always favor simple solutions. Not clearly separating versioned data lets complexity explode.

 77 
 on: 2017-05-16 04:15:41 
Started by 0AndrewShepherd0 - Last post by 0AndrewShepherd0
I'm using LWJGL 3 for a 2d hacking simulator game. I want the screen to just be stretched upon resizing the window. How can this be done? I've looked at several posts on various forums and stackoverflow, but what everyone is saying seems to be outdated. I'm using version 3.1.2 Stable if that matters.

 78 
 on: 2017-05-16 02:57:23 
Started by Optimo - Last post by philfrei
@Optimo -- I started work on a Clip that allows concurrent playback. You can download it from the SharedCode area.

I think the next step will be providing a way to do normal Clip things like position the cursor and loop. Then I'll get a real-time volume control working based on one I've used before. It spreads the volume change out over 1024 frames which is quick enough for most perceptions where fading is occurring and small enough increments to prevent zippering. Will try to find time to do this before end of May.

 79 
 on: 2017-05-16 01:01:37 
Started by Xolitude - Last post by Xolitude


Hey guys!

Since March 9th, I've been working on my very first game, Plexis. Plexis is an orthographic 2.5D survival game. The idea sparked from my love for both video games and the survival genre. Technically, I have worked on a game before. The game was called Elements and it was a Terraria clone-type game. But, unfortunately, a lot of that game was somewhat copy/paste and I was a little too young to have the patience to actually learn what I needed to and I didn't "know" how to enjoy simply writing the code. Last summer, I began doing some more research on things like Photoshop and the math that goes into a game like this and I found it very interesting. Since I've started working on it, I enjoy every part I write (and this is a solo project). It's just fascinating to see what you code can appear on screen, like an image or an entire user-interface. Also, this is my very first time working in Photoshop and I am very proud of what I've created so far in terms of UI. Here are the previews:


When you type a name >=3 letters, the "Create" button appears in-case there was any confusion on that.






All of the icons on screen are just taken off of Google except the hotbar icons but none of them are trademarked or anything like that. They are all free to use but are just placeholders. The tilesets are just placeholders as well.



All of the assets BESDIES the icons and tilesets I mentioned, are mine, which is also a very nice feeling. Plexis has no current single-player story or anything, it'll just be start and play. Multiplayer is planned as well. I don't have a current list of all of the features within the game thus far, but the features as usual does not do the amount of code justice xD Anyways, this will be the main thread I keep updates at and such so if you like this project or appreciate the work, I invite you to follow my progress Smiley Watching projects grow on Java-Gaming made me want to begin game-development and I appreciate this community so thank you all. If you have any questions or suggestions or constructive feedback, please reply Smiley


 80 
 on: 2017-05-15 19:31:05 
Started by Spasi - Last post by theagentd
Oh, man, this is awesome! I've never heard of MoltenVK, maybe that'll save MacOS for now. I also didn't know that stb_dxt existed, gotta try that out! Also, stb_image now supports 16-bit PNGs, which are perfect for normal maps!

Pages: 1 ... 6 7 [8] 9 10
 
Archive (294 views)
2017-04-27 17:45:51

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

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

theagentd (941 views)
2017-03-24 15:32:08

Rule (952 views)
2017-03-19 12:43:22

Rule (921 views)
2017-03-19 12:42:17

Rule (922 views)
2017-03-19 12:36:21

theagentd (983 views)
2017-03-16 05:07:07

theagentd (897 views)
2017-03-15 22:37:06

theagentd (692 views)
2017-03-15 22:32:18
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
java-gaming.org 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‑gaming.org
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!