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

2
votes
1answer
128 views

2D lighting causes black rings to appear

A year ago I implemented 2d lighting in XNA using sprites. The sprites I used were created by placing a soft white photoshop brush on a transparant background. The result was this: (lights only) ...
1
vote
1answer
88 views

Can you export lighting models directly from 3D application to a real time renderer?

is it possible for example to insert lighting in a 3D Model software like 3DSMAX and export an animated model like md5,..etc. and export the lighting too ?
1
vote
1answer
312 views

How can I calculate a terrain's normals?

Im trying to implement basic lighting in Opengl 3+ (a sun) with this tutorial : http://www.mbsoftworks.sk/index.php?page=tutorials&series=1&tutorial=11 Im building a basic terrain and its ...
6
votes
2answers
179 views

Reducing Spherical Harmonic Ringing

I've generated some 2nd order SH light-probes from cube-maps in my scene and I was surprised how strong artifacts are around the back of the dominant lights. I switched to a Lambert source plus ...
0
votes
2answers
644 views

Simple 2d tile based lighting in xna

I am currently trying to implement simple lighting into my game. My world is represented in a 2d array of numbers, each number being a certain tile. I am changing the color parameter in the ...
2
votes
2answers
381 views

Shadow mapping with directional light?

I'm doing shadow mapping in my OpenGL 4.3 deferred renderer, and I'm starting with directional lights believing it to be the easiest. What I do not understand is how the view projection matrix is to ...
6
votes
3answers
568 views

How can I create a shader that will reproduce this lighting effect on terrain?

Notice the way in which the major light source in each image reflects off the ground, as a function of the distance between the light source and the viewer (?). Is this a (bumped) specular map? ...
1
vote
1answer
227 views

Lighting Covering Up Sky ( XNA / C# )

I have a 2D tile-based lighting system which is drawn onto a Render Target. I am also drawing a background which involves mountains, sun/moon, and clouds. There is also the unlit game; blocks, ...
0
votes
0answers
54 views

Simultanious RenderTarget use in XNA

I am currently grappling with the idea of lighting a 2D scene as a 3D one and i need to clear up a couple of things. I have so far figured out that i am going to use a differed lighting system where ...
1
vote
1answer
104 views

What causes still objects have lines in them when lighting is being changed? [duplicate]

First, here is what I'm talking about (I changed the contrast to make it more visable, since it's not really visible in still images): Ingore the chat box, I was spamming buttons to see which one ...
1
vote
1answer
178 views

Spot and area lights inconsistent

Im having problems with area light and spotlight. When adjusting parameters the change is not consistent and sometimes the light grows tstronger and then dissapears and then reappears very strong, ...
4
votes
1answer
995 views

Faking 2d light using shader (Unity, Shaderlab)

Since the concept was difficult to explain in words for someone who's not quite familiar with shader, I described it in pictures. I'm currently using Unity and it seems Shaderlab is the best choice ...
0
votes
1answer
83 views

Blending and shadowmapping?

I am trying to implement shadow mapping, and currently I have 2 point lights and 1 global ambient light source and my rendering loop looks roughly like this (the details are not relevant): void ...
1
vote
1answer
149 views

Flashing candle light

What is a simple way to simulate flashing candle / torch / fire light? I'm not asking about animating the flames, I'm only interested in the light surrounding the fire, similar to what this device ...
2
votes
1answer
166 views

Are ambient, diffuse and specular light or material properties?

Are ambient, diffuse and specular properties of light or material? I am doing ray casting in OpenGL, I've managed to create lit sphere using formula I = L Ka + L Kd (n . l) + L Ks (r . v)^n but I ...
1
vote
0answers
33 views

Implementing Light Volume Front Faces

I recently read an article about light indexed deferred rendering from here: http://code.google.com/p/lightindexed-deferredrender/ It explains its ideas in a clear way, but there was one point that ...
0
votes
1answer
177 views

fragment shader directional light positioning with camera

Im trying to set up directional lighting in the fragment shader. So the direction of my light moves with the camera position. #version 150 core uniform sampler2D diffuseTex; ...
6
votes
2answers
328 views

Spherical harmonics lighting - what does it accomplish?

From my understanding, spherical harmonics are sometimes used to approximate certain aspects of lighting (depending on the application). For example, it seems like you can approximate the diffuse ...
1
vote
1answer
137 views

HLSL What you get when you subtract world position from InvertViewProjection.Translation?

In one of NVIDIA's Vertex shaders (the metal one) I found the following code: // transform object normals, tangents, & binormals to world-space: float4x4 WorldITXf : WorldInverseTranspose < ...
2
votes
1answer
211 views

Incorrect lighting results with deferred rendering

I am trying to render a light-pass to a texture which I will later apply on the scene. But I seem to calculate the light position wrong. I am working on view-space. In the image above, I am ...
1
vote
1answer
343 views

Grid-Based 2D Lighting Problems

I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least. I need a lighting engine for my ...
8
votes
1answer
287 views

Fast lighting with multiple lights

How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is ...
0
votes
1answer
629 views

Directional light causes an FPS drop

I have only one object in the scene and it is lit with a directional light. It uses the mobile/diffuse shader. The issue is that on iPhone 4 the FPS drops from ~42FPS to ~11FPS when the directional ...
2
votes
1answer
332 views

Compute Shader Memory Sharing

Ok guys I have had some pretty good success on this site but I feel that this is a pretty complex question. I am trying to do tile based deferred lighting using DirectX 11 and the compute shader. ...
1
vote
0answers
136 views

What's the best engine for a procedural game that doesn't compromise on graphics? [closed]

We have a very interesting idea for a new game mechanic that would allow us to make our game procedural and entertaining. To bring this game to life, we need the ability to generate the game world on ...
1
vote
0answers
185 views

Unity Pro - Shadow rendering issue

I am using Unity Pro 4.2.1f4 and I always have this sort of glitch. This is due to the shadows and the bias. Even with a low bias this is happening. I've found a thread that talks about that ...
5
votes
1answer
485 views

Lightmapped prefabs for procedural content

I'm doing a game with procedural content from handmade prefabs, but I ran into a problem as Unity bakes the scene instead of objects when lightmapping with Beast. So when the prefabs are instanced ...
2
votes
1answer
405 views

Shadow mapping with deffered shading for directional lights - shadow map projection problem

I'm trying to implement shadow mapping to my engine. I started with directional lights because they seemed to be the easiest one, but I was wrong :) I have implemented deferred shading and I retrieve ...
6
votes
2answers
289 views

Implementing realistic sun reflection on a sea

I'm drawing a 3d rendered island which has a day / night cycle and a sun that rises and sets over water. The sea is rendered with a fragment shader derived from this Blinn-Phong tutorial. ...
0
votes
1answer
51 views

Change emission level of a set of vertices within a mesh

ok so here is the problem I need to solve. I have a known set of vertices that I need to "animate" the emission level of. Currently I have a vertex definition setup and RGB color data for each ...
1
vote
1answer
74 views

Programmatically set brightness of a PointLight

I'm a beginner, so there is definitely something I'm missing here. I'm trying to set brightness of my PointLight object from the in-game command line. Here is what I tried, but it doesn't work: ...
4
votes
5answers
632 views

Why don't we use the whole color depth for normal maps?

All normal maps I've seen are pinkish or bluish. So it seems like only a short color range is used. Why do game developers give away so much precision? Update: The short answer is, that technically, ...
2
votes
0answers
220 views

Monogame working with Krypton

I am trying to make a simple 2D game engine using Monogame and the Krypton 2.0 lighting engine. So far I have succeeded in rendering a light but I am unable to generate any shadows from any hull's. ...
1
vote
1answer
61 views

Spot lights - making narrow/broad spot lights give more/less intense light

When I use "normal" spot lights as presented in tutorials such as this (with the exception that I use inverse square fall-off and then gamma correction), the spot light doesn't behave like a real ...
0
votes
0answers
95 views

Normal mapping and translation, lighting not displaying correctly

I got a normal mapping issue. I have a texture and a normal texture on each model loaded via the ASSIMP library. I am calculating the tangent vectors on each object with the help of the ASSIMP ...
7
votes
2answers
247 views

Diffuse Reflection confusion

From what I've read, with a simple directional light, the color of a point, if you only take diffuse reflection into account (intensity = 1), should be color = color_of_point * color_of_light * ...
7
votes
2answers
1k views

What is physically correct lighting all about?

I can't find anything comprehensive using Google. I'm wondering what the core concepts of physically correct lighting are, and where I could read up on it. What's physically correct lighting all ...
2
votes
2answers
153 views

.md5mesh normals are not smooth

I'm currently working on a project that requires me to load .md5mesh format and draw it. Following this link I've managed to load the mesh into the engine successfully, but a problem arises when ...
3
votes
1answer
353 views

Adding lighting pygame

I have created a day and nigh cycle in a game of mine by drawing a rectangle over the screen and having it's alpha change constantly. However, I obviously want to add some lighting to the game. Is ...
0
votes
1answer
127 views

Angle to Vector3?

I am working on getting my directional lights to match the sun in my atmospheric scattering shader. I have a float that ranges from 0 to 6.28 (TwoPi). How would I calculate a vector3 from this angle? ...
0
votes
1answer
122 views

Per-fragment lighting system behaves like ambient lighting system

This is the relevant section of my fragment shader varying vec3 normal; varying vec3 halfv; ... vec4 color = ambient * gl_LightSource[0].ambient; vec3 n = normalize(normal); float ...
1
vote
1answer
427 views

How to do directional per fragment lighting in world space?

I am attempting to create a GLSL shader for simple, per-fragment directional light. So far, after following many tutorials, I have continually ran into the issue: my light is specified in world ...
0
votes
1answer
405 views

Grid Based Lighting in XNA/Monogame

I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
1
vote
1answer
114 views

OpenGL light not shining quad

I've constructed a scene using OpenGL/GLUT with a spot light but I'm getting troubles with light shining some of the walls what is going on and how to solve?
7
votes
3answers
2k views

How do I implement occluded lighting in a block-based 2D game?

I want to have 2D lighting that can be blocked by in-game objects. My game has a top-down view and all game objects are described by rectangles. Let's say I have a 10x10 world and I place a light at ...
4
votes
1answer
1k views

GLSL Light (Attenuation, Color and intensity) formula

I'm implementing point lights in my Voxel engine, and I'm really struggling to get a good flow of light, from 100% near the light source to 0% at the light radius. I have 5 arguments for the ...
0
votes
1answer
203 views

Ogre: Light not reflecting correctly

In my Ogre 3d scene I have an empty box, and within that there are three small cubes. The camera is also within the box, facing the three small cubes. The user can move and rotate the camera with the ...
0
votes
2answers
107 views

Min. Distance for Spotlights in Ogre3d?

I have a simple scene with only one empty box. Within that box I have the camera attached to a scene node, which the user can move (translate/rotate). Additionally a spotlight is attached to the ...
2
votes
1answer
256 views

Unity3D custom camera matrix breaking shadows/lights in deferred rendering

EDIT 1: So it seems this is a common issue with Unity, and it comes from a bug in which custom camera matrices break deferred lighting and shadows. This topic right here talks about it a bit, but the ...
3
votes
1answer
280 views

Dynamic “Light Level” System based on alpha levels

My team and I have been working on a game in Java using the Slick2D engine and there are a few things I have questions on. As of right now, the code that I've written basically takes a cosine function ...