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).

719 questions
5
votes
2 answers

How do I make the lights stay fixed in the world with Direct3D

I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects. In OpenGL light positions…
Baxissimo
  • 2,511
  • 2
  • 23
  • 22
5
votes
2 answers

How do I tell if the active texture is texture id 0 in GLSL?

I have model assets that are untextured and I am tired of rendering them as black without lighting. This is because if texture id 0 is bound and I ask the sampler it tells me its black. Later leading to 0 * lighting making the entire object black…
EnabrenTane
  • 7,294
  • 2
  • 24
  • 44
5
votes
2 answers

Fast 2D illumination algorithm?

We have a rectangular area with translucent walls and a few light sources.We are considering only the top view,so it is a 2D problem. We need to find the approximate lighting (signal strength)at each point of the area. We need to make the algorithm…
5
votes
1 answer

GLSL spotlight projection volume

In my open source project I have setup a deferred rendering pipeline using Qt3D. So far so good, but now I'd like to move forward by adding spotlights projection volume. (e.g. as if there is smoke in the scene) Like this: The fragment shader I'm…
Massimo Callegari
  • 1,965
  • 1
  • 21
  • 35
5
votes
0 answers

How to create "god rays"?

I would like to create "god rays" effect/lighting on a 3D shape. If I have a Box, I would like to have a light source behind it that will create "god rays" around it. Below, is an image I found showing the idea (imagine the window as an opaque box…
Mark
  • 1,787
  • 1
  • 23
  • 52
5
votes
2 answers

SceneKit: how to reproduce iOS 9 lighting color effect (one directional, one ambient) on iOS 10 without disabling PBR?

As this thread on the Apple forums mentions, lights on iOS 10 are now weaker and change how scenes look. The thread suggests setting SCNDisableLinearSpaceRendering to YES, but this did not work. Put another way, using SCNDisableLinearSpaceRendering…
Crashalot
  • 31,452
  • 56
  • 235
  • 393
5
votes
1 answer

SDL2 - Draw fully-transparent circle on a texture

I'm developing a 2D game in SDL 2.0 and I'm having am trouble with my lighting system. I want to fill the screen with fog and create a transparent circle around the player (lower-left). I know how to make a dark room with a tinted light using…
DragonDePlatino
  • 119
  • 1
  • 7
5
votes
1 answer

OpenGL per pixel lighting in fixed function pipeline

Is it possible to enable per-pixel lighting (so that I can have nice specular highlights on low tessellated surfaces) in the OpenGL fixed function pipeline?
5
votes
1 answer

SceneKit - Lighting and casting shadows

I'm trying to create a spot light that illuminates a cube. The surface underneath should then show a shadow. Unfortunately I wasn't able to achieve this. The light ignores the cube and casts the light on both - the surface and the cube - regardless…
Max
  • 2,487
  • 2
  • 22
  • 43
5
votes
1 answer

Matlab computing wrong surface normals?

I have a big FEM model from where I can get the "surface" of the model, say the elements and vertex that define the surface of that FEM model. For plotting purposes (nice plots are always a win!) I want to plot it nicely. My approach is just to use…
Ander Biguri
  • 32,737
  • 10
  • 68
  • 106
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
  • 3,476
  • 13
  • 51
  • 96
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
  • 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
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
  • 1,975
  • 2
  • 21
  • 32
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
  • 17,150
  • 34
  • 132
  • 231
1 2
3
47 48