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.
1
vote
1answer
75 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 ...
-4
votes
0answers
73 views
OpenGL parsing normals from obj gets shading wrong [closed]
I have written a simple OBJ file parser for my game engine and it renders everything correctly, but, when I try and use the normals to do lighting it gets shaded all wrong!
I draw using an index ...
0
votes
1answer
70 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
39 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
166 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
0answers
98 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 ...
-2
votes
1answer
119 views
Game Engine for quick Horror Survival prototype [closed]
for a University project we need to develop a prototype for a Survival Horror game using an engine of our own choice. We are currently preparing the project and wondering which engine to use. Maybe ...
2
votes
3answers
305 views
Time of Day Lighting / Day Cycle
I'm trying to implement a simple "lighting" system that alters a value of light between 0.0-1.0, 1.0 is midday 0.0 is total blackness.
Are there any "good" information regarding this particular ...
3
votes
0answers
104 views
Combining Effects
To be able to work efficiently with effects, isn't there a "good" way to combine multiple effects so that one effect handles stuff like "Multi texturing" and another controls the value like Ambient ...
1
vote
1answer
105 views
XNA effect lighting like basic effect lighting
Is it possible to make lighting in a normal effect work like the lighting in the basic effect?
With a basic effect it's really easy:
BasicEffect effect;
effect.EnableDefaultLighting();
0
votes
1answer
85 views
How to get pixels affected by a light in deferred shading?
I implemented deferred rendering in my little engine using framebuffers but there is no dynamic lighting for now. The g-buffer contains positions and normals in view space and albedo.
To implement ...
1
vote
1answer
160 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 ...
2
votes
1answer
175 views
How to solve artifacts caused by vertex lighting in my voxel engine?
My current lighting system bakes the light amount based on ray-tracing from the light source to the 8 corners of the block (so per-vertex) and the distance to the light on the blocks. It works ...
0
votes
1answer
64 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 ...
0
votes
0answers
32 views
Interpolation of surface normals on the face of a triangle and Goroud shading
My question is detailed at this link.
I linked it instead of copy paste because here I can't seem to get the fancy math symbols to show properly here.
Thoughts?
2
votes
1answer
142 views
2D Software Lighting Issues in Java
I'm creating a 2D top-down tiled game in pure Java and by now I'm trying to implement a way to do lighting.
First, some details on how I render: there is a screen class which handles all the ...
3
votes
1answer
55 views
independent lighting per mesh in blender
In Blender, is it possible to assign lighting objects/effects exclusively to a single mesh? For instance, if I place two meshes next to each other, and two lights (one shining on each mesh), I would ...
0
votes
2answers
173 views
Tutorials for shadow mapping with multiple point lights in XNA [closed]
I've been trying to crack this problem for a while now and I'd like to know if there's a tutorial or two out there that can help me with this. I know how to do shadow mapping with a single light, and ...
8
votes
1answer
278 views
What is Ramp Shading or Lighting?
What is ramp shading or lighting and how does it work? Is it different than toon shading or is it the same concept? How is specularity calculated differently for ramp shading versus blinn-phong or ...
2
votes
0answers
117 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 ...
6
votes
2answers
309 views
A big light with shadows
To have better texture2D quality in my 2D game, I had to recreate every textures with 300% of their original size.
But the lights have to bright 3 times more.
For lights, I'm using this : Catalin's ...
0
votes
4answers
245 views
Opengl lighting not working
I have rendered a spinning model in LWJGL. I have calculated normals and enabled lighting. Now I make a light:
float lightpos[] = {0, 0, 0, 0};
FloatBuffer lightposb = ...
9
votes
1answer
285 views
How to achieve light that changes color mid-way?
I thought of creating light sources, and some colored windows. Now, the windows are semi-transparent. How could I make it so that when the light (say, pure white) hits the glass and continues through ...
1
vote
1answer
225 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= ...
10
votes
1answer
300 views
How do I create multiple 2D spotlights?
I'm looking to create a 2D "spotlight" effect that allows a spotlight on multiple entities. I.e., as if several sprites were holding torches. For a single entity (one spotlight), I use a technique ...
2
votes
0answers
65 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 ...
0
votes
1answer
108 views
vec4 for vec3 multiplication while calculating the specular value
I'm following this tutorial to calculate the specular color of a vertex.
I use OpenGL 2.1 with GLSL version 120.
This is the formula that I apply:
spec= (R*eye)^s * Ls * Lm
With:
...
5
votes
1answer
232 views
Detecting Light Intensity Around Characters
Later Edit
Since there seemed to be a bit of confusion: I am asking this for purely didactic reasons, I'm not searching for the most efficient solution. Reformulated question: I'm working under ...
3
votes
1answer
130 views
Can't get normals to work correctly with lighting in OpenGL [closed]
I'm trying to light up a simple 2d triangle with my cursor as a diffuse light source but can't seem to set the normal correctly for the lighting to look right. The function that calculates the normal ...
2
votes
1answer
325 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
136 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 ...
3
votes
0answers
98 views
How does pixel shading work for ambient occlusion volumes?
I'm trying to understand the ambient occlusion technique described here, but I've trouble comprehending what exactly is the pixel shader doing.
Is the pixel shader invoked on points that belong to ...
3
votes
0answers
183 views
Changing Ogre3D terrain lighting in real time
I'm looking at the Ogre 3D library and I'm browsing through some examples / tutorials. My question is about terrain. There are a few examples showing how great the terrain system is, but I think that ...
4
votes
2answers
332 views
Lights shining through walls
I'm currently having a problem with lights in Unity. They shine through walls for some reason.
Point, directional, etc. If a light is next to a wall on one side, you can see it on the floor on the ...
4
votes
1answer
107 views
Gamma-Correct rendering without floating-point rendertargets
When using a gamma-correct pipeline, you have to work with floating-point rendertargets. Otherwise, you will get severe banding due to the insufficient precision of the usual 8-bit-per-channel integer ...
3
votes
1answer
139 views
Blender Object Appearing Gray when all Lights are Off
I have an issue with Blender where, when I turn my only light off (a sun lamp) and render the image my object appears gray rather than black (and thus, not appear to the camera). I can't figure out ...
2
votes
1answer
133 views
Multiply mode in SpriteBatch
I have a "lighting" texture (black background with white or colours for lights) that I want to draw as a multiplcation operation. SpriteBatch.Begin can specify BlendState.Additive, but there's no ...
5
votes
1answer
270 views
Performance of pixel shaders vs. SpriteBatch: XNA
Precondition: I read this question/answer about using shaders, or spritebatch, to render and mark a sprite.
I need to do something like that. I also have a 2D lighting PoC which I need to write. The ...
1
vote
0answers
155 views
Per fragment lighting with OpenGL 4.x tessellated model
I'm experienced with OpenGL 3+. I'm dabbling with tessellation shaders and have now got to a point where I have a nicely tessellated teapot/plane demo (quick look here)
As can be seen from the ...
-1
votes
1answer
140 views
OpenGl / C++ and some strange light problem on half board [closed]
I have some problem with lights in my opengl "game". I have board with is square (-50,50), (50, 50), (50, -50), (-50,-50) x and z since y doesn't matter at all.
I tried to make something like ...
2
votes
2answers
281 views
How to create realistic 2d lighting using colour temperature
I'm looking for a lighting algorithm that produces realistic lights expressed in kelvins, from about 2500k to 6500k. What I'm confused about is how to make the lights properly interact with the colors ...
3
votes
1answer
350 views
GLSL per pixel lighting with custom light type
Ok, I am having a big problem here. I just got into GLSL yesterday, so the code will be terrible, I'm sure.
Basically, I am attempting to make a light that can be passed into the fragment shader (for ...
0
votes
1answer
282 views
Speed up lighting in deferred shading
I implemented a simple deferred shading renderer.
I use 3 G-Buffer for storing position (R32F), normal (G16R16F) and albedo (ARGB8).
I use sphere map algorithm to store normals in world space.
...
4
votes
1answer
235 views
How do I autogenerate gradient lighting?
I am trying to think of a way to generate a gradient like this picture:
Something like this GetGradientTexture(360f,100(width),100(height)), or if i want a directional light (like a flashlight) ...
0
votes
1answer
87 views
What is a fast way to darken the vertices I'm rendering?
To make a lighting system for a voxel game, I need to specify a darkness value per vertex. I'm using GL_COLOR_MATERIAL and specifying a color per vertex, like this:
glEnable(GL_COLOR_MATERIAL);
...
0
votes
2answers
182 views
Why does my model render differently than its preview?
I've been importing .fbx files that I made with 3DS Max 2012 into Unity, and it's quite neat to see my models running around in game. However, I can't help but notice that the models, as they're ...
3
votes
1answer
194 views
forward rendering and multiple shadow maps
I have two light sources on my scene. I created two fbo's which store depth textures for these lights. A render loop looks like this:
bind fbo1
save depth values for first light
unbind fbo1
bind ...
8
votes
1answer
268 views
OpenGL: Light at end of tunnel effect
Anyone knows any implementation of the "light at the end of tunnel" effect? where the outside is entirely bright and gradually becomes more visible?
The reverse could also be true, where the inside ...
10
votes
4answers
859 views
How can I acheive a smooth 2D lighting effect?
I'm making a 2D tile based game in XNA.
Currently my lightning looks like this.
How can I get it to look like this?
Instead of each block having its own tint, it has a smooth overlay.
I'm assuming ...
1
vote
2answers
436 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 ...