1
vote
1answer
126 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
2
votes
1answer
234 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 ...
4
votes
1answer
2k 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
154 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
1answer
183 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
250 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 ...
4
votes
3answers
728 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 ...
2
votes
1answer
328 views

Update single entry in GLSL array

I have an array in my vertex shader like this: uniform mat4 MeshTransforms[20]; At the moment I'm just updating the entire array of matrices like so: int meshTransforms = ...