Questions tagged [lwjgl3]

LWJGL is an open-source cross-platform library in Java for game developers.

Filter by
Sorted by
Tagged with
1 vote
0 answers
150 views

Java/LWJGL 3 Optimization and Render error

(I asked the same question on StackOverflow but didn't got an answer. It's the first time I post here so idk if this is not allowed or anything, so if it is please tell me) I was following ThinMatrix'...
Renan Lima's user avatar
0 votes
2 answers
153 views

Vertexes passed to OpenGL becoming zero

I've got two methods of test code. The first uses a single VBO with the vertices and texture coordinates interwoven to draw a square to the window. The second uses an array of three VBOs to define the ...
CreedVI's user avatar
0 votes
0 answers
51 views

Problems arise when using a VBO compared to a uniform for mat4

I've been learning LWJGL and was originally using instancing and using a uniform to send all the mat4 data to the shader for the individual positions. I'm trying to switch to using a VBO for this ...
William Crain's user avatar
0 votes
1 answer
255 views

LWJGL 3 HelloWorld example crashing

I'm trying to start LWJGL 3 development and I am having an issue with getting things working. I have created a new Gradle project and successfully built the HelloWorld example from https://www.lwjgl....
Robin Elvin's user avatar
0 votes
1 answer
174 views

Faster way to load VBOs in LWJGL

I'm currently working on a Minecraft clone for a university project and I'm having some trouble loading a lot of chunks at the same time without reducing performances. What I'm currently doing is: ...
Tito Tigi's user avatar
0 votes
0 answers
125 views

LWJGL 3 - problem with flickering when rendering terrain with colors

For while now I m trying to built a terrain generator for my game engine and again I'm stuck with problem. I'm trying to generate a terrain using colors, so no textures. In short my problem is ...
Filip Cacic's user avatar
0 votes
1 answer
396 views

Rendering multiple textures on same image for terrain with index buffers (LWJGL 3)

I have started with LWJGL3 and trying to built game engine. I'm stuck on generating terrains and this is my second big problem and I'm exhausted so I need some advice on how to solve my problem. What ...
Filip Cacic's user avatar
2 votes
1 answer
156 views

Problem with rendering multiple textures from same image (LWJGL 3)

I have started with LWJGL3 and trying to built game engine. I'm stuck on generating terrains. I have one image that contains two textures. So now for example I want to generate terrain with only ...
Filip Cacic's user avatar
1 vote
1 answer
608 views

LWJGL3 shader code doesn't work

So I made a program to draw a simple cube with colors at each vertex. The program worked fine until I added shaders. It was using vbos and indicies and it did draw a colored cube like it should. So ...
mooncat39's user avatar
0 votes
1 answer
44 views

moving object while being snapped to another one lwjgl

hi now I want to move an object(cube) while being snapped to the surface of another one (sphere) with the same surface of the cube how can i achieve this in lwjgl here is a diagram. to describe my ...
Ahmed Elshorbagy's user avatar
1 vote
1 answer
389 views

I don't understand code that builds 3D sphere

I'm trying to learn some lwjgl and opengl, and I was trying to make a 3d sphere etc, I found a code to do that, but I don't 100% understand the code and the math behind it and would like to get some ...
msacco's user avatar
  • 11
1 vote
1 answer
347 views

Unexpected lighting on cube

I am following a tutorial for 3D game development in Java, using LWJGL. I have completed all chapters up to chapter 14 - Terrain, inclusive. The tutorial is in Java, but I'm using Scala. My full code ...
summerbulb's user avatar
0 votes
1 answer
677 views

How to rotate a sprite in 2D with LWJGL3 and GLSL

I have all the basic rendering already set up, with translation, scaling etc. What matrix(s) and/or vector(s) do I need to multiply/add with my existing code to rotate an object. Preferably around a ...
codedcosmos's user avatar
1 vote
0 answers
59 views

Missing any kind of lights?

I am trying to make my first 3D game in OpenGL with Shaders (LWJGL3) I read and follow a lot of tutorials but can't figure it out what kind of light I am missing here? The wall doesn't get any effect ...
Thai Doan Nam's user avatar
0 votes
1 answer
48 views

OpenGL (Java) FrameBuffer DepthTexture doesn't works

I have written a Java class for a FrameBuffer and the DepthTexture is simply black or white depending on the order of the creation of the DepthTexture and DepthRenderbuffer. If the ...
HenrikD's user avatar
  • 101
0 votes
1 answer
633 views

2D Screen Coordinates to 2D World Coordinates in LWJGL

I'm making a 2d top down game with lwjgl and am having trouble converting my 2d screen coordinates to 2d world coordinates. Here's what I have so far ...
antkiew's user avatar
0 votes
1 answer
358 views

Coordinate system not working properly! OpenGL

I am learning opengl and tried to add texture to a rectangle using ...
Anish Silwal's user avatar
0 votes
1 answer
2k views

How to use quaternions with JOML and LWJGL3

I'm implementing a space fps game (there is no up or down in space!) using LWJGL3 and JOML (math library). Entities in my game have a rotation based on the Forward, Up and Right vectors. I use pitch, ...
Marcus Persson's user avatar
1 vote
0 answers
598 views

How to load data from stbi allocated memory into java managed memory?

LWJGL3 provides me with simple wrappers around nothings' stb libraries. In order to load images I thus make use of the stb_image wrapper. My issue is that when I use this wrapper library, all I get ...
dot_Sp0T's user avatar
  • 2,012
1 vote
1 answer
397 views

Loading WAV and MP3 files with LWJGL 3?

Whenever I research audio in LWJGL 3, they always use STB which can only load Ogg files. All of my audio files are in either WAV or MP3 format, and it would be annoying to have to convert all of them. ...
GiraffeKey's user avatar
1 vote
0 answers
98 views

When should I use auto-managed buffers in LWJGL 3?

LWJGL3 has two methods of creating buffers that I know of: Auto-managed buffers that clean up the buffers automatically using the MemoryStack class, and manually managed buffers that must be manually ...
GiraffeKey's user avatar
1 vote
1 answer
3k views

LWJGL 3 how to convert screen coordinate to world coordinate?

I'm trying to convert screen coordinate to world coordinate on mouse click event. For LWJGL 3 there's not GLU utility class is available whereas LWJGL 2 has. I'm using JOML math classes and wrote ...
digz6666's user avatar
  • 125
1 vote
2 answers
888 views

How to render multiple triangles using single VBO in OpenGL (LWJGL)?

I'm new to OpenGL and trying to render multiple triangles using single VBO in using LWJGL3. I've followed demos and read some books and wrote following code, but its not drawing my shape. I use vertex ...
digz6666's user avatar
  • 125
-1 votes
1 answer
2k views

LWJGL3 key released and pressed

How to make a method in LWJGL 3 that when you press a key it tells you when its pressed and when its released only one time.
zin's user avatar
  • 133
0 votes
1 answer
2k views

OpenGL drawing multiple polygons with different colors with VBOs

I'm trying to change my program to use VBOs instead of immediate rendering for performance reason. The rendering consists of thousands of hexagons, all of the same size/shape. Each hexagon has a ...
Lucas Pickering's user avatar
3 votes
1 answer
1k views

How do I get antialiasing in LibGDX with the LWJGL3 backend?

Updated to the LWJGL3 backend for LibGDX to for controller connect / disconnect functionality and access to geometry shaders and I'd rather not go back. There used to be a "samples" field in the ...
Okinawa Terminal's user avatar
1 vote
1 answer
307 views

Does GLSL support multitexturing?

I am using LWJGL libraries to code myself a game. I want to be able to import a project from blender to my game. I have the wavefront .obj reader and it works perfectly for my needs. Although because ...
Abdallah Hasan's user avatar
3 votes
3 answers
857 views

glDrawElements/Arrays not working

Given the following OpenGL call stack. According to my knowlegde, the calls to glDrawElements/Arrays are ok.(?) But, they do not draw anything. (There is no triangle) The calls to glBegin() and ...
stelar7's user avatar
  • 143
0 votes
2 answers
285 views

Is Orthogonal in LWJGL 2D or 3D?

I'm attempting to develop an orthogonal game with lwjgl 3 and OpenGL in Eclipse, but I can't find an answer for rendering objects in 2D or 3D. Are both applicable? And if so what are the advantages of ...
Jaich's user avatar
  • 101
0 votes
2 answers
274 views

LWJGL - My glsl code somehow does not work

I am following the tutorial "3D Game Development with LWJGL3" using LWJGL 3.0.2(stable) https://www.gitbook.com/book/lwjglgamedev/3d-game-development-with-lwjgl/details I am following the chapter "...
EnderNinja7's user avatar
0 votes
1 answer
475 views

Lwjgl on android

How do I compile a lwjgl program written in java with openGL and glfw to run on android. I Should use openGL es for android..But how to create context for gles and input for touch screen. Update: ...
Yashwanth CB's user avatar
0 votes
1 answer
362 views

Heightmap vertex list to vertex + index list

Right now I'm trying to load a heightmap into my LWJGL application. I load it like that into a float[][] array and I can read the height value at a given x and z position in the map: ...
kessler bebe's user avatar
0 votes
1 answer
977 views

LWJGL 3.0.0 glMapBuffer

I am currently working on a project and usually in C++ I use the function. ByteBuffer glMapBuffer(int target, int access) usage: ...
Tripl3Fac3's user avatar
0 votes
1 answer
321 views

Mac OSX GLFW Fullscreen Crash

Whenever I run my code to make a fullscreen GLFW window, it crashes. Here is the code: ...
James's user avatar
  • 1
2 votes
1 answer
1k views

Setting up a custom cursor image in LWJGL 3

How can I load a custom cursor image with LWJGL3? It took me a while to figure this out. Here is how it is done for version 3.0.1. Hope this helps.
xoric's user avatar
  • 175
0 votes
2 answers
970 views

2D Camera in LWJGL 3

I am trying to implement a simple 2D camera in LWJGL3. The camera has an orthographic projection and can move in 2D space. This is run once at game start-up: ...
sdgfsdh's user avatar
  • 275
0 votes
2 answers
23k views

How is it possible to call abstract methods from another class? [closed]

Im creating a game using LWJGL and just as a bit of organising I made an Abstract class called Game so I could extend Game in my main class The game class is like so - ...
Hamish's user avatar
  • 11
0 votes
1 answer
798 views

How to export slick2d game into a jar with the res and native folder

I am a beginner in Slick2D. I use jarspliceJarSplice to output Slick2D game. But, but it is export all thingexports everything into one jar. I want to export one jar with the res andand native ...
casper's user avatar
  • 3
1 vote
1 answer
123 views

TiledMap render uses 15% of my cpu

I am a beginner in Slick2D. I used TiledMap render in my game,but I do not know why it use 15%cpu and how to fix it. I used map is 1024*768. This is a part of my code. Thanks for any help ...
vn7's user avatar
  • 11
0 votes
2 answers
3k views

Optimising Voxel World Rendering

There are a couple of questions like this already. This one is different because it is specifically about rendering, as opposed to navigation and generation. I've implemented suggestions from here ...
Lucien's user avatar
  • 1,146