The tag has no wiki summary.

learn more… | top users | synonyms

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 ...
13
votes
2answers
2k 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 ...
11
votes
1answer
1k views

Is a Gaussian blur a fairly accurate representation of soft shadow edges?

I'm not sure if real life soft shadows (from close,large light sources) have a Gaussian or linear falloff, or something else. I'm working on something where I can create the shadows by manipulating ...
6
votes
1answer
604 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 = ...
5
votes
4answers
335 views

OpenGL lighting appears to be clamping

I'm experiencing an odd problem where everything placed in front of my light appears black in my scene. This happens on multiple axes. I've searched the depths of the internet to find a solution, but ...
5
votes
1answer
287 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 ...
3
votes
3answers
164 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 ...
3
votes
1answer
226 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 ...
3
votes
1answer
295 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
249 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
512 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
2answers
5k 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 ...
2
votes
1answer
161 views

Specular map: What about the specular reflection's highlight' size?

I think I know what a specular map is and what it's used for (here is an example). http://www.rastertek.com/dx10tut21.html One of the models of specularity that are highly popular is Phong. In Phong ...
2
votes
1answer
167 views

front and back face detection

I am trying to implement a dynamic shadow system for a 2d game using this tutorial : ...
2
votes
1answer
273 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 ...
1
vote
2answers
548 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?
1
vote
2answers
398 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 ...
1
vote
1answer
235 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 ...
1
vote
1answer
64 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 . ...
1
vote
1answer
275 views

Why Does unity_LightPosition[0] Seem to Depend on Camera Position?

I'm trying to write a fairly basic shader but I keep running into lighting issues with Unity. My first problem was trying to figure out which variable stored the light's position in world space. ...
1
vote
1answer
171 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
136 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 ...
1
vote
0answers
305 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
2answers
2k 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 ...
0
votes
1answer
429 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.
0
votes
1answer
49 views

Can diffuse and specular component of Phong model shine thru object?

I have been implementing simple 3D engine in OpenGL, mostly based on tutorials by Tom Dalling. I have implemented the Phong lightening model as described in his tutorial, but I see light artifacts on ...
0
votes
1answer
723 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 ...
0
votes
2answers
752 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 ...
0
votes
1answer
37 views

Why is 2D light ray collision result getting inverted at specyfic angle

recently i've been working on 2D lighting for my game. I've created new little project, and I've encoutered a problem. The collision between light ray and the object is fine at angles 316-360 and ...
0
votes
1answer
148 views

Getting the Halo property of a point light in Unity

I am adding point lights in my scene ( max 6 ) and I want to be able to enable its Halo property via script. However in the documentation reference, they haven't mentioned how to enable the halo ...
0
votes
1answer
337 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. ...
0
votes
0answers
727 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
546 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 ...
0
votes
1answer
331 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 ...