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

0
votes
0answers
16 views

Implementing Normal Maps with Unreal 4 Flipbooks

I'm new to Unreal 4 and just started using 2D. I have normal maps for my sprite that I'd like to put in so that the sprite responds to light as if all the details were modeled in 3D. How should I do ...
0
votes
2answers
58 views

Disable lighting in DirectX10

I'm implementing a D3D10 version of my renderer (not porting to avoid losing Windows XP support). I didn't go straight to D3D11 because MSDN and other sources recommend upgrading to 10 and then to 11. ...
-1
votes
1answer
113 views

Minecraft - like lighting engine

So I was looking on how to create a minecraft - like lighting engine and I found the following post: How can I implement lighting in a voxel engine? The answer to it was incredible and perfectly ...
1
vote
1answer
56 views

how to define a field of view for the entire map for shadow?

I recently added "Shadow Mapping" in my XNA games to include shadows. I followed the nice and famous tutorial from "Riemers" : http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php . ...
2
votes
0answers
41 views

Compute directional light frustum from view furstum points and light direction

I'm working on a friends engine project and my task is to construct a new frustum from the light direction that overlaps the view frustum and possible shadow casters. The project already has a ...
0
votes
1answer
110 views

HTML5 Canvas 2D lighting and normal maps [closed]

How using the HTML5 Canvas can I create a 2D game with light sources and also add an extra depth using normal maps. I have never really done lighting in 2D before and I'm not sure where to start. ...
-1
votes
1answer
36 views

Is lighting different from Immediate mode rendering to VBOs?

I recently got a textured cube to render as a VBO, and I've noticed some strange things as I have been trying to incorporate lighting. Firstly, there is no difference if I comment out any lines ...
2
votes
0answers
83 views

How to implement simple shadows on XNA?

UPDATE: See photos below the description I try desperately to implement shadows on my XNA games. My game is a style of games like Voxel (minecraft). The problem is that I do not find support / ...
4
votes
1answer
133 views

How to calculate directional light frustum from camera frustum

I'm playing around with OpenGL for a few weeks now. For the following screenshot I picked the glm::ortho values for my lightsource by trial and error. There are two directional light sources with ...
3
votes
1answer
366 views

What is deferred lighting?

There is plenty of information on what deferred rendering is but there is a lack when it comes to deferred lighting and the information that there is there is not clear. My question is simple, what ...
1
vote
0answers
87 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
1
vote
2answers
108 views

2D Lighting Glitch

I've been working on a game in Java, and recently I decided to try out my game on a netbook just to see how it would run. While I do get a constant and decent FPS, it appears that my lighting ...
1
vote
1answer
68 views

Box2DLights - the center of sprites are always 100% unlit (black) unless Xray is on

I'm using a ConeLight at 180 degrees, with this setup: pl = new ConeLight(rayHandler, 256, new Color(0.5f, 0.5f, 0.5f, 1f), 280f, 400 - x, 300 - y, 0, 180); And the object I'm casting a shadow on ...
2
votes
2answers
122 views

Render with multiple lights (one pass per light)

I have already a system that at the moment handle multiple lights just passing an array of light struct and loop through it. I had been told to switch to a multipass rendering approach. How should I ...
0
votes
0answers
30 views

Get light positions from an environment map

As the title says, I was wondering if there's a way, in a preprocessing step, to infer the position of a some light sources starting from an environment map. I think I saw lights inferred from an ...
2
votes
1answer
100 views

Irradiance cubemap to spherical harmonics conversion

What are advantages of using spherical harmonics instead of irradiance cubemap? Are there any common used methods for conversion?
0
votes
1answer
50 views

Rotation with XMMatrix to Rotation with XMFLOAT3

I'm rotating a Direction Light around a fixed object, so the light only contains a XMFLOAT3 to determine it's direction that it is facing. I have another object rotation using the variable Rotation ...
1
vote
2answers
130 views

Implementing directional lighting in voxel based polygon-engine

I'm having trouble implementing directional lighting. (I'm not that familiar with 3D.) The problem is that the lighting does not "follow/flow with" the other blocks next to them. How should I fix ...
1
vote
1answer
64 views

Handling multiple lights of different types in GLSL

I want to be able to support multiple lights of different types (point, spot & directional). Note that I also want to be able to render transparent/translucent objects, which rules out deferred ...
2
votes
0answers
226 views

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...
0
votes
1answer
69 views

Volumetric Lighting projects models

I've been trying to implement Volumetric Lighting using the code from this tutorial but I've run into some issues, even after basically copypasting the shader code. I'll just show you what's going ...
1
vote
0answers
23 views

Trouble with Lightmaps When Meshes Intersect

I've been working on making lightmaps for a game on mobile devices (meaning that individual texture sizes cannot exceed 2048 and that file size needs to be as small as possible), but I'm running into ...
0
votes
0answers
56 views

How to add a flashlight in libgdx?

So I want to add a flashlight to the game when the game starts to get darker which I already have working. I bound a light texture to the batch and the first problem is that for some reason the ...
4
votes
1answer
70 views

Lighting computation viewing direction

This is something that's really cooking my noodle. When I'm computing the light response for a material in my fragment shader, I'm using the standard 3 normalized vectors, in eye space: fragment ...
3
votes
1answer
88 views

Using sky for indirect lighting - should I remove the sun?

I'm attempting to achieve slightly more realistic ambient lighting in outdoor scenes using the sky cubemap. When rendering an object, I first calculate the direct lighting contribution using ...
0
votes
0answers
26 views

Light shaped like a line

I am trying to figure out how line-shaped lights fit into the standard point light/spotlight/directional light scheme. The way I see it, there are two options: Seed the line with regular point ...
3
votes
1answer
174 views

Best way to blend colors in tile lighting? (XNA)

I have made a color, decent, recursive, fast tile lighting system in my game. It does everything I need except one thing: different colors are not blended at all: Here is my color blend code: ...
0
votes
0answers
38 views

How to draw a spotlight in 3D

To be clear, I am not talking about the light result (the lit area) but the spotlight itself, like this The two common suggestions that I tried are 2D image and a 3D cone. The problem with the ...
1
vote
0answers
39 views

Normal map lighting bug in bottom right quadrant [closed]

I am currently working on getting normal maps working in my project, and have run into a problem with lighting. As you can see, the normals in the bottom right quadrant of the lighting isn't ...
1
vote
0answers
50 views

How can I perform a masked erase in SDL2?

I'm trying to implement some shadow/lighting effects in my 2D-project, and I've concluded that if there is an easy way to perform a masked erase on an SDL_Texture, it would make the drawing operations ...
0
votes
0answers
58 views

box2dlights conelight rotation is off

I'm using libgdx/box2dlights for my game~ I have a conelight set up as such: ConeLight cl = new ConeLight(rh, 32, new Color(0f, 0.0f, 0.0f, 1.0f), 3, 0, 0, 0, 1); where "rh" is a RayHandler set to ...
0
votes
1answer
49 views

Way to avoid excessively bright objects with specular lighting?

I have a typical Phong shading with specular light. I have all the parameters tuned so to give appropriate highlights from a point light source. Now the problem I have is a new object that has a large ...
1
vote
1answer
96 views

Brighter pixels around area (OpenGL ES 2)

I'm trying to achieve an effect like in the image bellow. Basically I will have a 2D texture and I want a small area around a point (let's call it "light source") to be slightly better lit (i.e. be ...
0
votes
1answer
62 views

Light direction not being calculated correctly

I'm trying to implement deferred lighting in my game, and have run into an issue with normals. The image above shows the lighting being applied to a tile map. The yellow shade represents the ...
0
votes
2answers
229 views

Unity3D Directional lights vs Draw calls

I need 2 light sources looking at a different direction as per my design. This means, I cannot flag one of them as 'not-important'! I found that because I'm using 2 directional lights, drawcalls are ...
1
vote
1answer
109 views

XNA Diffuse Shader Issue. Edge lighting problem. Image Attached

As you can see in this image the diffuse shading is working correctly in some places but in other places such as the the bottom of the sphere you can see the squares/triangles of the mesh. Any ...
16
votes
3answers
3k views

What is the utility of squared radius and inverse squared radius for lighting computations?

On one of the slides from "DirectX 11 Rendering in Battlefield 3" PowerPoint I noticed the folowing code: struct Light { float3 pos; float sqrRadius; float3 color; float invSqrRadius; } I ...
1
vote
0answers
70 views

SpotLight in ForwardBase pass using forward rendering

Is there anyway I can force Unity to allow me using a custom shader to render spotlights in a ForwardBase pass (using Forward Rendering Path)? For what I could see since now: Unity use and ...
3
votes
1answer
139 views

Understanding and editing HDR light environments in Photoshop

I'm working with an in-development system that uses .hdr environments (equirectangular projection) to provide image-based lighting (IBL) to a 3D rendering. I'm trying to understand what range of ...
1
vote
1answer
74 views

Correcting Lighting in Stencil Reflections

I'm just playing around with OpenGL seeing how different methods of making shadows and reflections work. I've been following this tutorial which describes using GLUT_STENCIL's and MASK's to create a ...
1
vote
1answer
198 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 ...
3
votes
1answer
131 views

Creating a black light (ultraviolet) shader?

I am interested in the algorithm for color picking that would ideally allow to choose what color range will be highlighted and what color range will be faded. I can sort-of understand how to make it ...
0
votes
0answers
52 views

Cone Lighting formula for 2D projection space?

There is a good formula for a 3d cone lighting: float angleCos = dot(lightVector.rgb, lightDirection.rgb); attenuation = saturate((angleCos-coneCos)*coneCos); What if I want to compute whether my ...
1
vote
1answer
133 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 ...
0
votes
2answers
41 views

Compute cone angle (cos) given side and hypotenuse vectors at time 0 and world matrix at time 1

I need a formula for the cosine of a cone, given normalized side vector, normalized hypotenuse vector at time 0 and world matrix at time 1. This is needed to implement custom spotlights in a level ...
0
votes
0answers
31 views

Checking if a object is blocking my view of a light (it's between light and camera)

I'm trying to determine, from a list of objects, which ones are blocking my view of a light. In other words: which ones are between the light and the camera. Coding in C++, using HPL1Engine. This is ...
0
votes
1answer
111 views

Surface shader ignores lighting in vertexLit path

I want to use a surface shader in VertexLit(not Forward) rendering path. I caused a problem that the compiled shader completely ingnores lighting from the light sources on the scene. Here's the code: ...
2
votes
2answers
31 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 ...
0
votes
0answers
85 views

Cast shadow without rendering object

I'm new to UDK, and am using it to develop a survival-horror game based heavily on shadows. My question is short: is there a way to create an actor that, when rendered, ONLY renders its shadow (not ...
0
votes
0answers
63 views

Unity3d: Lines in Android build

I have a directional light pointing at the 3d objects. For some reasons, when I build to Android, the lighting produces multiple horizontal lines. It does not happen in other builds such as the ...