Tagged Questions
0
votes
0answers
21 views
Problem adding texture to VBO with png texmap in OpenGL
I was doing a VBO and able to load all the data of OBJ file but now I have problem adding texture to it. what i did is that I use the slick library to get the texture file and bind it to the VBO ...
0
votes
0answers
67 views
Deferred rendering extremely slow [closed]
I'm trying to setup deferred rendering in my Voxel Engine, and so far it works pretty good:
The texture, worldpos, normal and uv textures seem to be correct.
One problem:
With normal rendering ...
2
votes
1answer
88 views
GLSL Multiple Uniform Structs
I'm developing a lighting system for my voxel game, and I have to send multiple (alot, say up to 200) lights to my shader program. Those lights contain the following data:
Position (vec3)
Color ...
1
vote
1answer
95 views
GLSL Light (Attenuation, Color and intensity) formula
I'm implementing point lights in my Voxel engine, and I'm really struggling to get a good flow of light, from 100% near the light source to 0% at the light radius.
I have 5 arguments for the ...
2
votes
1answer
38 views
Manual GLU.gluUnproject
Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject.
How can I calculate the picking ...
0
votes
0answers
33 views
LWJGL Spritesheettexture with VertexBufferObjects
i've started to make a game with Java and LWJGL..
I used Imediatemode for testing and learing LWJGL.
Im working on an Engine for my Game and it should be a Voxel-Engine and "MineCraft Styled".
Today ...
0
votes
1answer
86 views
How can I implement infinite scrolling by scrolling the background's texture, not the quad? [duplicate]
I'm writing a 2D platformer game on Java with LWJGL. I'm doing this just for the sake of learning and not the result itself, so when I decided to implement scrolling I did it two ways I could invent ...
0
votes
0answers
58 views
Depth Test not working properly on Nvidia
So, I send a Development Test of my in-dev game to some friends, and they found out that the Depth Test in OpenGL does not work on Nvidia.
I use my own matrices and sent them to the shader, and at ...
2
votes
1answer
76 views
OpenGL Calculate Matrices
Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix:
public Matrix4f ...
0
votes
2answers
234 views
Screen or World Coordinates to tile Coordinates
I have Plane made of tiles in opengl. I start drawing them at (0, 0, -20) after that i do my translations so that the view is rotated somewhat similar to an isometric (kind of) perspective.
I'd now ...
1
vote
1answer
49 views
Can't get Depth testing to work (cube faces shine through)
I'm making my first steps with OpenGL with LWJGL. I am currenlty constructing a... wait for it... CUBE. Quite creative...
Up to now i made it to three of its faces and thats where the Problems began. ...
1
vote
1answer
186 views
Sidescrolling troubles [closed]
I'm making a sidescroller using java and Lwjgl. But I'm having some trouble getting the screen to actually ... well... sidescroll. The world is randomly generated and drawn in blocks. Like so:
...
3
votes
1answer
98 views
Rendering a black and white image in OpenGL 1.1
Is there is any way that I can simple disable the color in OpenGL 1.1? Or can I "grey out" textures in LWJGL?
4
votes
2answers
214 views
3D models on 2D tilemap perspective when scrolling
I am creating a small top-down game, where the player traverses a 2D tilemap, with an illusion of depth provided by 3D models for things like buildings or trees.
Having gotten to the point where I ...
0
votes
1answer
60 views
How do I pass textures into a fragment shader in Slick?
I've written a shader that uses three different textures, tex0, tex1, and tex2. I can load it into Slick and successfully display it, but I can't figure out how to set the three different textures. ...
0
votes
2answers
86 views
LWJGL Game crashes on some other machines [closed]
I just tried running my game on a friend's laptop, but for some reason it crashes. The exported .jar runs fine on my machine, and some others too. I can see that is has something to do with the ...
3
votes
3answers
397 views
Voxel engine artifacts
There are white little dots between blocks at random places, mainly at very near blocks. They disappear when I move the mouse and change the view direction.
I use Vertex Arrays with ...
3
votes
1answer
70 views
LWJGL Eclipse Resource Deployment
I'm still experimenting with some OpenGL in LWJGL, and as I get to know more and more about OpenGL, I start to do more complicated things like multi texturing, shadowmapping and more. Now, right now ...
0
votes
0answers
70 views
Rendering OpenGL to a specific scale [closed]
So I'm making a 2D game that I want to be able to change the window size. I plan on having the game being 4:3 and border any unused edges. Now the problem comes in that I need to take the current ...
-1
votes
1answer
63 views
Slick2D ingoring aplha channel?
When I use the draw method inside a image, it completely ingores the alpha channel and fills it in with white. Is there a way I can draw it where the alpha is see through like it's suppost to be? I ...
5
votes
1answer
749 views
OpenGL: Resizing Display and glOrtho/glViewport
I have researched this question from several sources and have yet to find a firm answer saying that "yes that is correct thinking" or "no, here is how it's done."
I am trying to ensure resolution ...
1
vote
2answers
114 views
LWJGL MouseY Coordinates are flipped
So I'm very new to using OpenGL and LWJGL, although I am proficient in Java itself.
One of the first things I read in the documentation of the Display class was that it maps the origin to the bottom ...
0
votes
4answers
256 views
Opengl lighting not working
I have rendered a spinning model in LWJGL. I have calculated normals and enabled lighting. Now I make a light:
float lightpos[] = {0, 0, 0, 0};
FloatBuffer lightposb = ...
-4
votes
1answer
179 views
Is OpenGL 1.1 really slow? [closed]
If anyone ever played minecraft and realized no matter what computer you have it normally doesn't give over 100 FPS? While looking at decompiled code from it I noticed it renders with OpenGL 1.1 ...
0
votes
1answer
87 views
Can I use multiple OpenGL version together
I want to use GLSL but keep my current OpenGL 1.1 setup. The thing is that can I use OpenGL 2.0 shaders on OpenGL 1.1 renders?
0
votes
0answers
81 views
LWJGL not working, need help [closed]
I'm trying to make a simple game in LWJGL but no matter what I do I just get a black screen and it becomes unresponsive. Here is the code that opens the window:
package src;
import ...
0
votes
0answers
79 views
gluLookat with LWJGL problems
I am very new to any sort of 3D programming and a lot of the resources either don't explain what each function or command is doing, or assume you have all of the knowledge already. I've looked at a ...
0
votes
1answer
165 views
Changing Yaw, Pitch And Roll OpenGL
I'm using LWJGL and OpenGL 1.1 at this time and I was wondering what command is used to change the yaw, pitch and roll?
0
votes
0answers
144 views
LWJGL Mouse Input [closed]
I have this mouse function in my LWJGL program:
public void mouseInput(){
int mouseX = Mouse.getX();
int mouseY = 600 - Mouse.getY();
int mouseDX = 0, mouseDY = 0;
int lastX = 0, ...
0
votes
1answer
224 views
OpenGL first person camera orientation issues [closed]
I have a "camera" in my opengl program that I recently finished. However, I've noticed that whenever I rotate and then move again, the x, y, and z angles change. For example, when I press the "w" key, ...
-1
votes
1answer
102 views
OpenGL glMatrixMode rotation
I'm stuck on trying to figure out how to rotate the viewport(or camera). So far I've figured out I need to use the function glRotatef and glMatrixMode(GL_MODELVIEW). But I have no idea how to apply ...
11
votes
1answer
408 views
OpenGL - white edges on cubes
In a minecraft-like game I'm making, I get white edges on my cubes:
It is much more noticeable in darker textures. The textures are being setup like this:
glTexParameteri(GL_TEXTURE_2D, ...
1
vote
1answer
693 views
LWJGL - Mixing 2D and 3D
I'm trying to mix 2D and 3D using LWJGL.
I have wrote 2D little method that allow me to easily switch between 2D and 3D.
protected static void make2D() {
glEnable(GL_BLEND);
...
1
vote
3answers
98 views
Translating an Object to a certain Vector 3 in OpenGL and Java LWJGL
So after almost two hours, I got the hang of using glTranslated() (with Java and LWJGL). If I am correct, applying glTranslated on an object moves that object with the x,y,z relative to the previously ...
0
votes
2answers
573 views
Rotating a Quad around it center
How can you rotate a quad around its center?
This is what im trying to do but it aint working:
GL11.glTranslatef(x-getWidth()/2, y-getHeight()/2, 0);
GL11.glRotatef(30, 0.0f, 0.0f, ...
0
votes
0answers
41 views
Nifty default controls prevent the rest of my game from rendering
I've been trying to add a basic HUD to my 2D LWJGL game using nifty gui, and while I've been successful in rendering panels and static text on top of the game, using the built-in nifty controls (e.g. ...
0
votes
0answers
63 views
HowTo Enable jBullet DebugMode
I would like to render the physics world of jBullet to debug some issues in my game, and I am not finding too much on enabling the debugDraw method of jBullet. Do I need to write my own debugDraw ...
0
votes
1answer
88 views
What is a fast way to darken the vertices I'm rendering?
To make a lighting system for a voxel game, I need to specify a darkness value per vertex. I'm using GL_COLOR_MATERIAL and specifying a color per vertex, like this:
glEnable(GL_COLOR_MATERIAL);
...
0
votes
2answers
238 views
LWJGL - OpenGL - Texture shading
I want to use LWJGL to create a shader that all it does is change the color of the given texture. For example I tell it to draw the letter A using a sprite sheet then I can tell the shader to draw the ...
3
votes
1answer
213 views
How can I set the rotation of a shape to the same as my image?
The way you set rotations of images is different from setting shape rotations.
So how can I make the shape have the same rotation as my image?
This is how my image rotates:
...
0
votes
1answer
248 views
Color Picking Troubles - LWJGL/OpenGL
I'm attempting to check which object the user is hovering over. While everything seems to be just how I'd think it should be, I'm not able to get the correct color due to the second time I draw ...
0
votes
1answer
386 views
How can I achieve this lighting with OpenGL?
I'm currently trying to implement a type of "smooth" lighting. How can I achieve lighting which looks like this:
http://dl.dropbox.com/u/1668516/concept/warp3.png
Using OpenGl. I've attempted to use ...
2
votes
3answers
330 views
OpenGL Get Rotated X and Y of quad
I am developing a game in 2D using LWJGL library.
So far I have a rotating box. I have done basic Rectangle collision, but it doesn't work for rotated rectangles.
Does OpenGL have a function that ...
6
votes
3answers
623 views
Understanding how to create/use textures for games when limited by power of two sizes
I have some questions about the creating graphics for a game.
As an example. I want to create a motorbike. (1pixel = 1centimeter)
So my motorbike will have 200 width and 150 height. (200x150)
But the ...
0
votes
0answers
193 views
Implementing Lighting OpenGL 2D Quads with Textures
Lets say I have a grid of tiles 64x64 and I want to implement lighting using opengl.
I draw the grid with 2D quads that are binded with textures. How would I implement source lighting and stuff like ...
1
vote
2answers
429 views
LWJGL GL_QUADS texture artifact
I managed to get working LWJGL in Java, and I loaded a test image (tv test card), but I keep getting weird artifacts outside the image.
Code:
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(10, ...
3
votes
2answers
422 views
Disadvantages of using multiple versions of OpenGL in LWJGL?
So, I'm trying to figure out LWJGL, and my goal is to use OpenGL 3.2 (because pretty shaders are pretty). But in every tutorial I can find for LWJGL, they import a bunch of different OpenGL versions ...
0
votes
0answers
110 views
OGL lighting issues [closed]
All that seems to be working is ambient light. My room is just dark with no lights in it. I'm not sure if it's relevant, but I'm using LWJGL. Here's my code:
glEnable(GL_LIGHT0);
...
3
votes
2answers
292 views
Textures on top of other textures when using VBOs
I'm currently making a cube style game. With chunks being drawn with VBOs. I'd like to know if there is a way to create an overlay texture on top of the existing texture without the need to rebuild ...
0
votes
2answers
202 views
Matrix loading problems with jbullet and lwjgl
The following code does not load the matrix correctly from jbullet.
//box is a RigidBody
Transform trans = new Transform();
trans = box.getMotionState().getWorldTransform(trans);
float[] matrix = new ...