All Questions
45
questions
0
votes
1
answer
184
views
How do I make multiple 2D lights in OpenGL look good
I am making a 2D top-down game using LWJGL. I have implemented multiple point lights using shaders but they don´t look good. Or they do look good until the lights meet. I will put screenshots and the ...
0
votes
0
answers
396
views
Rotating Y axis to flip Texture facing inverts X axis
I want to rotate my sprites (applying the rotation to the transformation matrix) along the Y axis to flip the direction of the sprite.
But it somehow seems like it also affects my inputs system...
...
1
vote
1
answer
779
views
How is glReadPixels work in OpenGL/LWJGL?
I'm trying to make a 2d collision detection system for my game in java/LWJGL/OpenGL.
My problem is the glReadPixels() acting strange and I don't know what am I doing wrong.
The problem is usually it ...
1
vote
1
answer
2k
views
Fastest way to render 2D tiles using LWJGL?
I started watching these tutorials for creating a 2d top-down game using LWJGL and I read that VBO's should be fast but for rendering 48*48 tiles per frame I get only about 100FPS which is pretty slow ...
3
votes
1
answer
653
views
OpenGL 2D projection matrix not drawing anything
I am using OpenGL for 2D rendering and would like to use actual pixel coordinates. By this, I mean that I would like (0,0) to be in the top left of the window, and (width,height) to be in the bottom ...
1
vote
0
answers
187
views
JOGL won't draw 2D triangle [duplicate]
I've been looking into openGL recently (specifically JOGL) and have had some trouble with a simple triangle program. All I have is an array of vertices which I pass to a VBO for openGL to draw. ...
2
votes
1
answer
481
views
OpenGL 2D collision detection isn't working
I have a 2D OpenGL game which I am trying to implement aabb collision detection in. Here is the collision detection code:
boolean collisionX = position.x + size.x + dx >= collision.position.x &...
-5
votes
3
answers
3k
views
How to implement frustum culling in a 2d tile based game? (in a Orthographic View)
I'm making a 2d tiled base game, in which when I render many tiles, the fps goes down drastically. I know why this is happening, its because many objects are being rendered at once. I need to ...
1
vote
1
answer
49
views
Weird result when trying to draw a semi-transparent square over 1 of the 6 buttons in an ArrayList
So I Have an ArrayList of buttons that I created, for the most part they work fine except this one thing. I'll go through the steps to reach the part that is giving me problems.
The ArrayList ...
-1
votes
1
answer
338
views
LibGdx ShaderProgram for water break my graphic code
I'm making a 2D game in libGDX.
And it's run well, and look like that :
Now i'm looking for some water renderer, and I've found some amazing stuff : tutorial, and it's run well.
But, when I renderer ...
1
vote
0
answers
514
views
Java: How to scale 2D graphics with LWJGL to fit different resolutions
I'm currently in the process of learning the LWJGL (2.9.3) library for a game engine I'm making. Everything in the engine is running fine so far, except for one thing: different resolutions. I started ...
0
votes
2
answers
136
views
Rendering a textured quad not working
So, I'm making a 2D game using lwjgl, and rendering a textured quad won't work.
I have 3 textures, names are :
DirtTexture.png, GrassTexture.png, WaterTexture.png
All are located inside of the "res"...
-1
votes
1
answer
150
views
Java 2d Library - Sprite Color Key Support
I'm building a 2d game with box2d and opengl.
Turns out, opengl does not support color keying (removing the background color of a sprite). This is obviously ridiculous and any half-decent, 2d library ...
0
votes
2
answers
2k
views
java.awt.Graphics -> graphics.drawImage is too slow, what is wrong?
I'd like to program a 2D game engine. The problem i have (i don#t use opengl and stuff like that, so i render with cpu) is, that i only get 7fps through the graphics.drawImage(); Do you have any ...
0
votes
1
answer
968
views
Render Fog-Of-War on 2d tilemap
I am currently creating a small 2d-game with lwjgl.
I tried to figure out a way of implementing a Fog-Of-War.
I used a black backgound with alpha set to 0.5.
Then I added a Square, to set alpha to 1 ...