   "Fading away" occluding primitives
  Hello all,I have a question to ask; I'm not sure exactly how to phrase this, so please bear with me.  I render terrain as a collection of 3D "tiles," much the way that traditional tile-based 2D games are done, except that each tile is represented as some small number of primitives.  For example, a traditional wall segment would involve two triangles for the "floor" of the tile and two for the "wall" of the tile, and perhaps some sort of trim at the top of the wall.My problem is that, of course, the player (or other characters) can walk into the area which is occluded by the terrain.  Fading out the wall is one solution; rendering an outline around the character or object is another.My question is this: Right now, level geometry is procedurally generated (from a 2D map of tiles) and placed in a vertex buffer object.  I can think of two ways to create the "fading out" effect.  First, I could update the level geometry every level and give each vertex an alpha value.  Second, I could keep level geometry static and do something fancy in a shader.Rewriting the vertex buffer seems relatively expensive, even if there's not very much geometry in it.  Then again, I have no idea how to implement that functionality in the shader.  How would you approach this problem?Best,Oberstille   
  I would either fade it at the object layer or update the vertex buffer.At the object layer you'd set a transparency parameter in the shader before you drew the triangles. If you used some kind of transparency mask, you could make only a portion of the tile fade out. You could project the mask onto the object from the views perspective. Imagine like a xray flashlight.Alternatively you could update the vertex buffer, which really should not be that expensive. You can lock just a portion of the vertex buffer that you want to update. It should be able to just resubmit that locked portion.   