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
2 answers

2D Tile Lighting

I'm adding lighting to my XNA 2D tile based game. I found this article useful, but the way its done it does not support collision. What I'd like is a method to do the following Have always lit point Collision (If the light ray hits a block, then…
Cyral
  • 13,999
  • 6
  • 50
  • 90
5
votes
1 answer

OpenGL object glossy/shiny in Mac OS X 10.6, but not 10.5. Why?

I've written an OpenGL screensaver for Mac OS X 10.5 and higher which shows a spinning heart constructed using marching cubes. It works fine on my black 13.3" development Macbook running Snow Leopard (10.6), nice and glossy. But when I try it on a…
thinkski
  • 1,306
  • 1
  • 15
  • 25
5
votes
1 answer

OpenGL glEnable(GL_COLOR_MATERIAL) followed by glDisable(GL_COLOR_MATERIAL)

I was drawing, simultaneously, a vertex colored cube next to a textured cube, with glDrawArrays(), and found that with lighting enabled the textured cube gets "slightly brighter". After some debugging I found that the very first moment that…
luiez
  • 51
  • 1
  • 5
5
votes
2 answers

Global illumination for static geometry

I have been trying to find a suitable global illumination technique, preferably based on OpenGL or GPGPU, to light an outdoor scene which has static objects and dynamic light sources (it is a city model). It does not need to be very detailled or…
Violin Yanev
  • 1,507
  • 2
  • 16
  • 23
5
votes
2 answers

Light Direction and its Transformation in the Simplest Lighting Model

So, I've gotten to basic lighting in my OpenGL learning quest. Imagine this simplest lighting model. Each vertex has a position, color, and normal. The shader gets the ModelViewProjection matrix (MVP), Modelview matrix(MV) , and Normal matrix (N)…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434
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
2 answers

AR with iOS: putting a light in the scene makes everything black?

Ok, I am trying desperately to achieve this sort of warm lighting on my objects when added to my ARScene in Swift/Xcode - warm lighting and little glowing lights around: To be clear, I do NOT want the objects I add to my scene to look like they…
blue
  • 7,175
  • 16
  • 81
  • 179
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
  • 2,099
  • 1
  • 26
  • 39
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
  • 2,167
  • 4
  • 32
  • 64
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
  • 33,605
  • 61
  • 269
  • 439
5
votes
2 answers

How can I compute normal on the surface of a cylinder?

I am working on a ray tracer and I got around to adding cylinders to the scene. The point I am stuck at is finding the surface normal vector in the point the ray hits. I need this to be able to do the diffuse lighting. What I have at this point is…
Rpreda
  • 147
  • 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

How lighting in building games with unlimited number of lights works?

In Minecraft for example, you can place torches anywhere and each one effects the light level in the world and there is no limit to the amount of torches / light sources you can put down in the world. I am 99% sure that the lighting for the torches…
Matthew Ludwig
  • 745
  • 6
  • 24
5
votes
1 answer

Python Pygame Game Lighting

We are making a 2D side scrolling game and an item in the game will be a torch. We have a player who's arm can rotate and we can take the arms angle. We are looking at having a triangular beam shape, following the angle of the arm. We have had a few…
Aaron Nebbs
  • 506
  • 1
  • 6
  • 15
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
  • 35,140
  • 11
  • 74
  • 120
1 2
3
54 55