Questions tagged [lwjgl]

The Lightweight Java Game Library (LWJGL) provides access to high performance, cross-platform libraries OpenGL and OpenAL. Additionally LWJGL provides access to controllers such as Gamepads, Steering wheel and Joysticks.

54 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
4k views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
Allar Viinamäe's user avatar
3 votes
0 answers
322 views

Strange normal mapping artifacts - OpenGL / GLSL

I have been following a few tutorials to learn some graphics programming with OpenGL, and recently implemented Normal Mapping. It works well for the most part, especially for objects with normal-...
cstr_'s user avatar
  • 31
3 votes
0 answers
218 views

Voxel Game - Lag when camera is inside of the terrain

I am making a voxel game in OpenGL and I currently render 8 x 8 chunks to the screen. The first thing I do is generate the map using Simplex Noise and this is done once when the chunk is created. I ...
AtomProgrammer's user avatar
2 votes
1 answer
2k views

App using LWJGL can't find display mode extension on Linux

I'm running LWJGL app on Ubuntu virtual machine with no phisical graphic card. I set up Xvfb and Mesa3D but it fails with exception ...
Viktor Stolbin's user avatar
1 vote
0 answers
46 views

Pros and cons of caching uniforms

I am using LWJGL, and I have a ShaderProgram class that abstracts a GPU shader. I have a bindUniform(int location, Object value) ...
Eilan Laken's user avatar
1 vote
0 answers
61 views

LWJGL3. A strange graphic artifact of OpenGL 3.x

I work in java with lwjgl3. I came across a strange artifact, the source of which I have not been able to determine for a very long time. I'm drawing a large surface. When I approach this surface and ...
alfabouh's user avatar
1 vote
0 answers
156 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
1 vote
0 answers
145 views

LWJGL Using gl_VertexID properly?

I've gotten back to making lwjgl games, and I'm trying to make a sort of wave type vertex shader. I call this to make it wave: ...
Pale_Gray's user avatar
1 vote
0 answers
192 views

MousePicking in LWJGL - How to do it?

I have been working on a mouse picker for a scene in 3d for a client, and been having issues implementing a proper mouse pick. His application does not use a camera, and I am trying to get the ray ...
Dillan's user avatar
  • 11
1 vote
0 answers
238 views

OpenAL listener position for isometric camera

I have an isometric camera for an RTS that looks like this: Basically, I don't know how to set the listener's position in OpenAL because I represent the camera's position with only two coordinates. ...
user5074736's user avatar
1 vote
0 answers
111 views

Why is the texture all wrong on my model?

Why is this happening? If possible I'd like to know what this particular problem is called. The model is a simple cube made in blender and exported with normals and MTL. Texture is the cube unwrapped ...
Vlad's user avatar
  • 11
1 vote
0 answers
53 views

Creating a playlist with LWJGL and OpenAL

I'd like to know how to create a playlist for the music in my games. I use LWJGL, and know a bit of OpenAL, however I can't figure out how to test for when a song is over. I want to be able to play ...
GiraffeKey's user avatar
1 vote
0 answers
53 views

Font loads with artifacts

I've recently come on to an error when loading fonts in my game, some letters show up perfect while others have artifacts around them. Here's an example of this: While some letters are perfectly ...
Liam Larsen's user avatar
1 vote
0 answers
102 views

How can I draw a snapshot of the game within the game?

I'm making a game in libGDX wich the main focus is "recursion", so I can play multiple instances of the game in itself, flowing through "layers" of games. Currently its mechanics work perfectly, but I'...
vilok600's user avatar
1 vote
0 answers
152 views

Creation of block mesh for minecraft like chunk

Problem: I'm trying to build a naive mesh for a "chunk" of 2x2x2 blocks. But the "mesh" i create is 3x3x3 blocks (i don't understand why?) and the "extra cubes" are not like i intendet them to be (...
Karoc's user avatar
  • 21
1 vote
0 answers
151 views

Rendering blocks in lwjgl, problems with VAO & VBO

//EDIT: Found the solution: had to use GL11.glDrawElements instead of DrawArrays. I'm working on a "voxel based world" engine. At the moment my approach follows these steps: Creation of a Mesh: ...
Karoc's user avatar
  • 21
1 vote
0 answers
206 views

Converting glsl shaders

I need to convert these shaders from #version 400 core to #version 130 successfully but for some reason when I do it my models are not rendering properly when I load more then one type and I cant find ...
Kaboom's user avatar
  • 127
1 vote
0 answers
59 views

Can I "Pre-rotate" VBOs while loading them in LWJGL?

It is possible to flip VBOs horizontally and vertically by swapping around destination coordinates. Is it possible to rotate an image by any angle, such as 45 degrees, using different destination ...
Lucien's user avatar
  • 1,176
1 vote
0 answers
354 views

How to draw a 3D triangle using a VBO in OpenGL with LWJGL?

I am using LWJGL, took me about 4 hours of hard work to achieve triangle rendering and VBOs. I want to render a triangle in 3D space. I know you have to use projection matrices but when I have a ...
EEVV's user avatar
  • 171
1 vote
0 answers
352 views

Texture artifacts depending on texture size

I get some strange artifacting with textures depending on their size. I run OpenGL 3.3 with an GTX 580 so it should definitely support non power of two textures. I've narrowed down the problem ...
user avatar
1 vote
0 answers
2k views

How to toggle fullscreen with lwjgl

I'm using glfw in lwjgl-3 to try to create a toggleFullscreen method. However it always gives me errors. I saw this question Toggle Fullscreen at Runtime but it didn't help because glfwOpenWindow() ...
Lemonzap's user avatar
1 vote
0 answers
648 views

Adding 2d hud/gui to a 3d game engine which has no 2d features

I have been following the 3d game engine tutorial series made by theBennyBox for a few months now, and have finally decided to create a game with it. My problem is that it is a 3d only engine which ...
Cryptoclysm's user avatar
1 vote
0 answers
470 views

How to export from Eclipse with LWGJL using JarSplice?

I am in the process of developing a 2D tile-based RPG with Eclipse, LWJGL, and Slick utilities. For some reason eclipse seems to be lagging heavily which doesn't make sense as all I have rendering is ...
Ben Marshall's user avatar
1 vote
0 answers
447 views

Why do my LWJGL fonts have dots and lines around them?

When we render fonts there are weird dots and lines around the text. I have no idea why this would happen. Here is an image of what it looks like: Our font class looks like this: ...
Jordan Schnur's user avatar
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
0 answers
44 views

LWJGL Shader not displaying anything to the screen

My basic shader program isn't displaying anything to the screen. Please Help! Here's my code: ...
pcarroll17's user avatar
0 votes
0 answers
144 views

LWJGL removing voxel faces that are not visible

I am simply trying to achieve removing voxel faces that are not visible.What I have coded simply renders a chunk of 16x16x16. I already have back face culling enabled, which it does work. so as I'm ...
Solodobo's user avatar
0 votes
0 answers
121 views

Having GUI on side rather than on game screen

How would I make it so that rather on the game screen the GUI is on the side of the screen and puts the game screen in its own little area so that its not covering part of the screen because right now ...
Zwei's user avatar
  • 1
0 votes
0 answers
433 views

Implementing material (mtl) files into objects (obj) in LWJGL/OpenGL

I have an object loader that takes in textures, but when I try making some textures, they never turn out exactly how I want. I found out that a lot of them take a colour I want in one place and put it ...
Zwei's user avatar
  • 1
0 votes
1 answer
83 views

LWJGL2 Camera Movement Stutter

I'm having quite some trouble with camera stutter in my LWJGL2 game. The stutter only occurs when moving the camera. When it stands still, the scene is rendered smoothly. I could verify that by ...
user avatar
0 votes
1 answer
389 views

Improve cube rendering performance in lwjgl

I've been coding a minecraft-like game in lwjgl using cubes. I've reached a point where I can render 6 chunks of blocks before it starts lagging. I've searched online for optimizations and one of the ...
xGolden's user avatar
0 votes
0 answers
125 views

OBJ file loader texture coordinates ‘scrambled’

Edit I've rewritten the loader to duplicate data if only one element (v, vt, vn) is different. I get a much better result, but it is still incorrect. The seams on the mesh match what they should look ...
TheIceCubeDude's user avatar
0 votes
0 answers
33 views

Directional lighting messups with uniforms

Recently, I've been making a 3D game, and I have more progress! I am trying to implement lighting, but when I want to change the directional light uniform manually, it gets weird. Here's an example ...
Pale_Gray's user avatar
0 votes
1 answer
409 views

opengl (lwjgl) - only white triangle gets rendered, vertex and fragment shader not responsive

Currently my program can only render my vertices as white and changes in my vertex and fragment shader don't change what gets rendered for some reason i.e: (...
user8380672's user avatar
0 votes
0 answers
120 views

How to move player camera with mouse in LWJGL 2?

I making a 3D game like Minecraft in LWJGL 2 and now, I want to move player camera with mouse like Minecraft. Here are the codes I have: com/kg/kgcraft/KGCraft.java: ...
sbh's user avatar
  • 1
0 votes
0 answers
36 views

How to grab numbers in glVertex3f?

Recently, I've been making a game. I do not want to try to use VAOs and VBOs because I cannot wrap my head around that stuff. But, in order to use custom shaders, I need an arraylist of things to add ...
Pale_Gray's user avatar
0 votes
0 answers
55 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
0 answers
124 views

Repeat/Scroll texture on CubeMap

I need a method to scroll an image across all sides of a cube map in a way similar to scrolling a UV texture across a water's texture to give the appearance of movement by shifting the normals. I want ...
TheGamerPlayz's user avatar
0 votes
0 answers
663 views

Flickering / tearing with glfwSwapBuffers

I recently separated my logic and rendering threads to fix this problem: GLFW window freezes on title bar hold/drag This means the logic and rendering are no longer running in lock-step as they were ...
Dan's user avatar
  • 255
0 votes
0 answers
870 views

Drawing 2D text over 3D scene OpenGL3.3

I got a question regarding rendering a 2D text over the 3D scene in OpenGL 3.3. I followed this tutorial about how to render text in OpenGL. Although the tutorial is for C++ i ported it to Java (...
Maroš Šeleng's user avatar
0 votes
0 answers
44 views

LWJGL Applet Security Exception

I created small game in Java using LWJGL 2.9.3 and would like to add it to webpage as Java applet. I have followed this tutorial and have used this app loader. All the Java code works and I can tun ...
Blunderchips's user avatar
0 votes
0 answers
100 views

OpenGL model rendering issue

Currently my game will not display models properly on my PC but they load right on a pc that supports openGL 3.0, and as my laptop only supports 2.1 the last model rendered will show properly but the ...
Kaboom's user avatar
  • 127
0 votes
0 answers
176 views

Java LWJGL and Slick2D collision with 2d array based map

So I've been making this game recently in java w/ LWJGL (2) and Slick2d. I've done some stuff like the map; it's a simple 2d array it goes through it and based on what id it is its gonna draw that ...
Ivan Jerza's user avatar
0 votes
0 answers
172 views

LWJGL 3 - Random Sprites Don't Blend

Some of my sprites don't "Blend" in with tiles behind them Z-wise. glEnable(GL_DEPTH_TEST); Depth testing is enabled and works. ...
Lucien's user avatar
  • 1,176
0 votes
0 answers
1k views

Modern OpenGL Sprite Drawing - Not Rendering

I'm trying to render sprites based of this tutorial, in LWJGL. Here's what I have so far, with descriptions of what class I use: Transformable2D is a class that ...
Tetramputechture's user avatar
0 votes
0 answers
271 views

how to do picking in 2d lwjgl

I searched the whole internet, but I couldn't find something useful. How to do picking (like ray picking) in lwjgl in orthographic mode (2d)? I think this is less confusing than picking in 3d, but I ...
user2190492's user avatar
0 votes
0 answers
152 views

Why must VBOs be "broken in?"

If I create a VBO in LWJGL of, say, 128,000 vertices, and push it to the graphics card, there's a considerable delay. This delay lasts for about 11 to 12 milliseconds. The same thing happens the ...
caseif's user avatar
  • 442
0 votes
1 answer
99 views

Very small line when two sprites are exactly next from eachother

Recently, I have been thinking about a hangout game, not really need to go into detail, because I am focusing on creating the engine itself. Basically just to make my brain not hurt while making the ...
Pale_Gray's user avatar
0 votes
1 answer
331 views

LWJGL - Keyboard.next() not firing

I am trying to make a class which will handle all of my inputs, however Keyboard.next() isn't returning true. Here is my code. ...
Brian's user avatar
  • 111
-1 votes
1 answer
1k views

Java - LWJGL OBJ Loader with Materials not rendering

So I successfully loading my obj file but I obviously want to get materials on it. I added the vt(texture) to the OBJLoader and the Model.render but still rendering textureless. I have exported the ...
user76273's user avatar