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

Unity and C#: How to change overall world lighting not just ground? Other objects not lit with RenderSettings?

I am just getting into lighting with Unity 3d and right now have a function that progressively deepens the lighting of my scene here. I have done this via Render Settings and have tried 3 different approaches with lighting, I have received the same…
blue
  • 7,175
  • 16
  • 81
  • 179
4
votes
1 answer

Three.js ShaderMaterial lighting not working

I'm experimenting with Three.js ShaderMaterial and trying to implement lighting. I have working code for r70 but the same code (with minor changes - the MAX_POINT_LIGHTS constant has been renamed NUM_POINT_LIGHTS) doesn't work for r76. Looking at a…
CarlBateman
  • 151
  • 1
  • 12
4
votes
1 answer

D3D11: variable number of lights in HLSL

I'm working on a game engine in C++ and Direct3D11 and I want now to add a variable number lights to the scene. Up to date, I managed to add and render simple lights of a count that was already known and coded in the shader programs. In…
featherless biped
  • 163
  • 1
  • 5
  • 16
4
votes
1 answer

Raytracing - lighting equations

I'm trying to write a raytracer in C++, but the result so far is not as I expected, so I guess there is an error in the lighting equations. This is what I've got so far: Picture of my result. In the upper line what I've got, in the bottom line what…
Coda
  • 41
  • 1
  • 4
4
votes
1 answer

MATLAB: How to make camera light follow 3D Rotation

I have come into a problem recently when trying to rotate 3D objects. I am building a GUI and I have a separate figure where an object is plotted. In the figure, I allow the user to use MATLAB's built-in rotate button to move the object around.…
maz
  • 53
  • 5
4
votes
1 answer

What is an effective implementation for dynamic lighting?

I am currently working on a 2D Java game, and am currently in the process of implementing dynamic lighting, for e.g. torches, light bulbs and the sun. I however, have run into a problem. Numerous attempts with different implementations have not yet…
4
votes
1 answer

Gamma correction doesn't look properly corrected, is this linear?

I want to implement gamma correction to my OpenGL lighting, but with gamma correction applied, my results do not seem linear at all. I also found OpenGL: Gamma corrected image doesn't appear linear which is very similar to my issue, but hasn't yet…
ABHAY
  • 221
  • 2
  • 12
4
votes
1 answer

Deferred renderer with light volumes produce strange banding

I have a deferred renderer that only calculates lighting equations when the current fragment is in range of a light source. I do this by calculating the size of a light volume in my application and send this with other light information to the…
ABHAY
  • 221
  • 2
  • 12
4
votes
2 answers

Normal mapping on flat water surface produces incorrect specular highlights

I have a flat water surface with a dudv and a normal map attached to it. The dudv map works correct and the normal map is attached correct as well (visualizing the normal map looks like it should). The specular highlights are always showing at the…
ABHAY
  • 221
  • 2
  • 12
4
votes
2 answers

Normal mapping gone horribly wrong

I tried to implement normal mapping in my opengl application but I can't get it to work. This is the diffuse map (which I add a brown color to) and this is the normal map. In order to get the tangent and bitangent (in other places called binormals?)…
McLovin
  • 3,295
  • 7
  • 32
  • 67
4
votes
1 answer

Best way to blend colors in tile lighting? (XNA)

I have made a color, decent, recursive, fast tile lighting system in my game. It does everything I need except one thing: different colors are not blended at all: Here is my color blend code: return (new Color( (byte)MathHelper.Clamp(color.R…
ben
  • 133
  • 13
4
votes
2 answers

OpenGL lighting problem when rotating the camera

I draw buildings in my game world, i shade them with the following code: GLfloat light_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f}; GLfloat light_position[] = {135.66f, 129.83f, 4.7f,…
Newbie
4
votes
1 answer

Fragment Diffuse value changing with camera location/rotation

I am attempting to get some simple diffuse lighting to work in GLSL. I have a cube that is being passed in as an array of points and I'm calculating the face normals inside my geometry shader (because I intend to deform the mesh at run-time so I'll…
APalmer
  • 919
  • 3
  • 11
  • 22
4
votes
1 answer

OpenGL Multiple Lights

I'm attempting to add a second light to my scene. I was under the impression that all I needed to do, was enable another light (LIGHT1 in this case), and set it's parameters in order for it to work alongside the existing light. With this in mind,…
fanatic
  • 143
  • 2
  • 9
4
votes
1 answer

Create Sun light source in OSG

I need to set a point Source above my landscape in OpenSceneGraph that will act like a sun. I already know how to set up the light and it can be done in this fashion: //LIGHT CODE ------------------------ osg::ref_ptr lightGroup (new…
Fantastic Mr Fox
  • 32,495
  • 27
  • 95
  • 175