   Terrain editing/texture painting
  Hi,I'm currently implementing terrain editing and painting stuff and I'm wondering what kind of filtering can be used for standard things like "smooth", "raise-lower" and standard texture painting how is this generally implemented.ThanksEdit: Sorry I posted in wrong forum, Can You move this thread to graphics programming or game programmingThanks   
  Hi there,You can take a look at OGRE's editable terrain scene manager which is open source. This should give you an idea on how to implement it. :)best regards,- Christoph -   ;  In my editor for editing the vertices of the terrain,I first find which point is the center of the edit then depending on the tool radius I raise/lower the points around that vertex.If its a smooth command I just take the average of the 9 vertices and store it on the center vertex and repeat that for all vertices in the radius.To find the point of edit I just cast a ray from the camera which passes through the 3d poisition of the cursor,which is found by D3DXVec3Unproject.As for painting textures it goes the same but this time instead of find the vertex to edit I find the position of the pixel inside the texture of the terrain,after finding that point it is the same as raising lowering,I just change the texture in the tool radius.In my editor the texture is four times bigger than terrain so there are 16 pixels inside a terrain grid.Depending on the intersection with the terrain I find which pixel should be painted.If the terrain is huge and there isn't any partitioning this is slow as hell so I have the terrain divided into chunks so the test first checks if the chunks are visible then it checks the intersection of the ray with the chunks bounding box.Then the ray is tested against the triangles.I hope it helps,I have no idea how it's implemented in professional tools [smile]   ;  Moved to Graphics Programming & Theory at the OP's request.   ;  Thank you.I have already terrain picking, selecting vertex etc. (and the terrain is quadtree based, so it is not slow)In fact, my question was about basic filtering methods used for different brush types for terrain editing."taking average of the 9 vertices" is also known as box filtering, is that used for "smooth" brush. ClickI need more information about different filtering methods.Thanks;  Filtering is all about smoothing rough edges, but it doesn't preserve areas that may not need the smoothing. If you really want an accurate deception of proper movement, check out "Thermal Erosion" : http://oddlabs.com/download/terrain_generation.pdf~Main   ;  There is no need to do ray- triangle check if you can simply check against your height map ;)   