Imposters

Renanse has decided to free me of Imposters so I can focus on CLOD meshes. So, for any discussion that needs to be done, do it here…



Imposters will be a simple Quad that displays a texture. Typically, Imposters will be attached to a billboard node (although they don’t have to be). What makes imposters unique is it contains a reference to some trimesh geometry and uses this geometry to render to a texture. This will give the appearance of many vertices while only being that of the quad.



Imposters can be updated. Time based and positional based. A specified time interval can be set. When that interval is reached the geometry is updated (any animation can occur, etc) and the texture is re-rendered. So, you could set the interval for say 1/2 second. So the geometry would be rendered twice a second, giving some form of animation but low detail. (Perfect for objects far away). Positional based updating determines if the angle between the camera and the object has changed enough to warrent a re-rendering of the geometry to reflect the new angle. This includes both movement of the camera as well as location changes of the quad.



Both update values will be defined by the user, and each can be turned off is so desired.



The texture generated will completely show the geometry. That is, the geometry will be completely shown within the texture, and be as large as possible.

First cut done… however, the imposters do not look right… :confused: The problem is the texture camera. Basically, I had the camera placed on a line connecting the viewer and the center point of the imposter geometry at a distance such that the geometry would fill the screen. (Camera pointing at that geometry center point) The problem is, The perspective at that location is off.



Imagine looking straight at a box and strafing left and right. The front face stays straight and as you move far enough to the left and right you see a perspectively drawn left or right face (trapezoid)



If you view that face from the texture camera though, the front face becomes a trapezoid because you are looking from the side, turned towards the center of the box. There’s not much to do to help the situation though because you can’t position the camera in such a way as to get a proper perspective.



Looking around the net, I’ve found a lot of mention of imposters and billboards, but almost nothing on dynamically recreating their texture. The one place I found information on it mentioned drawing from the viewer position and then slicing out the sub rectangle surrounding the geometry and using that as a texture. I’m going to try to do something along those lines using texture coords instead.



Also, I’m wondering if we need to alter the design to include some kind of internal switch where it will fall over to using the real model, instead of a quad with the model painted on it, if the viewer is within a given distance. Most papers I’ve read on imposters have said this is necessary to acheive realism.

Good first cut. It’s looking very promising, and the "defect" is not all that bad. However, I am quite suprised by the frame rate. I get 150 FPS. How often ar e you updating the imposter?


Also, I'm wondering if we need to alter the design to include some kind of internal switch where it will fall over to using the real model, instead of a quad with the model painted on it, if the viewer is within a given distance. Most papers I've read on imposters have said this is necessary to acheive realism.


Imposter is intended to be added to the Discrete Level of Detail node as the lowest detail level. So this has been taken into account. You would typically add the imposter to the DlodNode and set it's distance as far.

Actually, in the demo it’s at a set rate of .01 (every 10ms or approx 100x sec)… This is probably too high, however locally I still get a rate of about 1200FPS… is 150FPS on your laptop or at home?



Once I saw the perspective issue, I spent all my time trying to fix that, so the rate is settable as we desired, but the max camera change detection is not yet implemented.



That’s good news about the DLOD nodes. Off the top of my head, I wasn’t sure if you could use Nodes under that or if you were restricted to Geometry.

That was on my home PC… I just tried it on the laptop at get about 215 FPS. I’ll re-run it on the home PC when I get back and recheck. Perhaps something was running in the background.

Ok, Imposter is going to be slightly off in terms of perspective for the time being. It doesn’t pose a big problem at the normal distances for imposters anyhow, so should be ok.



Also, the test example now uses our md2 model. FPS I was getting in original: 60FPS imposter: 1,200FPS… not too shabby.



The camera distance is set manually by the user right now. I suggest grabbing the TextureRenderer from your Imposter node and setting the background color to something with an alpha of 1, and playing with cameradistance until it looks right, then get rid of your change to the bg color.



Also, right now it will update based on time passage only. It’s set to a default rate of .05 (or 20 times a second) which is about your average cartoon. You are free to set that with setRedrawRate(float) I’ll get the camera change update in there soon.

Ok, check against camera angle is now in there. We don’t have to check changes in proximity, just angle. You specify the change threshold in radians.



Enjoy!

Strange, I’m only getting 500 FPS on my home PC. Is there really that much difference between a Radeon 9800 and a 9700?

linux – exactly what it says on the tin!



lol, the FPS in windowed is the same as fullscreen!

Hye great, this is going to help alot. I was asking ealier about rendering models to textures for this exact reason. I was going to build my entire game engine using these Imposters based on a perspective change with a mixed dynamic fps to timer. Meaning that a less fps would dynamicly drop settins like clipping plane, LOD bias, Imposter update so ect. I personaly thought a perpective change would considerebly increase performace on larger scales and mostly in static terrain, obviously a fighting game would have seen a lot less performance increase.



but this saves a lot of time. Glad I chose jME, i had a good feeeling about it. Looks like it’s going to pay off.

FYI: I should also point out that you while you can use the automatic time based or camera angle based updating (or both) for Imposters, your game could also use neither and control the updating manually via a few method calls on the imposter node if you so wished.