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
5
votes
4 answers

Adaptive threshold Binarization's bad effects

I implemented some adaptive binarization methods, they use a small window and at each pixel the threshold value is calculated. There are problems with these methods: If we select the window size too small we will get this effect (I think the reason…
maximus
  • 4,201
  • 15
  • 64
  • 117
5
votes
3 answers

Creating a solar system in opengl - lighting not working as planned

i'm trying to create a solar system (only sun, earth and moon) in openGL. My only light source is the sun, which should light the other planets up. I got it working so far, but the faces of the planet which face away from the sun are also lit, i…
stainless
  • 69
  • 1
  • 7
5
votes
2 answers

Specular lighting appears on both eye-facing and rear sides of object

I am writing a small test of Phong shading, and am hitting my head against a brick wall trying to get the specular component working. It appears to work correctly, except that the specular light is applied to both the front & rear of the object.…
ASpence
  • 61
  • 1
  • 6
5
votes
3 answers

Why does GL_SHININESS have a maximum value of 128.0 instead of 1.0

One thing which occurred to me today was that OpenGL specifies the GL_SHININESS material component to be between 0.0 and 128.0, instead of between 0.0 and 1.0. As far as I know, everything else which you can specify using floating point values has a…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
5
votes
6 answers

How do I fixate a light source in OpenGL while rotating an object?

I have a glutSolidTeapot (which has its surface normals generated automatically according to opengl.org) and a light source which is emitting diffuse light. The problem comes when I try to rotate the teapot: it seems like the light source is doing…
Attila Kun
  • 2,215
  • 2
  • 23
  • 33
5
votes
1 answer

How can I add a normal to a text mesh so that it lights correctly?

I'm using a text mesh to place text on a 3D object, but as you all know, the text mesh does not have any normals... http://docs.unity3d.com/Documentation/Components/class-TextMesh.html ...so it does not light correctly. I've done a search and found…
BeachRunnerFred
  • 18,070
  • 35
  • 139
  • 238
5
votes
1 answer

In a TBN Matrix are the normal, tangent, and bitangent vectors always perpendicular?

This is related to a problem described in another question (images there): Opengl shader problems - weird light reflection artifacts I have a .obj importer that creates a data structure and calculates the tangents and bitangents. Here is the data…
badweasel
  • 2,349
  • 1
  • 19
  • 31
5
votes
1 answer

OpenGL: How to make light to be independent of rotation?

I have a diffuse lighting shader which seems to work when the object is not rotating. However, when I apply rotation transform, the light also seems to rotate along with the object. It's like the object and the light stay still but the camera is the…
Jacky Boen
  • 831
  • 1
  • 7
  • 10
4
votes
1 answer

Creating smooth lighting transitions using tiles in HTML5/JavaScript game

I am trying to implement a lighting effect in an HTML5/JavaScript game using tile replacement. What I have now is kind of working, but the transitions do not look smooth/natural enough as the light source moves around. Here's where I am now: Right…
spectralbat
  • 407
  • 2
  • 13
4
votes
3 answers

GLSL fixed function fragment program replacement

When using the OpenGL fixed function pipeline for vertex setup, how a fragment program looks like that is compatible to the fixed function vertex setup? I guess that usually depends on the number of light sources and texture layers etc.. So for…
dronus
  • 10,774
  • 8
  • 54
  • 80
4
votes
3 answers

Problems with OpenGL lighting

I'm having trouble being able to see objects I've created when I have enabled lighting in OpenGL. I have an object that is imported from 3D Max that the lighting works correctly on but the rest of my scene does not. I know that I need to specify…
Chris
  • 3,036
  • 5
  • 36
  • 53
4
votes
1 answer

Deferred rendering and moving point light

I know there are couple of threads on the net about the same problem but I haven't got help from these because my implementation is different. I'm rendering colors, normals and depth in view space into textures. In second I bind textures with…
Karmo Rosental
  • 653
  • 1
  • 8
  • 18
4
votes
3 answers

SVG filter: different result depending on browser

I am trying to add a point light effect to an SVG rectangle. The problem is that i got different results depending on the browser I am using. For example in Chrome and Safari i got the following: How could I get a consistent result using svg…
revy
  • 3,945
  • 7
  • 40
  • 85
4
votes
2 answers

Basic OpenGL lighting question

I think this is an extremely stupid and newbie question, but then I am a newbie in graphics and openGL. Having drawn a sphere and put a light source nearby, also having specified ambient light, I started experimenting with light and material values…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
4
votes
1 answer

Issues with Raytracing triangles (orientation and coloring)

EDIT: I found out that all the pixels were upside down because of the difference between screen and world coordinates, so that is no longer a problem. EDIT: After following a suggestion from @TheVee (using absolute values), my image got much better,…
Cache Staheli
  • 3,510
  • 7
  • 32
  • 51