Explosion marks on Terrain

Blitz3D Forums/Blitz3D Programming/Explosion marks on Terrain

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Since it's likely that you are using a tiling texture for the terrain, you cannot simply draw the black color to the terrain texture. There are two alternative methods:

1
Use a towel mesh that will be aligned to the terrain surface. This towel mesh will contain the explosion traces, using alpha transparency (use TGA with alpha channel for invisible parts of the texture).
2
Use a second texture layer on the terrain that stretches exactly one time across the entire terrain. Then simply draw the black color to the coordinate where the explosion took place. You have to calculate this coordinate using a formula that goes something like
x=(terrain_width# / (explo_x# - terrain_x_start#))* texture_2_width()

where terrainwidth is the worldrelative width (segments * scale ?), x_start is the true world coordiante, where the terrain starts, explo_x is of course the world coordinate of the explosion, and texture_2_width is the width in pixels of the second texture layer.

But there's a problem with alpha textures and drawing to them: Alpha information gets lost, so you probably have to update the alphachannel manualy. Try to use flag 256 on the texture, maybe this helps too.

If you won't use a true Terrain, but instead a Mesh based terrain, then you could use VertexColor to make some parts black, using linepick, pickedsurface and pickedtriangle etc.

Try the free landscape editor some of are currently working on, in the blitz creations zone of this forum.