[LWJGL] Diffuse Light and Ambient Light

Hey JGO :slight_smile:

I’m rendering a map stored in multiple VBOs, how can i add some simple basic light to this? i got ambient light working, but for example if there’s a lantern, how do i make that? I think what i want is called “dynamic diffuse light” but i can’t get it working with LWJGL methods and I’m not good at GLSL and well tryed some pages at google for that but none did work :confused: Anyone got a good tutorial for 3D Light in LWJGL? based on LWJGL’s functions or made with a shader, both is fine :slight_smile:
Some additional Information (if necessary): I’m not using Textures, every vertex got a color and a normal

Hello,
I would recomend the videos made by https://www.youtube.com/user/thebennybox.

Specially for your problem:
https://www.youtube.com/watch?v=mo94KvzjHB0&list=PLEETnX-uPtBXP_B2yupUKlflXBznWIlL5&index and the one which follow.

-ClaasJG

Okay, well thanks for the Answer :slight_smile: I’ll try this (seems to be too much to just try it out in a few minutes) but that’s with textures no? or doesn’t it make a difference if i don’t use textures :slight_smile:

If you take a look on the shader he uses (ambient) you well see how that works:

#version 120

varying vec2 texCoord0;

uniform vec3 R_ambient;
uniform sampler2D diffuse;

void main()
{
	gl_FragColor = texture2D(diffuse, texCoord0.xy) * vec4(R_ambient, 1);
}

Insteat of the texture you can use what ever you want. For example a simple color.

-ClaasJG

I think what i was looking for is the Point Light :slight_smile: