OcclusionQuery for Lens Flare Effect

I am attempting to insert the lens flare sample located by the link below into my 3D space shooter. The glow and flares work just fine but only when I manually set the occlusionAlpha value to 1. I believe the problem is the OcclusionQuery.IsComplete call always returns false, hence never allowing the alpha value to be assigned/changed.

http://xbox.create.msdn.com/en-US/education/catalog/sample/lens_flare

Which version of MonoGame are you using, and for which platform are you building your game?
Occlusion Queries are currently working only with DirectX.

The OcclusionQuery for DirectX was added recently. It is only in the MonoGame develop branch and not yet in the official public release.

1 Like

Super helpful, thanks! I spent hours trying to figure this out… I’ll pull from the dev branch.