Bug in rendering algorithm?

(sparhawk) #1

I tested this setup in other 3D programs also and they behave the same, though I don’t understand why they do it how they do it. :slight_smile: Maybe somebody can explain this to me. I#m a newbie so don’t wonder that I don’t understand this. :slight_smile:

My first try was with Maya but now I switched to Blender and I want to stay there.

I was creating a fireplace in a room and placed a light inside the fireplace. When I rendered this I noted that the light is leaking through the walls of the fireplace and is refelcted on the walls of the room on places where there should be no light visible. As if the walls of the fireplace were partially visible.
Now I tried a little test with Blender and it behaves the same. The setup is rather simple.
I created a cube and scaled it a bit larger. Then I placed another smaller cube inside it. I positioned a camera into the large cube pointing to the small cube. Then I placed a lamp inside the small cube. What I expected to see when rendering this is a complete dark image because the light is fully contained in the small cube. What I got instead was a dark small cube and refelctions on the bigger cube (The same behaviour that the Maya renderer exhibits).
The light is only reflected on sides of the cube that are not visible to the camera. Now that I think of it I guess what happenes here is that the invisible faces (to the camera) are culled by the render algorithm first. Then the light is considered and since it has no faces blocking the light on the backside it shines through.
If this is the case how can one prevent this? How can I position a lightsource in an object such that it doesn’t shine through to other objects? My setup is, of course, a bit artificial but the problem is that in a normal setup (like the one with my fireplace) this problem pops up because I have light in places where none should be.

(hannibar) #2

This is just the way light behaves in computer graphics. When you don’t want the light to leek through the walls you will need to cast shadows.
In blender this is only possible with spotlights now.

(LaWMan) #3

You can also work around this by enabling “layer” in the lamp buttons, this will make the lightsource only affect the objects on the same layer as the lamp.

(soletread) #4

Actually I have noticed this as well, but WITH spotlights and with shadows enabled. Light leaks through the joins of one object to another. For eg. 2 walls placed next to one another to form a corner object. There is no gap between these 2 as one intersects the other.

Only extensive fiddling with the shadows parameters helps but not 100% perhaps 99%.

(sparhawk) #5

Thanks! That works. Only the light is no cut off when it should get out of a cube with one side opened. Somebody suggested using shadwos, maybe I can work something out with these two hints.

(stephen2002) #6

what you have described is essitally a known bug in shadow mapping.

it might help to extrude the cube (i.e. make the wall thicker) just a slight bit so that it has more to work with.

(sparhawk) #7

I extruded all vertices and created a second cube around it with that, but that doesn’t really help, though it’s a bit less light leaking through.

(S68) #8

There is less light because cube is bigger.

You must use SPOT lights, in blender, and you must enable Shadows in rendering. All other lights/methods shine through