   Blitz3D terrain texture splatting
  Hi guys i am new here and would like to say i been reading a lot of threads and it's all very interesting and a valuable resource, Nice Job!At the moment i am working on an mmorpg, i have got all the networking side of things complete and have mad a small demo which allows me to have some clients connect to my server. In this very simple demo u can attack other players(only one type of attack mind you), there's a simple chat system and above all else u can establish a City, build a mayor's house and plant trees.My dream is to make an mmorpg where players have to build the world themselves very much like Wurm, but i want players to be able to ally/enemy other cities and war with each other. Here is a small video i made of it, it's very basic (no gui as of yet) but u have to remember it was to test the technology only. http://www.metacafe.com/watch/596324/early_game_footage/So i got the networking sorted and just need to create a nice enviroment for players to explore.And this is what it comes down to, i have been reading papers on terrain texture splatting and have been trying to implement this technique into my game but i am having troubles getting my head round the whole concept. If anyone got some pointers or tips of how to implement texture splatting i would love to hear from you.Blitz makes the black part of the alpha image transparent but i need it to mix with the texture. This is where i am having big problems trying to figure out how to get them to mix when they are different scalesSorry for such a big post but i see that u need people to be quite specific when asking for help and have tried to explain it as much as possible.[Edited by - lebensborn on August 24, 2007 9:41:50 AM]
  I am just having problems working out how to mix the image buffers and make them mix with the other layers.  Would appreciate if anyone got some pointers they could share with me.peace.[Edited by - lebensborn on August 25, 2007 9:18:11 PM];  http://www.cbloom.com/3d/splatting/index.htmlhttp://www.cbloom.com/3d/techdocs/splatting.txt   ;  I'm not sure Bloom's article is relevant anymore..most apps now use a pixel shader to blend textures on a per-pixel basis, not per-vertex.Per-pixel blending allows much more control over the blending methods. Basically the goal is to generate, either by pre-processing, or on the fly, a blend map that can be used as an alpha value for linear interpolation between the various textures.if this blend map is a created or modified in the shader, it can be made very high resolution, taking into account per-pixel data like normal maps and perlin noise.   ;Quote:Original post by Matt AufderheideI'm not sure Bloom's article is relevant anymore..most apps now use a pixel shader to blend textures on a per-pixel basis, not per-vertex.Per-pixel blending allows much more control over the blending methods. Basically the goal is to generate, either by pre-processing, or on the fly, a blend map that can be used as an alpha value for linear interpolation between the various textures.if this blend map is a created or modified in the shader, it can be made very high resolution, taking into account per-pixel data like normal maps and perlin noise.Hi, yes i am trying to get pixel/texel based blending to work but it's giving me a head ache.  Blitz allows u to use shaders i believe but here's what i can't work outWhat i tried so far was loading the colour and alpha map into memory.  I then mixed them by multiplying the rgb values of both, the combined texture was called "layer1".The thing i don't understand is, the colour map is supposed to be tiled and scaled smaller than the alpha map.  And the way i'm doing it doesn't allow me to do this, i loose all the detail of the colour map as it is the same res as the alpha when combined.  I think i am making a stupid mistake somewhere in my logic and will hit myself when someone points me straight :DAnyone got any idea where i am going wrong?This is holding my project up badlyhere is the function that textures the terrainFunction TextureGround(mesh)alpha1=LoadTexture("heightmap2_alpha.png") ; i am just using a heightmp for my alpha don't get confused :Pcolour1=LoadTexture("mudgrass_colour.jpg")layer1=CreateTexture(512,512,2+8) For x=0 To TextureWidth(alpha1)For z=0 To TextureHeight(alpha1)SetBuffer TextureBuffer(colour1)cp=ReadPixel(x,z) ;cp colour pixel    SetBuffer TextureBuffer(alpha1)ap=ReadPixel(x,z) ;ap alpha pixel SetBuffer TextureBuffer(layer1)tp=(cp*ap) ; tp texture pixel need to work out how to combine these better :SWritePixel(x,z,tp)NextNext    PositionEntity mesh,128,0,128EntityTexture mesh,layer1,0,0ScaleTexture layer1,4,4  SetBuffer FrontBuffer() End Functio[Edited by - lebensborn on August 26, 2007 8:22:54 PM];  bump   ;  You are setting the texture scale once in startup so everything you draw uses that scale?Can't you specify the texture scale for each texture you use on the object?I mean if you use 4 textures for the terrain each can/should have a different scale.   ;  I dont know what that code means, but why not just use a shader? Its very simple.;  Mmm, i'll check out shaders in google.  Atm i don't really know much about them or how to use them in blitz3D.  Would it be through a .dll?I came up with a quick fix for my terrain engine however.  The people on indie gamer have been proper rude to me so now i wont be releasing my tools to the public for free, whether it be for personal and commercial use.http://img64.imageshack.us/img64/4504/whatitlooksliketa4.jpg   ;  Hi guysBe aware, Lebensborn is using a warez copy of Blitz3D and has threatened to hack websites of people on IndieGamer.  That's us being "proper rude".Link: http://forums.indiegamer.com/showthread.php?t=11547   