Questions tagged [lighting]

Related to computer games' engines and 3d graphics software. For the use of both shadow and light in GUIs and for the use of lighting with respect to programs using hardware such as cameras, that requires code to control the lighting. Must be used with other relevant tags distinguishing the programming language and framework being used. e.g. unity 3d Not to be used with light, as is used in physics having wave and particle characteristics.

Related to the computation of reflection models like the Phong Model or Blinn-Phong Model and the per-vertex (Gouraud) and per-pixel shading models (Phong).

812 questions
4
votes
2 answers

LWJGL advanced lighting systems

Are there any tutorials or articles on how an efficient lighting system can be done in Java, using LWJGL? As far as I know, LWJGL supports 8 or 11 lights (I can't remember without looking into the code) and I am interested in how this can be used to…
Myzreal
  • 351
  • 4
  • 16
3
votes
1 answer

OpenGL-ES 2.0 (for Android), How to create a 2D dynamic lighting effect?

I have been looking for this for some time now and I haven't found an appropriate answer. I want to create a 2D dynamic lighting effect on android using OpenGL-ES 2.0 like in this video : http://www.youtube.com/watch?v=W53rTHXM6yo But I don't really…
zlithgow
  • 69
  • 5
3
votes
1 answer

Why is my diffuse/specular lighting not working?

I've got an OpenGL program running, and it displays geometry, but it's all "flat," one gray tone, with no diffuse shading or specular reflection: Pictured are three tori, each made of quad strips. We should see shading, but we don't. What am I…
LarsH
  • 27,481
  • 8
  • 94
  • 152
3
votes
1 answer

Using GLSL shaders + lighting / normals

I've got this not-so-small-anymore tile-based game, which is my first real OpenGL project. I want to render every tile as a 3D object. So at first I created some objects, like a cube and a sphere, provided them with vertex normals and rendered them…
cargath
  • 832
  • 8
  • 18
3
votes
1 answer

Maximum number of point lights with Three.js

I'm trying to light up each side of a cube in my Three.js scene by using point lights. However it seems that only 4 of the 6 lights I add to the scene are actually rendered as the top and bottom faces of the cube remain dark. If I remove the front…
Elegia
  • 325
  • 2
  • 10
3
votes
1 answer

Making a light source visible in OpenGL

I want to move my light source in my OpenGL-Scene, which is working. But to actually I want to see thee light source as well. How can I do this? ... glPushMatrix(); GLfloat lightPos[] = {0, 0, 200, 1}; glLightfv(GL_LIGHT0, GL_POSITION,…
buddy
  • 821
  • 2
  • 12
  • 30
3
votes
1 answer

How does the calculation of the light model work in a shader program?

I am trying to read up this tutorial: https://aerotwist.com/tutorials/an-introduction-to-shaders-part-2/ but I am not able to follow up. Basically the code creates a directional light by using shaders that run directly on the GPU. This is the…
TCM
  • 16,780
  • 43
  • 156
  • 254
3
votes
1 answer

Why is the bottom of my unity object darker than the top when the light source is to the side?

I have a planet in my game and it is next to the sun (the only light source in my project.) The side that is facing the sun is brighter and the side that is facing away is darker, as expected. But, if you look at the dark side of the sphere, the…
Werabird
  • 33
  • 2
3
votes
1 answer

Unity after LoadScene() and lighting and rendering not working properly

This is the scene before the LoadScene() everything is normal enter image description here And, after I collected all the yellow item I win the game and I click the GUI.button to try again (load the scene again) the scene is wraped like this enter…
Boyce Cecil
  • 97
  • 2
  • 8
3
votes
1 answer

How do I convert my point light into an oval/ellipse?

I am looking to turn my current circular light into an ellipse by having a vec2 radius which can have different x and y values. Is there any way to do this based on my current code in the fragment shader? uniform struct Light { vec4 colour; vec3…
tomatto
  • 149
  • 10
3
votes
1 answer

Rendering an atmosphere around a planet with shading

I have a made a planet and wanted to make an atmosphere around it. So I was referring to this site: Click to visit site I don't understand this: As with the lookup table proposed in Nishita et al. 1993, we can get the optical depth for the ray to…
Ridayesh
  • 93
  • 8
3
votes
3 answers

Opengl proper lighting problem

I have written the following program to display a teapot on a table in a room with 2side walls and a floor. #include #include void wall1(float thickness) { glPushMatrix(); glTranslatef(100,100,0); …
footy
  • 5,803
  • 13
  • 48
  • 96
3
votes
0 answers

Godot - How can I make a lighting system similar to Terraria

I'm making a game similar to Terraria in Godot. I want a lighting system similar to it. The light source is a circle but it still can penetrate through a couple of blocks before stopping. I tried using a Light2D and LightOccluder2D for the blocks…
jujumumu
  • 350
  • 4
  • 12
3
votes
7 answers

How can I access the Unity 'Light 2D (Script)' component via Script?

In my Unity 2D game, I have a character with a lightsource component 'Light 2D(Script)' from the Lightweight RP package. I want to change the intensity of the Light 2D with the code below. But I can't assign the 'Light 2D(Script)' to the public…
neal
  • 31
  • 1
  • 1
  • 3
3
votes
3 answers

OpenGL lighting small objects?

I'm having a problem with lighting when dealing with really small particles. I'm doing particle-based fluid simulation and am right now rendering the fluid as really tiny polygonized spheres (by really tiny I'm saying about 0.03 units radius for the…
Nitrex88
  • 2,158
  • 2
  • 21
  • 23