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
228 views

Deferred rendering with both Clockwise and CounterClockwise culling

I have a deferred rendering system that works well with objects that appear solid and drawn using CounterClockwise culling. I have a problem with Clockwise culled objects that are supposed to ...
2
votes
2answers
25 views

Derive direction in which a spot light emites its light from a projection matrix

First of all, sorry if my question sounds too basic or even makes no sense. I'm new with game development I'm working with HPL1Engine, specifically, the lights parts. I need to know the direction in ...
2
votes
2answers
90 views

How can I calculate spotlight lighting in Vertex/Fragment shader in Unity?

I've written a vertex/fragment shader for my game. It uses 3 textures and represents a floating water on the wall (so I have 1 texture for water, 1 for geometry and the last one is mask) so it looks ...
2
votes
2answers
191 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 ...
2
votes
1answer
142 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 ...
2
votes
2answers
143 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 ...
2
votes
1answer
218 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 ...
2
votes
1answer
720 views

Cook Torrance model implementation : black specular light

I am trying to implement the Cook-Torrance model, and this is how I calculate the parameter Rs: float Rs(float m,float F,vec3 N, vec3 L,vec3 V, vec3 H) { float result; float NdotV= ...
2
votes
1answer
653 views

2D Point Light XNA , Why my point light radius is Oval?

I friend of mine , taught me how to make a simple 2d point light with shader, so i follow his steps and finally done it ! but something happend , the light shape is like an oval and not like a ...
2
votes
3answers
205 views

Does radiosity work with skylight?

Does radiosity work with skylight (directional light)? From reading online it sounds like it was intended to work with point lights but I would really like to make it work with skylight if possible. ...
2
votes
2answers
193 views

How can I support many point light sources in a dynamically-generated level in Unity?

I'm currently working with a dungeon game which is similar to Dungeon Keeper by Mythic Entertainment. I'm using Unity and developing this game for Ipad 2 and above. Player can modify his dungeon, and ...
2
votes
1answer
124 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) ...
2
votes
1answer
322 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 ...
2
votes
1answer
127 views

Fragments never falling into spot light's cone

I am using GLSL version 1.20 with OpenGL 2.1 . I am trying to compute when a fragment falls into the area of a spot light. I have already set all the light values with glLightfv and glLightf, also ...
2
votes
1answer
756 views

Light mask map and camera for static lights in XNA Platformer

Using the example for some basic light maps found here : http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html, I've managed to create a lightmap texture using individual lightmaps and display ...
2
votes
1answer
762 views

How do I get light to go through a window texture in Unity?

I'm having trouble with the lighting (I have windows and the light wont go through). How do I get the light to proceed through the glass?
2
votes
0answers
68 views

Surface shader with VertexLit causes black object

I wrote the simplest possible surface shader: Shader "SimpleSurf" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Tags {"RenderType"="Opaque" } ...
2
votes
1answer
181 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 ...
2
votes
0answers
178 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. ...
2
votes
0answers
454 views

How to occlude lights in Unity3D?

First off, I own Unity Pro. I've been looking in to occluding lights when they aren't being viewed for a while now to improve performance. The main methods I ran in to were using BecameVisible() and ...
2
votes
0answers
682 views

How can I use the dualforward parameter in my unity shader to use lightmaps and normal maps together? [closed]

I'm using the free version of unity and I would like to combine lightmaps with specularity and normal maps. After doing a -bunch- of research, I've figured out that there doesn't seem to be any easy ...
2
votes
1answer
690 views

Has anyone got the Krypton Lighting Engine working in MonoGame for Windows 8?

I've converted the core of the Krypton Lighting Engine so that it's compatible with Windows 8. The trouble I'm having when actually using it is that it can't load the KryptonEffect.xnb file. I'm ...
1
vote
2answers
597 views

How does Minecraft compute lighting for it's non-block objects?

I was wondering how the creator of Minecraft went about lighting the objects (player and pickaxe) based on the lighting level around the player. I have implemented the ability to light the blocks ...
1
vote
2answers
190 views

Diffuse light direction

I'm learning a tutorial from Rastertek about diffuse light with DX 11, here's the shader code: float4 LightPixelShader(PixelInputType input) : SV_TARGET { float4 textureColor; float3 ...
1
vote
1answer
97 views

Shouldn't fragment lighting have the same effect as vertex lighting with only ambient and diffuse lights?

With infinite light source and only ambient and diffuse lights — no specular light, it seems the rendering results of vertex lighting and fragment lighting should be the same, because all the lighting ...
1
vote
2answers
134 views

Can global Illumination via path tracing replace all other current lighting techniques?

In the sense that you currently have algorithms like HDR, shadows, reflections, caustics, motion blur and so on, does complete path tracing take care of all these effects, or would you still have to ...
1
vote
4answers
213 views

Cell Lighting Propagation Problem

I have in place a cell-based lighting system that works basically like this: (Not my actual code) //Light moves up for (int x = 0; x < width; x += 1) { for (int y = 0; y < ...
1
vote
1answer
216 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 ...
1
vote
1answer
103 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?
1
vote
2answers
690 views

Getting a black scene with XNA, what am I doing wrong?

I'm new to XNA (ver 4) and I'm obviously doing something wrong but I don't know what. So far I have managed to model my scene (quite simple, just a bunch of squares which are calculated--there are no ...
1
vote
2answers
135 views

Voxel Lighting in Unity3D

I'm working on a Voxel project in Unity3D for fun and learning. I've been reading up on how this is done and have implemented a simple Voxel map in my project. My question is about the lighting. I've ...
1
vote
2answers
84 views

pre-rendering light on texture based on bump map

Using a gray-scale bump-map and N sources of colored light, what is the algorithm to render the light on the textured surface, assuming I have the angle(s) and distance of each light source? (I am ...
1
vote
1answer
56 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 ...
1
vote
1answer
194 views

Isn't it redundant to implement both lights and shadows?

Most games come up with their lighting implementation and their shadow implementation. Due to deferred shading, we are able to simulate lights independent from the scene geometry. But realistic ...
1
vote
1answer
172 views

Do any games support different lighting effects according to whether a surface is wet or dry?

I've noticed that when driving at night, when the road surface is dry, my headlights appear to illuminate much further than when the road surface is wet. I presume that this is due to the differences ...
1
vote
2answers
2k views

why specular light is not running?

i'm on JOGL this is my method for lighting: private void lights(GL gl) { float[] LightPos = {0.0f, 0.0f, -1.0f, 1.0f}; float[] LightAmb = {0.2f, 0.2f, 0.2f, 1.0f}; float[] LightDif = ...
1
vote
1answer
80 views

Why is the light following my camera around?

I have implemented a simple Phong shader without specular highlights for now (just ambient + diffuse components) The problem however, is that the calculations seem to be done in camera space; as I ...
1
vote
2answers
113 views

Technique for multiple shadow casting lights in 2D

I'm trying to create shadows in a 2D game in such a way that I can have an arbitrary number of lights in a scene, all of which can cast shadows. To do this I think I have to generate a mesh for each ...
1
vote
1answer
117 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 ...
1
vote
1answer
102 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 < ...
1
vote
1answer
70 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: ...
1
vote
2answers
960 views

2-d lighting day/night cycle

Off the back of this post in which I asked two questions and received one answer, which I accepted as a valid answer. I have decided to re-ask the outstanding question. I have implemented light ...
1
vote
1answer
251 views

multipass shadow mapping renderer in XNA

I am wanting to implement a multipass renderer in XNA (additive blending combines the contributions from each light). I have the renderer working without any shadows, but when I try to add shadow ...
1
vote
1answer
118 views

Where does the light come from, using Maya/Panda3D?

Total noob to Maya. Total noob to Panda3D. Planning on becoming really good at both as soon as I have free time to do so, but right now I have an assignment due in a few hours which requires this: ...
1
vote
2answers
351 views

Techniques for lighting a texture (no shadows)

I'm trying to learn about dynamic shadows for 2D graphics. While I understand the basic ideas behind determining what areas should be lit and which should be in shadow, I don't know how I would ...
1
vote
1answer
285 views

How do I make light objects in XNA?

Here's my dilemma : I want to have light sources placeable by the player, in terms of lanterns. I know the best way to do this is to use pixel shaders, which I have done a lot of research and use ...
1
vote
1answer
289 views

Materials when rendering geometry

When specifying the material (ambient/diffuse/specular) for use in lighting calculations, what level of detail is the material specified at? Per vertex, mesh, bone?
1
vote
1answer
65 views

How to create a sun billboard with Ogre3d

I've been working with a few different engines alongside trying to code my own project. Rather than rewrite an entire renderer, etc I am using Ogre3d. To begin with I am trying to implement a very ...
1
vote
1answer
205 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, ...
1
vote
1answer
132 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, ...