YAL update

Blitz3D Forums/Blitz3D Programming/YAL update

Marcello, we seem to be having some difficulty communicating. You're clearly still confused about some of the thing I've said. :-)


For example:

"First I tried to move to the "vertices" of the lumel quad as you mentioned, but keeping the rays inside the lumel showed better results. And as you said, firing rays to the corners is unnecessary, it will have the same effect as a blur effect in the image."


That has nothing to do with what I was talking about. :-)


What I said was:

"Do not fire 4 rays and then average the result."

"Instead, fire 4 rays at each corner of the lumel, and if any of them are illuminated, illuminate that pixel."


I did NOT say that firing them at the CORNERS was the problem. Firing 4 rays and then averaging them is the problem. Firing 4 rays at the corners and then illuminating the lumel if any of the 4 are in light is perfectly fine.


Also, I told you a way to speed up the lightmap rendering 4x. But if you cast your rays to areas that are NEAR the corners, rather than AT the corners then you will not be able to use that optimization.

There is NO benefit to casting the rays NEAR the corners instead of ON the corners.




"One thing that needs to be done in the lightmapper is to somehow use the vertex normal data to generate smooth curved surfaces, try to apply a lightmap to a sphere or cylinder to see how ugly it will look. :)"

Yes I was thinking about this myself.

This is a big problem, because if you break the sphere up so that you can use multiple lightmaps, then the lumels will probably not line up properly. I am not sure of this, but I suspect it is true.

If that is NOT a problem, then all you need to do is interpolate the vertex normals across the triangles like you would do with phong shading. That is kind of an expensive operation to do, but since you don't need to do it in realtime it should be fast enough to be tolerable.





I do not see any dark edges on the corner wall there, but that does not mean there aren't any.

Could you render a close up of that angled wall in the distance, and when you do so, could you disable all ambient light, and increase the brightness of the nearby light source?

Your 4x lumel averaging thing you've been doing might be hiding the dark edges, but I do not see anything in your code which would get rid of them completely, so I suspect they are stiull there and I just can't see them at this distance with this lighting.

I suppose I will do a test myself as well now. I will fix your moveentity commands while I'm at it just so we're doing the same thing.