[bzr] Light shines through doors
#51
Quote:@Descenteer:
No, I am not talking about shadows. If an object casts dynamic light it can light up parts of the level without any visible connection to that - global illumination or not. The vertex just has to be "close enough" to the light source to light up at all - even if there are several walls (three dimensional) in between the vertex and the light source.

Yes, of course. But technically in a renderer that is solved through a shadow pass. Whatever of the dozens of shadow techniques you want to use to render this pass, it's always called a shadow pass.

A lighting pass traditionally always works with only considering the distance to the light source (and most of the time the face normals). Very modern, so called physics based renderers aside (which are definitely not suited for realtime use), that's the case from since 3d rendering was invented to the latest and greatest 3d engines like Unreal3 or the CryEngine.
Reply
#52
As it may be - in the technical term of the engine it will only be adding a certain amount of dynamic light to a vertex or not. All I am about to change is which vertecies will have dynamic light added depending on more realistic circumstances.
The greatest pleasure in life is to do what people say you cannot do.
Uhm... Honey, there's a head in the toilet!
Reply
#53
Ok, so basically the actuall section of wall will still light up, but it won't fill the whole room with light? Ok. That's fine! Smile
Reply
#54
Quote:As it may be - in the technical term of the engine it will only be adding a certain amount of dynamic light to a vertex or not. All I am about to change is which vertecies will have dynamic light added depending on more realistic circumstances.

Just for the sake of clarity Smile : To achive this, you will have to do some kind of lightsource-vertex visibility check. That's a shadow calculation. In your case on a vertex level.

One relatively simple method to achive this would be to cast a ray from the light source to any vertex inside a lights radius and check whether that ray hits any geometry in between. Considering the very simple geometry of Descent levels, that might work without any noticable performance hit. Otherwise you might want to divide the level into some kind of tree structure (bsp or similiar), if Descent doesn't do this already. One caveat though: partially transparent geometry like open doors or fence like structures (everything with alpha channel transparency) will need special treatment or considered completely invisible to the ray.

Reply
#55
Okay yeah if visibility check == shadow casting then this is right - if you wanna call it this way. But for transparent areas I am not planning any special treatment. Open 2D walls just are ignored in visibility checks.

Quote:One relatively simple method to achive this would be to cast a ray from the light source to any vertex inside a lights radius and check whether that ray hits any geometry in between. Considering the very simple geometry of Descent levels, that might work without any noticable performance hit.
This is by the way exactly what the comparison screenshot shows.
The greatest pleasure in life is to do what people say you cannot do.
Uhm... Honey, there's a head in the toilet!
Reply
#56
Quote:Okay yeah if visibility check == shadow casting then this is right - if you wanna call it this way. But for transparent areas I am not planning any special treatment. Open 2D walls just are ignored in visibility checks.

Quote:One relatively simple method to achive this would be to cast a ray from the light source to any vertex inside a lights radius and check whether that ray hits any geometry in between. Considering the very simple geometry of Descent levels, that might work without any noticable performance hit.
This is by the way exactly what the comparison screenshot shows.

Ha, Ha, great! Then we can begin right from the start again. Since the comparison screenshot so beautifully illustrates the weaknesses of this method on a vertex level...

Big Grin

Reply
#57
I thought the comparison screenshot looked fine...why didn't it exactly? Smile
Reply
#58
@Descenteer:
I am not 100% sure if you understood it right what I wanted to imply - especially witht he Vertex system Descent uses. If two cubes join, they share the Verecies the cubes ar econnected with. This makes for a certain amount of illumination. Maybe not as you'd expect it and no, it does not take into account reflection of metallic materials.
But I think what you most fear is that light shoots out of a tunnel and does not spread at all. But that's not true. Light spreads properly "around" each visible vertex. And to increase the illumination effect we can also incorporate different sight checks vom vertex to plane to cube center to decide what we SHOULD light from a visbility pov and from an atmospheric pov.
But the results of where the light casts and where it does not pretty much matches what my flashlight does if I do some experiemnts in a dark room.

@AFP:
See above. Smile

Asi said, I am not saying soemthign for 100%. But it's also just unnecessary to judge a whole lighting system after ONE screenshot. ESPECIALLY when dealing with such a simple engine like this one.
The greatest pleasure in life is to do what people say you cannot do.
Uhm... Honey, there's a head in the toilet!
Reply
#59
Quote:If two cubes join, they share the Verecies the cubes ar econnected with. This makes for a certain amount of illumination.

And that's exactly what I wouldn't change. It causes glitches with closed doors, true. But open doors on the other hand or simple connections between tunnels look more 'realistic' this way if one might dare to call that realistic at all. And it does so because of this seemingly uncorrect behaviour.

A completely different story is the blue glow in D2 level 1 where faces are obviously lit from behind. That has to be dealt with, but the more I think about this, the stranger I find it. In any game engine I know, geometry is held in various lists, the most important being vertex lists containing the position information and face lists containing three indeces for each face that point to the vertex list and (normally) normal lists that store the face normal for each face.

In case geometry consists of only two adjacent rectangles that would make 6 vertices and 4 triangles, each with one normal. That is enough information to determine whether a triangle gets light from a light source or not depending on whether the light source is in front or behind the triangle. That has nothing to do with the 'shared' vertices. At least in a pure software engine one could always make an appropriate check before a triangle is drawn. Not sure though, how OpenGL handles this. But I somehow can't imagine that OpenGL ignores face normals when applying light.

Btw. Secondary light bounces have nothing to do with metallic reflections (at least not in the cgi sense). Try this (in the real world): in a dark room, take a bright flashlight and point it at a short distance to a white wall. Despite only a small fraction of the wall is lit by your flashlight, the whole room gets illumination due to light bouncing back from the wall into the room. The walls act as secondary, tertiary and so on light sources. While physically that is indeed some kind of reflection, in computer graphics this effect is handled idependently from metallic reflections. One relflects light (GI), the other one reflects surface geometry (metallic reflections).

It's only by accident that the very simple vertex lighting Descent uses, that is totally agnostic of such secondary lighting effects, partly creates something remotely similar due to its own inherent weaknesses.

But why fight something that does more good than harm?



Reply
#60
@Descenteer: Because something is happening somewhere else in the mine and you see the mine where you are, lit up through all geometry... Yeah, It looks like light-scattering on the walls, at the severity weapon flashes would create next room for example, so you argument is valid qualitatively. The point is we still have some light scattering but it's "not so much through the mine". So a quantitative adjustment is sought. By first blocking "through" light and then seeing what to do with light scattering.

But yeah, other than that you have point, impressionistically current lighting could be interpreted this way. Let alone it is less evident without light color, hence perhaps the need to remedy.
Descent Rangers
Captain of Black Lions squadron

The Stalker 21.126
Zica Laser
Guided Micro Bombs
Microcorp HXS Class C
Gravitron PulseWave
Zica SuperCharger
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)