(no title)
tom_0
|
11 years ago
Hey, generalizing the answer like that is nice, the flood fill is definitely an approximation of that.
However keep in mind that the flood fill is run only once, not per frame, so you have to check that "any ray from face A can exit through any point of face B", so I'm not sure it is easier to compute.
I'm sure there is some way to get closer to this than a flood fill, but for 0.9 it had to be good enough!
Ogre|11 years ago
infogulch|11 years ago
Basically it performs a flood fill on contiguous groups of all the transparent blocks in the chunk. If any group touches two sides they are considered to be able to see each other. Keep in mind this is precomputed and doesn't have a "looking-at" direction.
Perhaps you could perform this test six times, one for each face. Then you would have a direction.
Ogre|11 years ago
Maybe you can do the 6 searches in parallel, such that whenever they meet you know you've found a connection between the two edges they were coming from? I don't know if that means any less work except in cases where all 6 edges are trivially connected.
Scaevolus|11 years ago