EntityTexture Question
Blitz3D Forums/Blitz3D Programming/EntityTexture Question
| ||
Hi ! I create a nice texture for my landscape now I would like to add detail in it ! What I would like to do is to make another big texture that will cover the landscape like the color texture, but with detail only, I don't want to use one small texture of 256x256 over all over my land.. terrain = LoadTerrain ("TestBig.bmp") ;load the heightmap ScaleEntity terrain, 1, 100, 1 ; does't scale the landscape ground = LoadTexture ("Detail1.jpg") EntityTexture terrain, ground,2,2,; repeat it across the landscape to give detail when close up What I don't know is... EntityTexture terrain, ground,2,2 the 2,2 value mean 512/2 = 256 so the texture is stretched to be able to apply it 256 time .... if I try to make a big detail texture how can i resize a picture of 256 at that size without loosing quality ? Blitz3d does't seem to have trouble stretching it , so what is the trick ? |
| ||
I have been working with some texturing effects. Looks like you are looking at the same problems that I have been looking at for about a month. Textures look great on terrain with a height map and light map.. However. land detail is vague and the textures copys over the whole world. In order to textures diffrent areas of the world with diffrent textures I think we need to focus or attention on position textures. posibly load more then one texture. been testing and still testing.. I am looking to get a effect from blitz such as you can get with Big World Editor. It dont look like this will be easy... But I bet the effect would be posible. Thanks, Shawn Gaughan http://www.nemesisstudios.com/ |
| ||
Not sure if it's possible, I think Mark don't resize the texture with EntityTexture but resize the terrain to fit the quantity of texture the flag required.. humm, it's probaly why when we scale the terrain it slow down the framerate i guess.. but I hear that there a program that can resize picture and it analyse the original source to reproduce the same quality with the reduce picture but I don't remember the program's name. Regard |
| ||
I am working on the same type of program. What I came up with is I created a mesh and then made copies of it to use as terrain tiles. Each tile has it's own texture. I also made random textures to use for the tiles. Here's my tile function. Function CreateTile1() ;Create one tile and return for storage in tile array Local m=CreateMesh() ;temp mesh Local ss=CreateSurface(m) ;,b ) ;temp surface For nx=0 To 27 For nz=0 To 27 V(nx,nz)=AddVertex(ss,nx,0,nz,(nx*0.0352),(nz*0.0352),0 );create all vertices Next Next tt=0 For x=0 To 26 Step 2 ; 0-6 has 16 triangles (16x16=256) For z=0 To 26 Step 2 ; t(tt)=AddTriangle( ss,V(x,z),V(x,z+1),V(x+1,z) ) ; tt=tt+1 t(tt)=AddTriangle( ss,V(x+1,z),V(x,z+1),V(x+1,z+1) ) tt=tt+1 If z< 26 Then t(tt)=AddTriangle( ss,V(x,z+1),V(x,z+2),V(x+1,z+2) ) tt=tt+1 If z< 26 Then t(tt)=AddTriangle( ss,V(x+1,z+2),V(x+1,z+1),V(x,z+1) ) tt=tt+1 If x<26 Then t(tt)=AddTriangle( ss,V(x+1,z),V(x+1,z+1),V(x+2,z+1) ) tt=tt+1 If x<26 Then t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+2,z),V(x+1,z) ) tt=tt+1 If z<26 And x<26 Then t(tt)=AddTriangle( ss,V(x+1,z+1),V(x+1,z+2),V(x+2,z+1) ) tt=tt+1 If z<26 And x<26 Then t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+1,z+2),V(x+2,z+2) ) tt=tt+1 Next Next Return m End Function This creates a 27x27 unit mesh. The If .. Then statements are only needed for an odd sized tile. If you use an even size for your tiles, you can leave them out. I placed 1 tile at the centre and then placed 8 around it in a ring. I then scale the mesh x 3 and make a ring around preveous 9 tiles. I did this for 8 rings each 3 times bigger tiles then the preveous. I have a viewing area that's 88,000 units out from my centre and it renders at more then 300 fps in debug mode. This may help you out. I am looking for people that have a similar goal as me to design an awsome outdoor world. That's why I am passing this on to you. I may get new ideas from you too. |
| ||
You could build a detail mesh around the players position. This could be done every frame or every few frames if that was too slow This detail mesh can then be overlaid on top of the terrain and either blended or alphad so that the terrain underneath shows through it. I'm sure someone I heard of someone doing this, not sure if it was in Blitz or some other language. |
| ||
I will try to use in the code archive the code for painting directly on the texture, maybe I could get a better result if I try to paint detail directly instead of painting over the primary texture and see result direcly in real time. |