The simulation of light and illumination in games, including its interaction with the environment. A core element of games that can bring out vivacity into otherwise static worlds.

learn more… | top users | synonyms (1)

7
votes
2answers
544 views

How can I model a star?

I'm trying to model a star in Unity, and it, sort of works, but it's not ideal. Currently, I'm using a large sphere with a self-illuminating material containing a star texture applied to it's surface, ...
0
votes
1answer
22 views

How do I query a LibGDX Box2DLights “light” and “dark” regions?

I have lighting implemented using Box2dLight. I want to update/render things inside the player's PointLight area. Stuff in the dark area should not be rendered. How can I find which areas are lit or ...
0
votes
1answer
22 views

Phong lighting model - R vector

In Phong lighting model a vector R is used to calculate the spectral component of light. The equation used to obtain it is R = 2(N•L)N - L I can't understand why we use this equation. Could someone ...
1
vote
0answers
37 views

Simulating sun 3d direction

At the moment I got the following to simulate the suns direction: void Sun::Update() { if (!mIsMoving) return; const auto now = Clock::now(); const auto timeDiff = now - ...
1
vote
0answers
64 views

Create the sun light in a large space simulation

I want to create a space simulation, but I'm facing some difficulties when I try to create a realistic sun. Currently, I've a simple Point Light inside a sphere. But for some reasons, no matter the ...
1
vote
1answer
44 views

Why is everything lit by default?

I am following the unity tutorial here and when i drag my environment into the Hierarchy everything i already lit up on my Game view, i noticed this was also the case in the Space Shooter tutorial ...
5
votes
1answer
129 views

What is a lobe, in reference to lighting and graphics

I sometimes see references to lobes when talking about lighting, especially with specular lighting, but also with spherical harmonics which doesn't do specular. Can anyone explain what exactly a lobe ...
0
votes
0answers
34 views

How to calculate spherical harmonic coefficients for indirect diffuse?

After reading the article "An Efficient Representation for Irradiance Environment Maps", I'm a bit confused as how to calculate the spherical harmonic coefficients. I'd like to generate these ...
1
vote
0answers
46 views

Blinn-Phong lighting on Voxel models

I'm creating a game that is going to use voxel models. However I got stuck when I coded my shader using Blinn-Phong algoritm. Here is how it look (Only care about the red model): As you can see ...
0
votes
2answers
43 views

Inverting the Z coordinate of the light vector

I noticed that in some vertex shaders they invert the Z coordinate of the light vector, i.e. // Compute denormalized light vector in world space float3 vLightWS = g_LightPosition.xyz - ...
0
votes
0answers
28 views

How to calculate per vertex normals? (OpenGL) [duplicate]

I am really confused and quite much thinking about how to do that? Cross product and then, normalizing is not working for me. Or perhaps, I take them all wrong. Well, please explain me that while ...
1
vote
1answer
72 views

Deferred rendering: camera inside point light's sphere of effect

I'm trying out deferred rendering and I'm using the tutorials at http://ogldev.atspace.co.uk. I've got the basics working and I'm currently trying to implement the final step from tutorial 37 ...
0
votes
0answers
38 views

LWJGL OpenGL Spotlight half-showing

Problem: Only half of the light is showing. Lighting Inilization code: glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); glEnable(GL_NORMALIZE); ...
0
votes
1answer
34 views

LWJGL Lighting advice / fix

Problem: The spotlight I've set up with OpenGL won't light up anything behind it, no matter what values I set for GL_SPOT_DIRECTION float[] LightDir = new float[]{0,0,-1,0}; float[] ...
1
vote
0answers
27 views

WebGL Multiple Lights, Blending, and Render Order

I am trying to do simple forward rendering for multiple lights using additive blending in WebGL. Following advice from this SO and this one, I simply turn on blending using glBlendFunc(GL_ONE, GL_ONE) ...
0
votes
1answer
26 views

Unreal Engine 4 Point Light Limiters..?

I've noticed through the first two tutorials I've done that Point Lights begin entering the viewport with red x's on them. When I build those don't turn on. It seems to be implying some limit to the ...
0
votes
1answer
58 views

Lighting changes when loading scene

I have a script that changes the levels using Application.LoadLevel (sceneNameToChangeTo); Once a level is loaded using that code when testing with the editor, the lighting changes dramatically. ...
0
votes
0answers
56 views

Unity 2D: Lighting ground tiles in a sidescroller?

I'm trying to find a good way to tint the ground tiles in my 2D game at sunrise, sunset, etc. I thought it'd be a good idea to use a diffuse material + lighting in order to create effects by ...
0
votes
0answers
28 views

Phong shading blows out things close to white [OpenGL]; is there a way around this?

I'm doing per-pixel lighting using the Phong shading model. In pseudo code this looks like: vec4 ambientColor = light.ambientIntensity * material.diffuse; vec4 diffuseColor = light.diffuseIntensity ...
0
votes
0answers
44 views

Creating Lighting effect in openGL [duplicate]

I am trying to make my wall have the same color and shade as the walls shown in the picture (Please ignore the frame and the bulbs). I can create a a cube and view it from inside but how can we give ...
45
votes
1answer
3k views

Making a night scene without being dark on the monitor

What would be a good way to make a 3D scene look "like" a dark night, without being so dark on the monitor that it's hard to see stuff (especially when playing in a brightly lit room). I've been ...
0
votes
0answers
61 views

OpenGL Diffuse Lighting Issue

I seem to have a problem in my OpenGL scene where if I (the camera) am looking at an plane it's brightness changes depending on what angle I am to the plane. It seems as though the camera is a source ...
1
vote
1answer
63 views

Question regarding irradiance

I know that the formula for irradiance at surface point p with normal n given a point light source at position l is: H = I(cos x) / ||l - p||^2 Where: x = angle between n and l-p I() = Intensity ...
2
votes
1answer
87 views

Proper normal vector transformations in normal mapping

Hello! This question is about transforming normal vectors from normal maps properly. I have tried methods from over five sources, still can't get it to work, and I'm really desperate. Included are ...
3
votes
1answer
700 views

What causes this graphics quality difference between WebGL Build and Unity 5 Editor?

The Editor version and WebGL version of my Minesweeper clone have some graphics quality differences. I chose 'Fast' option when building this deployment. Is this the difference between 'Fast' and ...
0
votes
1answer
82 views

Incorrect Normal Matrix

In my game engine I'm passing a normal matrix to my shaders like so: Matrix3f normalMatrix = modelMatrix.invert().transpose(); However this is causing lighting to rotate with my object, producing a ...
1
vote
1answer
145 views

How to cast colored shadows

I have a glassy object and when light passes through it I want it to cast colored light behind it, instead of the shadow. I could just use another light object to cast that colored light, but is it ...
1
vote
1answer
278 views

Unity 2D: Sprites/Diffuse is making my character weird, like an antialias

i'm trying to put light and shadows on my 2D character but when i set the material on it to Sprites/Diffuse, it's kinda putting a strange smooth on my pixels. Without diffuse: With diffuse: And ...
0
votes
0answers
29 views

Connect lightsource with object in Libgdx

I want to make an minimalistic highway chase game in LibGDX, but I have a question. Can I attach a source light to an object so gravity will affect the source light, by pulling it down? One solution ...
1
vote
0answers
73 views

Sprite outline based on light position in UE4

I have simple sprite (for example black box) and I like to add to it outline (red line on example image) but based on light direction. I know UE4 use deffered renderer, so I cant access to lights, but ...
2
votes
2answers
60 views

Rectangular area light illuminance - colour banding

I'm currently working on an implementation of rectangular area lights but I am having some issues with the illuminance calculation, which gives me serious colour banding across the entire lit area. ...
0
votes
0answers
373 views

Unity 5 Enlighten - How do I make objects look bright?

I've recently started using Unity 5 and have been reading up on their global illumination and physically-based shaders using Enlighten here. Unfortunately, I would seem that the demo project which ...
1
vote
1answer
237 views

Custom shadowmapping in Unity not working properly

To experiment with a certain technique, I'm implementing my own shadow mapping in Unity. I'm using a camera for the light "view", which is rendered to a RenderTexture after being post-processed with ...
0
votes
1answer
107 views

Imported Blender modular mesh lighting/shadows issue - Unity

Hi I've very recently started using Unity and am creating a game level. I've created my environment in blender and am currently using a modular design as I'd like to include destructible environments. ...
1
vote
2answers
272 views

Are shaders the only way to implement 2d lighting?

I'm working on a 2d top down game with libgdx and I think i got the basics. No want I want to implement lighting, I don't know anything about lighting. I want just to have some light sources and ...
1
vote
1answer
154 views

Dot based light mask with shader on sprites

So I have a scene, completely based on 2D sprites. I want to render "light sources" into a seperate frame buffer (so mostly dots around, for example, the centre of a flame) and then render that frame ...
3
votes
1answer
197 views

What are the advantages of tangent space shading/lighting, and what about attenuation?

In several topics here it was suggested by people that doing lighting in tangent space is better than doing it in world space. Right now I am doing it in camera space, but it's really similar to world ...
-1
votes
2answers
61 views

What are 'ambient' lighting/illumination/occlusion? [duplicate]

What's the difference between ambient lighting,ambient illumination and ambient occlusion ? What are they? What's the difference between them?
2
votes
1answer
198 views

Box2D Lights - Simulate water

I have a libGDX project, in which I have a Box2D world, which is currently filled with some boxes as a terrain. I also added a DirectionalLight to the scene for simulating the Sun. I almost have the ...
1
vote
2answers
677 views

What are 'physically-based' lighting/rendering/materials?

What's the difference between physically based lighting, physically based rendering and physically based materials? How they are different from deferred and forward rendering? And physically based ...
2
votes
1answer
126 views

Rendering lighting only on specific objects

I have done something similar to this in monogame: My question is, what would I have to do to draw that lighting effect only on the pillar and not the background ? Is there something like ...
1
vote
1answer
53 views

Where is Light in Game view

Very Basic Question.when i run the the game the game Mode is Too dark as shown below in the picture. please suggest me some Setting how to globally switch on built in light while Running the game in ...
0
votes
1answer
89 views

OpenGL light calculation

I want to add somebasic point lights to my OpenGL application. I read here that I have to caluclate the light in a pre-projection space: Lighting can be done in any pre-projection space (e.g., ...
0
votes
0answers
110 views

2D GLSL Lighting and Sprites

I'm trying to make a 2D game engine, and I really want to support ambient light as well as multiple point lights that you can define the color, intensity, radius, etc from uniforms in glsl shaders. ...
0
votes
0answers
95 views

Fake Lighting 2D Space Java

I have an image that I want to be used as the light. The white are should be drawn, the black should not. I need the light to be tinted to whatever color I pass to the light object. I have code ...
4
votes
2answers
250 views

Hide some objects from the camera (fog)

I'm trying to implement a visibility representation in a 2D game ( no plains, no quads - plain 2D ) In the examples below I have calculated what the player can see using raytracing and added all the ...
0
votes
2answers
315 views

Three.js: Lighting not calculating correctly on THREE.Geometry objects

I have a three.js (REVISION: '68') issue with the lighting of THREE.Geometry objects: I'm using the THREE.Geometry class to build up objects using vertices and faces, then I computeFaceNormals() ...
0
votes
1answer
130 views

Reflection/environment mapping

I'm implementing reflection/environment mapping using a cubemap. I have it working for the most part but when I move my camera around, I see the same area reflected on the object. I am calculating the ...
0
votes
2answers
118 views

GL_SPOT_CUTOFF not working properly

I'm new to OpenGL. I'm studying OpenGL 2.1 and I'm trying to make a little program to test the GL_SPOT_CUTOFF property, but when I set a value between 0.0-90.0, the light doesn't work and everything ...
0
votes
1answer
114 views

Normal Mapping issue

The first image shows a spotlight shining correctly on the floor. The second image shows the same spotlight but rotated 180 degrees. The first is correct, the second is not. The third image ...