Light-Mapping Question

Miscellaneous Forums/General Discussion/Light-Mapping Question

I am currently using the YAL (Yet another lightmapper, codearchives) source. It's using Linepicks to determine the visibility of a certain lumel. I wonder how could I make it work with masked and alpha textures?

This may be of some use?
http://www.blitzbasic.com/codearcs/codearcs.php?code=515

You could use it to find the picked texel colour/alpha, and use that to calculate the lumel intensity. Is that what you mean?

Yes, thanks, that may be a solution. Tho, i think this would require to hack the brush properties (as described in the B3D tutorial section), so I'd be able to recognize brushes with the alpha or mask flag set. Additionally I would then have to "continue" this linepick, from the picked coordinate, using the same vector as before.
I am afraid this will be pretty slow due to the texel reading that is required to determine the picked RGB.

I was also thinking about to use Renderworld with a 1*1 pixel cameraviewport.

Or, as an insane idea: paint every lumel with an individual color, then use an enviromental render to determine the visibility of each lumel from every light position.
(tho this still won't solve the transparency problem, but I guess it would be much faster). Not sure if i's possible to color lumels in an accurate way.

I think a directional light could easily be realized this way by using a orthogonal camera.

I'm still searching for further ideas/solutions

Additionally I would then have to "continue" this linepick, from the picked coordinate, using the same vector as before.
This shouldn't be too much of a problem, as LinePick takes a start x,y,z, followed by a delta (offset) x,y,z. Once a hit has been made, you can then just do another LinePick from the hit x,y,z, and use the same delta x,y,z as the previous LinePick. That should work, right?

I was also thinking about to use Renderworld with a 1*1 pixel cameraviewport.
That's an interesting idea!

I'd pick it, get the triangle, get the texture coordinates based on the weighted averages of the vertex positions, sample the texture at the UV coords, and use the alpha of the sampled texel.

Hey Noel this will indeed simplify the job, thanks.