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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
38 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
0 votes
0 answers
35 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
117 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
2 answers
158 views

LWJGL With Modern OpenGL

I have a question. I am following ThinMatrix's tutorial on YouTube which is about making a 3d game with lwjgl. He uses OpenGL v3.0 and higher. However, my built-in graphic card supports only OpenGL ...
Yuri's user avatar
  • 3
0 votes
0 answers
108 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
350 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
75 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
2 votes
1 answer
59 views

Only Square Textures loading correctly (Beginner question)

(Sorry if this has already been asked, I couldn't find any other question or source describing my problem) Okay so basically Square textures load and display just fine. But for some reason, when ...
DindinYT37's user avatar
1 vote
0 answers
149 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
1 answer
152 views

Move between two points at a constant speed in LWJGL

I've been making a game engine in lwjgl and I have been trying to get an ai to move from one point to another. I used a lerp method but the speed is dependent on the distance between the two points, ...
user avatar
1 vote
0 answers
132 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
0 votes
1 answer
478 views

Rendering order objects with transparency?

I do not know if this question might have been asked before, but which method for rendering transparency is more efficient in terms of less lag?: Rendering the scene from front to back with respect ...
Dstarred's user avatar
  • 103
0 votes
1 answer
351 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
1 answer
96 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
0 answers
117 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
1 answer
412 views

Not understanding how indices and texturePositions are mapped to vertices in LWJGL

I've been following this tutorial on OpenGL and LWJGL and at some point three different lists are introduced without really explaining how they interact with each other. Can someone explain how it ...
xGolden's user avatar
0 votes
1 answer
917 views

Building an LWJGL jar file - java.lang.NoClassDefFoundError

EDIT: Recently got it working by making a batch file that does this: set /p CP=<cp.txt java -cp %CP%;testing.jar me.pale.main.Main and cp.txt is this ...
Pale_Gray's user avatar
0 votes
1 answer
395 views

Why is my OpenGL code not rendering anything?

I have been following the LearnOpenGL Hello Triangle tutorial, and nothing is rendering except the clear color. Any help finding what is wrong would be appreciated. Using LWJGL 3.2.3 OpenGL and GLFW ...
avalonbox's user avatar
0 votes
0 answers
32 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
353 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
110 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
-1 votes
1 answer
231 views

Shaders overriding other shaders

Recently, I've been making a 3D game and I have been having trouble with making multiple shaders. I've researched this for a bit, and told that I had to use ...
Pale_Gray's user avatar
0 votes
1 answer
138 views

FBO not rendering or changing anything

Recently, I am making a 3D game. I want to do special post processing effects, like pixelization. I used this to load do everything with FBOS, but it's kindof weird... In some code for the ...
Pale_Gray's user avatar
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
2 answers
266 views

How to use vertex and fragment shaders without using VBOs and VAOs?

Recently, I am trying to make a 3D game in LWJGL 2, not LWJGL 3, just because I am more familiar with LWJGL 2. Since LWJGL decided to shut down their legacy wiki website, I've been researching alot ...
Pale_Gray's user avatar
1 vote
1 answer
538 views

LWJGL - How to draw text on screen

After some months on libGDX, I chose to make a little java game library based on LWJGL. I have already tried to do it, but got stuck on this same problem: how render text on screen. The first time, I ...
DynoZ's user avatar
  • 25
0 votes
1 answer
164 views

Check if point lies within coordinates

Let's say I have min (0,0,0) and max (1,1,1). If I have 3 points, lets say a (0.2,0.4,0.2) b (-0.5,0.8,0.2) c (2,0.3,0.1) How would I go about calculating it those points are within the coordinates ...
DindinYT37's user avatar
0 votes
1 answer
44 views

Rotation on one object affects all others

I am making a game using LWJGL. I have encountered a problem with rotation, looked it up, found a solution, and added it, but it doesn't entirely work. In the code below, the bottom section is ...
Pale_Gray's user avatar
0 votes
2 answers
95 views

What rotation needs to be applied to align mesh with expected axis of target?

I'm using LWJGL and JOML to create a 3D view of hexagons whose positions lie on a torus. I have a number (NxM) hexagons, whose centres and normals I have calculated to be placed on the torus to ...
Mark Fisher'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
2 answers
384 views

glDrawArrays draws nothing

I am trying to draw a triangle using shaders in LWJGL, but nothing is being drawn on the screen, and no error is being produces. I can't figure out what I'm doing wrong. To create a vao, I use: ...
user145024's user avatar
1 vote
1 answer
1k views

Framebuffer incomplete attachment

I am creating a framebuffer in LWJGL using: ...
user144744's user avatar
0 votes
0 answers
118 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
1 answer
136 views

Efficiently color a procedural mesh?

I'm creating a procedural world with LWJGL and GLSL. I want to better visualize the biome map being produced and the height map it creates, but my attempts so far have been very inefficient. My first ...
TheGamerPlayz's user avatar
0 votes
1 answer
178 views

LWJGL GLFW hangs on native glfwInit call

For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as ...
Kai's user avatar
  • 101
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
2 votes
1 answer
129 views

How to make shadows softer as distance increases?

I'm trying to make shadows become more blurry as the distance between the caster and receiver, so they look a little more realistic. What method can I use to achieve this?
zin's user avatar
  • 133
0 votes
1 answer
90 views

Close objects are only partially rendered - LWJGL [duplicate]

I'm working on a LWJGL project and I'm experiencing a weird problem: close objects stop being fully rendered as I move slightly away. I'm not very expert in OpenGL so I can't figure out what is ...
Tito Tigi's user avatar
3 votes
0 answers
310 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
2 votes
1 answer
866 views

JWJGL Multi-threading to separate update and render

Introduction: I am currently designing a game in Java using the LWJGL 3.0, with Gradle. I have quite an advanced knowledge on multi-threading, and I am aware how GLFW does/doesn't implement multi-...
Kris Rice's user avatar
  • 193
1 vote
1 answer
2k views

OpenGL tile map rendering with 1 quad for all tiles and 1 texture atlas

I'm using lwjgl to experiment with 2D games. I made some maps with Tiled (small 30x30 maps) and currently I draw them by loading the tileset image as one texture and extracting from it the texture ...
giusdp's user avatar
  • 13
1 vote
1 answer
607 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
1 vote
0 answers
182 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
0 votes
0 answers
602 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
4 votes
1 answer
653 views

Wind-blown fire particle effect from scratch

I want to create an effect of fire and be able to give it a variable amount of "wind" to make it blow to the side. I don't want the particles to just curve off to the side, but to flow through the air ...
Darin Beaudreau's user avatar
0 votes
1 answer
68 views

FBO lack of 3D Precision

I am trying to do some post processing on my 3d scene. When I render directly to the screen edges are sharp, however when I render my scene to an offscreen FBO then render that to a texture that is ...
bay jose's user avatar
1 vote
2 answers
216 views

Meshes exported from blender as .obj does not map correctly

I am having some problems with developing my game in OpenGL with java (Using LWJGL3). I have been following a guide for the more complex steps of the process, like loading meshes. When using the ...
µzimbosaurus's user avatar
1 vote
1 answer
497 views

Migrating 2D game from immediate mode to VBOs

I am in the process of migrating away from legacy OpenGL calls in my 2D LWJGL game. Previously I would render each sprite using immediate mode, which was dead easy - bind the texture, add the vertices,...
Dan's user avatar
  • 255
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
0 answers
222 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
2 3 4 5
10