Vertex Occlusion

Blitz3D Forums/Blitz3D Programming/Vertex Occlusion

Jim Teeuwen(Posted 2004) [#1]
Tought one here.
Again conceerning the particle system.
I'd love to be able to exclude particles from my emitter mesh based on visibility.
I've tried a simple LinePick with EntityPickMode set to polygon, but this doesnt appear to work.

Any ideas on occluding vertices from a mesh that arnt visible in view?

The actual loop through all vertices is performed allready nearly every loop (used to rebuild the Emitter mesh with changed partricle/vertex data), so it can be hooked in there if there needs to be a per vertex comparison. So that shouldnt pose a big problem regarding performance.


Klaas(Posted 2004) [#2]
you could use a pivot with EntityPickMode and EntityRadius set and position the pivot to the vertex position, then test against the pivot.
If you only check if there off the view (not hidden behind something) then you could use the way faster EntityInView command using the pivot as representation of the vertex.


Jim Teeuwen(Posted 2004) [#3]
there's an idea. I'll have a fiddle. thnx


jfk EO-11110(Posted 2004) [#4]
You didn't say if this particle system uses a single surface or a multiple surface system. If it's single surface then entityInVIew and EntityVisible are useless.

If it's a multiple surfaces system then you COULD access every particle with EntityVisible, linepicks, EntityInVie etc.

But EntityInView is pretty useless since it will be ignored by the renderer anyway if it's not at least partially in View.

EntityVisible only checks it's Center Point, and is slow as death. The same goes for all Linepick-Commands: simply way too slow.

If you are using sprites or quads which face to the camera all the time, then you could think about to exclude based on obstacles. But this is prettxy hard when the sprites fade to transparence on the edges - which is very likely. Anyway, if you know that the inner half of the sprite is opac then you could check if the more distant sprites are hidden behind the near sprites, projecting their edges by multiplying x and y by z.

You could use a dynamic array of near sprite edges and build a list of hidden projected rectangles based on it.

I am afraid this was more confusing than useful :)


Jim Teeuwen(Posted 2004) [#5]
lol tis indeed confusing, but interesting :)
ANyhoo, as I failed to mention. it is a single surface particle system. (arn't they all the hype these days).

I had a play and decided that for expensive occlusion to be usefull it would have to be about clusters of about 1000 particles at once, else the occlusion computation would only take longer than actually rendering em all.

So basicly, occlusion is summin that isnt critical to performance in my case and can be left for what it is. (for now anyways)


Ross C(Posted 2004) [#6]
What i am going to do is have a blitz primtive be the spread of the particle emittor. So each time i check the emittors, i will do an EntityInView check. I will not update any emittors that aren't in view, unless they perform a vital function that needs to be done.

Fire and such i will use an invisble cylinderfor the emittor. Check this with EntityInView. If it cannot been seen, then don't update the emittor. Which is where speed is lost. Updating particles. :)