The tag has no wiki summary.

learn more… | top users | synonyms

14
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 ...
0
votes
0answers
53 views

Unity 2D - SpotLight and Shadow

I've been having some trouble in the process of creating my 2D game. Here is the thing, i want to create a light source on the top of the screen, blocked by some rocks and letting only go through some ...
0
votes
1answer
99 views

Unity - Light and sprite collision

I'm a beginner in Unity and i'm facing a little problem / question. The main purpose of my 2D game is based on the mouvment of a specific light and the player have to avoid getting inside his rays. My ...
1
vote
0answers
64 views

LibGDX - Box2D: Realistic Light and Layers

I'm having some problems with my current game. Short description: It's a 2D game where you have to avoid the lights or you lose HP. My problem is the following one: Here is the rendering process: ...
0
votes
1answer
99 views

Center directional light shadow to the cameras eye

I'm currently drawing my directional light shadow using this view and projection: XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll); XMFLOAT3 center(0.0f, 0.0f, 0.0f); XMVECTOR lightDir = ...
1
vote
1answer
92 views

Spot Light color fade in Unity 3d

I have a scene where many spot lights are focused on the screen. All have red color and same intensity. What I want is that the red Color(0,0,0,1) value should increase and decrease in a fading effect ...
5
votes
1answer
217 views

What light attenuation function does UDK use?

I'm a big fan of the light attenuation in UDK. Traditionally I've always used the constant-linear-quadratic falloff function to control how "soft" the falloff is, which gives three values to play ...
0
votes
1answer
237 views

Use light cone/range as a Trigger

I was wondering, in Unity 3D, how I could do something with the Spot Light (Range/cone) as a trigger? Since it would be very interesting to be able to manipulate whats actually in sight of Light ...
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 ...
0
votes
1answer
172 views

Creating a light that follows the player

How do I create a point light that follows the player character when they walk around? The light should shine on the player and not on a fixed point.
1
vote
1answer
103 views

XNA Strange Lighting, Shader

Hey guys, i have strange lighting problem. I've written my own "deferred lighting" shader and this happend: Pic: Normal-Map Pic: Light-Map As long as i only use one big mesh everything seems ...
3
votes
1answer
167 views

Directional light shader not behaving as expected

I coded my first glsl shader which manage diffuse and specular effects of a directional light. This is the fragment shader. #version 120 //matrix uniform mat4 model_matrix; //directional light ...
2
votes
1answer
208 views

GLSL Multiple Uniform Structs

I'm developing a lighting system for my voxel game, and I have to send multiple (alot, say up to 200) lights to my shader program. Those lights contain the following data: Position (vec3) Color ...
2
votes
1answer
137 views

front and back face detection

I am trying to implement a dynamic shadow system for a 2d game using this tutorial : ...
3
votes
3answers
144 views

How do you accommodate newbies while still creating depth in the design of light/dark systems for MUDs (or other text-based games)?

I've been pondering a redesign of our MUD's light/dark system. Our current system accommodates new players by simply not saddling them with being unable to see should they happen to wander outside of ...
13
votes
1answer
1k views

How do I blend 2 lightmaps for day/night cycle in Unity?

Before I say anything else: I'm using dual lightmaps, meaning I need to blend both a near and a far. So I've been working on this for a while now, I have a whole day/night cycle set up for renderers ...
1
vote
2answers
383 views

What is the color value of daylight?

This is a very short question. I want to implement ambient light in the color of daylight from the sun. What is the color value of sun light?
6
votes
1answer
499 views

How do I reconstruct depth in deferred rendering using an orthographic projection?

I've been trying to get my world space position of my pixel but I'm missing something. I'm using a orthographic view for a 2.5d game. My depth is linear and this is my code. float3 lightPos = ...
0
votes
1answer
271 views

How can I simulate light using mask images on the iPad? [duplicate]

Possible Duplicate: Can I achieve a torchlight effect (lighter area around a light source) in a 2D game? I want to have a picture as a background, say this: Then I would like to apply a ...
1
vote
2answers
374 views

Lights system with shaders in OpenGL?

In more than just 1 occasion, i read about 2 ways of doing a light's system in OpenGL: normal way? i don't know how to call this one with the shaders ( GLSL ) The problem is i don't get the ...
0
votes
2answers
654 views

Lighting with VBO

INTRO I'm using a Java JOGL wrapper called processing.org and I have coded some environment on it and I'm quite proud of it even if it has some library stuff that I didn't know anything about it ...
2
votes
1answer
249 views

Animated light effects in games

I have been wondering now for quite some time, how certain animated texture effects are done, specifically involving light effects. Some good examples of what I mean are the green bridges in ...
0
votes
2answers
1k views

Making a Point Light follow a cube (Unity)

I'm trying to have a point light positioned directly above a cube follow wherever the cube goes. However, it doesn't move at all. This is my code for the light: using UnityEngine; using ...
2
votes
2answers
4k views

XNA a Simple 2D Point Light

I want to make a 2D Point Light in XNA, I was able to find some helpful information but it is too advance for me, since i know nothing about Shaders ...
3
votes
1answer
217 views

Is there a standard camera position / orientation?

I've come across a need to position a camera for an arbitrary (unknown) scene. The camera can be updated later, but I thought I'd give it a reasonable default, and the thought crossed my mind that ...