View Frustum Rendering

Hi,



In my game, I have to display what a specific character is seeing in the scene. I’ve implemented this in jmonkeyengine using shadow mapping and custom clip planes, and I think it looks pretty nice:






Nice! Is it expensive to calculate?



Would be nice feature for a turn based shooter or something like that… (anyone here ever played Jagged Alliance?)

why is there are black spiderman?

i think this could also be used by some AI-bot to check if the player is visible to him or not and stuff.

Yes, but that would depend on how expensive it is too too (hence my question). For a turn based game that would matter a bit less though…

Core-Dump said:

i think this could also be used by some AI-bot to check if the player is visible to him or not and stuff.


Yes, I'm planning to use occlusion queries to check whether the bot is seeing the player (hide player, render scene, start query, render player, end query).

Since everything is done on the GPU, this is actually quite fast.
The effect uses two additional passes per view frustum (one depth-only for rendering the scene from the bot's view to the FBO, and one non-textured for rendering the red area). This could be reduced to one additional pass when using a shader. However, a shader would remove all the integration with jme's rendering pipeline (lighting, blending, stencil shadows, etc), that's why I chose to go fixed-function only.

The model I'm using is the md5 test model from jmetest without a head :) The one on the wall isn't actually standing there, it just bounced against the wall and is about to fall down (I'm using jme-physics2).

Sounds fun :slight_smile:

anlumo said:

I'm planning to use occlusion queries to check whether the bot is seeing the player


I just implemented it, and it was ridiculously easy. Doesn't seem to cause any performance penalties right now, but my game isn't very taxing anyways. I took care to not check for the result of the query right away, but at the next update cycle. This should help decreasing the pipeline stall.