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
-1
votes
1 answer

Lighting not working in opengl

I am having trouble getting the lighting to work on just the decline portion of my ground. Below is my code for the ground and the decline (making it a ditch): static void ground(double x, double y, double z, double dx, double dy, double dz){ …
Ryan Fasching
  • 449
  • 2
  • 11
  • 21
-1
votes
1 answer

Why are my lighting calculations wrong?

I'm using the Blinn-Phong algorithm to calculate the lighting in a scene, and I'm not factoring in distance yet. I've also disabled my HDR and Specular calculations until I get this first issue fixed. I'm somewhere on the order of 95% sure that it's…
Xirema
  • 19,889
  • 4
  • 32
  • 68
-1
votes
2 answers

How to improve performance for lighting calculations in a phong lighting model

I've successfully implemented a phong lighting model doing all the lighting calculations in a fragment shader - it looks smooth, but that's causes some performance issues if having a lot of objects in a scene. One solution is to do all the…
ampawd
  • 968
  • 8
  • 26
-1
votes
1 answer

Simulating lighting function of fixed pipeline, which role plays the material emission?

So, I am trying to port this sample to jogl. Kind of ironic because he is using compute shaders with deprecated opengl, but anyway, I'd like to emulate that. He sets light: ambient diffuse specular cut-off…
elect
  • 6,765
  • 10
  • 53
  • 119
-1
votes
1 answer

How avoid light rotating in OpenGL?

In OpenGL I created a simple cube that I rotate. I am rotating the cube, not the camera! Then I added a light source. The light also rotates with the cube. How can I avoid this? Can somebody tell me when to activate which matrix mode and when to…
Nick Müller
  • 61
  • 1
  • 7
-1
votes
1 answer

Spotlight issue OpenGL

I have a problem with spotlight in OpenGL library. A scene is black, light is unseen if the GL_SPOT_CUTOFF is less than 125. I supposed that issue concerns direction of the light source but I have tried plenty of options both for position and…
james
  • 1
  • 3
-1
votes
2 answers

Why is my floor polygon not affected by specular and diffuse light?

I'm trying to light a scene with a few simple objects. I have two lights, one spot light and one point light and the lighting seems to work fine on the objects in the scene, but when it comes to the textured floor its only affected by ambient and I…
Amit Ofer
  • 413
  • 1
  • 7
  • 26
-1
votes
1 answer

Lighting for JavaFX pano viewer

I am currently trying to set up a panorama viewer in JavaFX using its 3D features. I think I got the geometry right (3D sub-scene, TriangleMesh, etc.) but I am fighting with the proper lighting. What I need is actually no lighting at all, just the…
mipa
  • 10,369
  • 2
  • 16
  • 35
-1
votes
1 answer

drawing surface normals in opengl

I have drawn a house with a slanted roof in opengl. I am having problem in defining the normals for the slanted roofs.It wont be parallel to the axes so this is what I have…
-1
votes
2 answers

Some kind of edge lighting?

I'm playing around with lighting a cube. I'm not really sure what I want yet so I'm just throwing this out there. This is what I've got... ...but I don't like the sharp edges. Removing the lighting obviously means you can't see the edges any…
lloyd
  • 1
  • 3
-1
votes
1 answer

Bad lighting behaviour (fixed pipeline)

I'm trying to render an object (say cube) with OpenGL 1.1 (I know that doesn't makes sense nowadays, but I've to use this). Everything works fine until I try some lighting. Here's the problem: The Global variable set are: static GLfloat…
JTulip
  • 55
  • 6
-1
votes
1 answer

OpenGL - GLmaterialfv problems on multiple objects when lighting

Situation: I'm making a lighting example using OpenGL. My goal is that, there will be 20 random colored spheres, a cube and three light source as you see picture below. https://i.stack.imgur.com/b4uwu.png Problem: The cube you see above affected by…
Erdi İzgi
  • 1,262
  • 2
  • 15
  • 33
-2
votes
1 answer

why some triangles are becoming black after I add lighting?

I am trying to add specular lighting to my opengl es program which loads 3d model. Its working normally. But whenever I add lighting this happens: some triangles are becoming black and some are staying white. here is my Vertex and fragment shader…
DevSadik
  • 1
  • 1
-2
votes
1 answer

Python Pygame Lighting for Pong

Hey Guys Im writing a little Pong-Game in Pygame and wanted to use a glowing-effect on the Ball and the Bats. But Pygame dosen't support this effects and make solid block's out of it. Is there a way to handle that with lighting? thanks in advance
EnAmiX
  • 1
-2
votes
1 answer

lighting openGL in c++

My code works correctly. I see a ground on the output screen. But I want to light the ground to seem 3-d. So I added some code and function in my code.But output didn't change. What can I do to light the ground? Thanks for answers... My code is…
1 2 3
54
55