Hello Guest

Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Lightweight Java Gaming Library / Re: Simple Question
« Last post by KaiHH on June 12, 2020, 09:09:33 »
Can I use the LWJGL 3 library for this
Of course. You will be totally fine in doing that. :) You can use LWJGL for personal/private, educational, open-source and also commercial projects.
License information: https://www.lwjgl.org/license
So, if you redistribute any of LWJGL's source or binary artifacts, you should simply distribute a copy of that license as a text file along with it.
You are also very welcome to join the LWJGL Slack team, if you want, for any questions about LWJGL/OpenGL/etc.: http://slack.lwjgl.org/
22
Lightweight Java Gaming Library / Re: Simple Question
« Last post by Swedberg on June 12, 2020, 06:23:13 »
Hello,
I'm a student from Austria (studying Game Engineering and Simulation Technology at Fachhochschule Technikum Wien) and I need to write a 3D game for a student's contest. Can I use the LWJGL 3 library for this and what about the license? Thank you.

Zach
23
OpenGL / Re: Blending question
« Last post by Aisaaax on June 10, 2020, 11:56:13 »
So, there really is no other way than rendering to texture and putting it on a quad in front of the screen?

I am a bit hesitant about doing two render passes like that, as I am working with ARM device that isn't really performant.

Is there a way to access current frameBuffer and make all fragments have alpha of 1? So that I could render part of the image, change alpha and then render the rest?
24
OpenGL / Re: Blending question
« Last post by KaiHH on June 10, 2020, 10:42:30 »
You need to composite the objects from group A and the objects from group B separately in a full-screen render pass.
So, if you don't need objects from group A to depth-sort with objects from group B (so only correctly depth-sort objects within a single group) and you want group A to overlay over group B transparently, then:
1. render group B to the final render target first with opaque blending (i.e. no blending)
2. render group A to a temporary render target (i.e. render to texture, also without blending)
3. do a full-screen pass (render a full-screen triangle or quad) sampling from the render target of step 2 and applying blending
25
OpenGL / Blending question
« Last post by Aisaaax on June 10, 2020, 09:47:26 »
Hello.

I have a specific task where I need to render a bunch of entities that can overlap a bit, and then I need the resulting figure to be transparently rendered on top of a bunch of other entities.
But I don't want entities within those two layers to be transparent in relation to each other.

I.e. Objects A, B, C are rendered together, they are not transparent towards each other and cover each other

Objects D, E, F and on the other layer, the same deal - they are not transparent to each other

But then Group A is overlayed over group B, and it is transparent.

Is rendering to texture the only way to do that?

One other question: I am currenly using
glBlendFunc(ONE_MINUS_DST_ALPHA, GL_ONE) to basically render the object "underneath" whatever is already in the frame buffer.
But if the contents of frame buffer have alpha below 1, the results are blended - i.e. transparency is applied.

Can I somehow make it not render the fragments AT ALL, if there's something already in the buffer?

Basically what I want is
glBlendFunc (SRC_ALPHA > 0 ? GL_ZERO : GL_ONE, GL_ONE)
26
Lightweight Java Gaming Library / Re: Screenshots using GPU.
« Last post by abcdef on June 09, 2020, 12:38:02 »
Sounds like a fun project!

LWJGL needs you to create a window (using GLFW) and that is the window context you have access to. I don't believe you can get access to the screen as a whole.
27
Lightweight Java Gaming Library / Re: I can't seem to find docs for imgui
« Last post by sp on June 02, 2020, 09:44:53 »
Dear ImGui binding for Java with renderer for LWJGL: https://github.com/SpaiR/imgui-java
28
OpenGL / Resetting context but keeping the data
« Last post by Aisaaax on June 01, 2020, 05:32:08 »
Is it possible to re-create context but keep the VAO/VBO's?

In my application, sometimes the window (surface) to which I render gets hidden completely. When it gets shown again - the surface ID changes, and I can't keep rendering to it with the context that I had before.

My solution is to close the context completely as soon as the surface gets hidden, and then create a new one when it gets re-opened.

The problem here is lots of data that I don't necessarily want to re-create. For example I have to triangulate shapes that are calculated in a different part of the program, and that work is quite CPU-intensive. Maybe I could instead just keep the previous VBO and use it? But all attempts have given me no success.

Maybe I'm missing something? Or maybe I can even do away with closing the context (again, I didn't find a solution).

It works as is, but I feel that it's sub-optimal.

Thank you!
29
Lightweight Java Gaming Library / Re: Loading texture arrays crashes the JVM
« Last post by Zeno on May 30, 2020, 19:57:00 »
You are using width=size[0] and height=size[1] which is probably fine, but then you are telling OpenGL that the depth=index.

Ah so I'm misinterpreting that third size component? The way I understood it, it refers to the index of the given sprite in the texture array. But when I read the documentation again, it seems to refer to the total amount of sprites that you are trying to load, is this correct? So to be fully clear, my line would have to look as follows

Code: [Select]
GL45.glTextureSubImage3D(ID(), lod, 0, 0, index, size[0], size[1], 1, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, data);
As an aside, I'm assuming this also means you can load multiple sprites through one call, and appropriately changing that '1' into however many sprites are stored in your data buffer? How would this data then have to be laid out? I assume the sprites cannot be interleaved, they would have to be stored in the buffer sequentially?
30
Lightweight Java Gaming Library / Re: Loading texture arrays crashes the JVM
« Last post by KaiHH on May 30, 2020, 18:51:33 »
This:
Code: [Select]
glTextureSubImage3D(ID(), lod, 0, 0, 0, size[0], size[1], index, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, data);
makes no sense. Please look at the definition of this function again: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexSubImage3D.xhtml
You are using width=size[0] and height=size[1] which is probably fine, but then you are telling OpenGL that the depth=index. So, later indexes will upload an always bigger and bigger sub-texture. This is wrong. Your slices all have the same size 128x128x1 (w x h x d). You should use index as the zoffset parameter instead.
Pages: 1 2 [3] 4 5 ... 10