Steps on the floor

Hi there.



I'd like my tanks to mark the floor.



I know bullect impacts are usually done with decays.



For a whole floor I am not so sure. The floor can be big (maybe 4 times the size of the screen). Should I use a simple texture and render it in a second pass, or multiple decays (there would be many many decays then)?



Are decays best rendered in a second pass?



Thank you!

If you are talking about track marks similar to skid marks, I suggest using something like TrailMesh. But if you mean marking where a shot landed, then it may be easier to just lay down a textured quad where it landed. Just keep a pool of these quads and reuse them after they 'expire'. Just some thoughts.

Yeah, TrailMesh at the wheels should work.

I think for STEPs a pool of textured quads is the best choice.

I used this for skidmarks on my racing game.

As I need certain control over spacing between skids, I think a TrailMesh would not be ideal. I am not sure if I can keep a trailmesh within a plane, also…



Quads seem ok. I would  like to keep all marks (not fading them out) so I think I'll need to control their placement so they fill the whole level.



Now, should I go for a second pass in order to do this? Are there other options?

I would just use something like shared node for this.

Sorry nymon, can you develop a bit more on that?



Also, I am unsure about SharedNode functionality… I think it converts the trimeshes into shared meshes but… does it do it recursively?



Anyway I need to play a bit with this…

Since you are are planning to not reuse your skids, a pool of them is kind of useless. So, I was just thinking maybe it would be a good idea to make one quad and texture it, then use shared mesh (I said shared node, but meant shared mesh) that way you don't have to worry about needlessly consuming memory with every new skid. Just maintain a node that you attach all you skids to and you could render those in a second pass, or just attach it to your root node. Looking forward to some screens!

My solution was to attach it to the floor and make a little fix because of the z-fighting.

The fix is just clear polygon offset in onDraw method of the "skidmark Quad".


renderer.clearPolygonOffset();



I made it for skidmark and for shadow.

nymon, from the point of view of the video card, it is better to use one large mesh than many smaller meshes. That's why using TrailMesh would be faster; it might take more memory but the impact would be quite small as each skidmark is about 4 verts.

You should use SharedMesh for large, common, static models, like buildings and trees.



clovis, your idea using polygon offset would work to prevent Z-fighting. I only wish that you could set polygon offset on a ZBufferState rather than renderer/pass as otherwise you would need to have a 2nd pass for skidmarks where you can't attach the TrailMesh to the tank.  :expressionless:

Momoko_Fan said:

nymon, from the point of view of the video card, it is better to use one large mesh than many smaller meshes. That's why using TrailMesh would be faster; it might take more memory but the impact would be quite small as each skidmark is about 4 verts.
You should use SharedMesh for large, common, static models, like buildings and trees.

Good to know, thanks.