New Tiled Terrain Scene Node [works with Irr 1.5]
Where is my mistake?
add few changes in example of ShTlTerrainSceneNode
there are some of them
screenshot of texture
http://imageupload.com/~imageupl/show.p ... 2.JPG.html
screenshot in exe
http://imageupload.com/~imageupl/show.p ... _1.JPG.htm
add few changes in example of ShTlTerrainSceneNode
there are some of them
Code: Select all
terrain->setMaterialTexture(0, driver->getTexture("media/1.png"));
terrain->stretchTextureOverTile(core::vector2d<f32>(0.5f,0.5f));
http://imageupload.com/~imageupl/show.p ... 2.JPG.html
screenshot in exe
http://imageupload.com/~imageupl/show.p ... _1.JPG.htm
Yes it looks like problem with mipmaping. Mipmaps are generated for whole texture not per texture tiles. There is no solution to this jet only some workarounds. You can use offset for your texture tiles. Means UV coordinates would be slightly shifted in to the tile, leaving border. For example upper left tile from your texture:
u1,v1 = (0.01, 0.01)
u1,v1 = (0.49, 0.01)
u1,v1 = (0.49, 0.49)
u1,v1 = (0.01, 0.49)
instead of 0.0 and 0.5.
This will not solve problem entirely however since blended area gets larger with distance from camera and also your graphics card settings are influencing it (as I understand mipmaps are generated by eighter OpenGl or DX driver).
Of course you can turn mipmaps off.
Only real way to get rid of it while keeping mipmaps is generate mipmaps manualy. Hibrid was posting that he is working at some code which would let you access mipmaps: Generating Mimap Manually Lets hope it will get in to some future Irrlicht releases.
u1,v1 = (0.01, 0.01)
u1,v1 = (0.49, 0.01)
u1,v1 = (0.49, 0.49)
u1,v1 = (0.01, 0.49)
instead of 0.0 and 0.5.
This will not solve problem entirely however since blended area gets larger with distance from camera and also your graphics card settings are influencing it (as I understand mipmaps are generated by eighter OpenGl or DX driver).
Of course you can turn mipmaps off.
Only real way to get rid of it while keeping mipmaps is generate mipmaps manualy. Hibrid was posting that he is working at some code which would let you access mipmaps: Generating Mimap Manually Lets hope it will get in to some future Irrlicht releases.
It looks realy good but I have some questions?
I need a realy huge terrain 10k * 10k.
I alraady have a huge datail heightmap from the area 2000x2000 pixels.
I don't need so much detail in the terrain (of course if is more, much better).
I have a bad machine, believe real poor.
So, my question are:
What do you recommend me?:
1)Loaded llike the complete hightmap or in parts?
2)which parameter doy rcommend for every parametor for the terrain
I mean for tile size, total tiles, etc.
3)I am using newton for physic and I need the mesh for passing vertex for newton to create the tree terrain. Can I do this with you terrain?
Any help will be gretfull
Any planning of adding LOD?.
Thanks.
I need a realy huge terrain 10k * 10k.
I alraady have a huge datail heightmap from the area 2000x2000 pixels.
I don't need so much detail in the terrain (of course if is more, much better).
I have a bad machine, believe real poor.
So, my question are:
What do you recommend me?:
1)Loaded llike the complete hightmap or in parts?
2)which parameter doy rcommend for every parametor for the terrain
I mean for tile size, total tiles, etc.
3)I am using newton for physic and I need the mesh for passing vertex for newton to create the tree terrain. Can I do this with you terrain?
Any help will be gretfull
Any planning of adding LOD?.
Thanks.
-
- Posts: 107
- Joined: Sat Nov 04, 2006 9:42 pm
I would recommend testing it yourself to see how your computer handles it. As for tile size at least if you're heightmap is around 2000 pixels across and you need a terrain about 10,000 units across 5 would probably be good.
That would give you a point every five units, which should be plenty of detail for your terrain.
That would give you a point every five units, which should be plenty of detail for your terrain.
Frosty Topaz
=========
It isn't easy being ice-encrusted aluminum silicate fluoride hydroxide...
=========
It isn't easy being ice-encrusted aluminum silicate fluoride hydroxide...
Hi, thanks.
Actually I am setting 5 irrlicht units -1meter because people told me that if I use 1-1 it will see my environmet "small".
For that is that I must multiply for 5 and actually my heightmap is 1500,1500 so I do *33 tile size.
Is that ok? I loose much information? (remember that I have 10k*10k).
Another thing:
if you scale the terrain with terrain->setScale. Then you have serious render frustum problem. It does'nt render huge pieces that it should.
So I think, I shouldn' use setScale, but the option that set the scale on the height map don't make any visual difference like set scale (on the Y axis) do.
What can I do for scale Y without the problem that I mentioned?
Another:
When I use randomizeColour I get a light green (not matter tile size), not a dark saturate green like arras demo.
What could it be?
Could the light off made change this green?.
And the most important:
is it possible that I can not access de vertex?????
I need it for newton tree constructor.
Thanks.
Actually I am setting 5 irrlicht units -1meter because people told me that if I use 1-1 it will see my environmet "small".
For that is that I must multiply for 5 and actually my heightmap is 1500,1500 so I do *33 tile size.
Is that ok? I loose much information? (remember that I have 10k*10k).
Another thing:
if you scale the terrain with terrain->setScale. Then you have serious render frustum problem. It does'nt render huge pieces that it should.
So I think, I shouldn' use setScale, but the option that set the scale on the height map don't make any visual difference like set scale (on the Y axis) do.
What can I do for scale Y without the problem that I mentioned?
Another:
When I use randomizeColour I get a light green (not matter tile size), not a dark saturate green like arras demo.
What could it be?
Could the light off made change this green?.
And the most important:
is it possible that I can not access de vertex?????
I need it for newton tree constructor.
Thanks.
-
- Posts: 107
- Joined: Sat Nov 04, 2006 9:42 pm
You'll have to try it and see if you think it's enough for your game/demo.Vsk wrote:... so I do *33 tile size.
Is that ok? I loose much information? (remember that I have 10k*10k).
That's true. Arras' code uses the tile size and a scale parameter when loading a heightmap for scale. To set the height you want to use the second parameter of the loadHeightMap() function. That value will be the maximum height (in Irrlicht units) that the mesh will be generated to. Note that it will only get that height at a full white pixel on your heightmap.Vsk wrote:if you scale the terrain with terrain->setScale. Then you have serious render frustum problem. It does'nt render huge pieces that it should.
So I think, I shouldn' use setScale, but the option that set the scale on the height map don't make any visual difference like set scale (on the Y axis) do.
What can I do for scale Y without the problem that I mentioned?
As for the rest I'm not sure. But I believe you should be able to get the vertices to use when constructing the physics stuff you need.
Frosty Topaz
=========
It isn't easy being ice-encrusted aluminum silicate fluoride hydroxide...
=========
It isn't easy being ice-encrusted aluminum silicate fluoride hydroxide...
loadHeightMap() function can load only one pixel for one tile corner so if you have 2000x2000 heightmap you need terrain 1999x1999 tiles large. If you need your terrain to be 10 000 x 10 000 units large than you gona need 10 000 / 1999 = 5.003 units large tile (I think 5 would be ok) If you want larger tile than you have to lower number of tiles in terrain and also smaler height map. For example tile 10 units large will give you terrain 999x999 tiles large and heightmap 1000x1000.
setScale() function doesn't work with my terrain node as well as setRotation() so do what Frosty Topaz wrote. Use scale parameter of loadHeightMap().
randomizeColour() is not part of terrain node, it was written to support my demo. When randomizing it takes in account height of tile so your problem is probably that your terrain is simply different scale. You have to alter that function if you want to use it...
It does not take tile size in account. It also doesn't matter if your lighting is on or off.
There is no function which would let you access vertices's directly but you can easily add one yourself. You can access individual vertices via Tile parameter most easily which is of TlTTile type ...look in to TlTmesh.h. Tile is private so eighter you need to make it public or create function which let you access it.
Other way would be to make access in to Sector which is in fact mesh buffer and holds vertices directly.
If you need some more help with it, ask here...
[Edit:] there is one problem ...terrain itself contain no vertices (Irrlicht vertices) only part of terrain currently rendered has them.
setScale() function doesn't work with my terrain node as well as setRotation() so do what Frosty Topaz wrote. Use scale parameter of loadHeightMap().
randomizeColour() is not part of terrain node, it was written to support my demo. When randomizing it takes in account height of tile so your problem is probably that your terrain is simply different scale. You have to alter that function if you want to use it...
It does not take tile size in account. It also doesn't matter if your lighting is on or off.
There is no function which would let you access vertices's directly but you can easily add one yourself. You can access individual vertices via Tile parameter most easily which is of TlTTile type ...look in to TlTmesh.h. Tile is private so eighter you need to make it public or create function which let you access it.
Other way would be to make access in to Sector which is in fact mesh buffer and holds vertices directly.
If you need some more help with it, ask here...
[Edit:] there is one problem ...terrain itself contain no vertices (Irrlicht vertices) only part of terrain currently rendered has them.
HI, thanks for your response.
Now I am worr about your edit, what do you mean, I don't understand it completly.
Where did you storage the rest of the vertices? This informationn must have in some place right?
More else what only would need is create a Mesh (irrlicht mesh) temporaly to pass it to my function, this mesh must have all terrain vertices (in correct form of course).
So, where can I find the information to create this mesh?.
Besides: What represent "sectors" in your terrain? I have red several time in this post that you named them but realy I don't know what they are.
Thanks for you help.
By the way Nico would add your terrain? This will be I think the most import add that irrlicht will had in some time. And realy get Irrlicht to a higher professional level. And if you add LOD.... well it will kick ass
Now I am worr about your edit, what do you mean, I don't understand it completly.
Where did you storage the rest of the vertices? This informationn must have in some place right?
More else what only would need is create a Mesh (irrlicht mesh) temporaly to pass it to my function, this mesh must have all terrain vertices (in correct form of course).
So, where can I find the information to create this mesh?.
Besides: What represent "sectors" in your terrain? I have red several time in this post that you named them but realy I don't know what they are.
Thanks for you help.
By the way Nico would add your terrain? This will be I think the most import add that irrlicht will had in some time. And realy get Irrlicht to a higher professional level. And if you add LOD.... well it will kick ass
Another question:
if had loaded the terrain from a height map and then want to add some texture that begins in some tile and ends in some tile. whay should I do?
Using strecht texture?
What I have is 50.000 units terrain, that represent 10k*10k. (5/1).
If I want to add a texture size 4000x4000 pixel and that this one ocupe 2k*2k.
What should I do?
Is this cod ok?
//50.000 unitis terrain (real world-irrlicht scale 5-1) (10k*10k)
//
This code don't work me. It shows me the texture but diffuse or something like that.
Thanks
if had loaded the terrain from a height map and then want to add some texture that begins in some tile and ends in some tile. whay should I do?
Using strecht texture?
What I have is 50.000 units terrain, that represent 10k*10k. (5/1).
If I want to add a texture size 4000x4000 pixel and that this one ocupe 2k*2k.
What should I do?
Is this cod ok?
//50.000 unitis terrain (real world-irrlicht scale 5-1) (10k*10k)
//
Code: Select all
ShTlTerrainSceneNode* terrain = new ShTlTerrainSceneNode(smgr, 1000, 1000, 50, 30 );
terrain->drop();
// load height data from texture
terrain->loadHeightMap("../../media/terrenoAlt3.jpg",250);
// load color map
//4000*4000 texture to put in 2k*2k = 10.000*10.000 units
terrain->loadColorMap("../../media/texturappa.jpg",0,0);
terrain->smoothNormals();
// set detail texture
terrain->setMaterialTexture(0, driver->getTexture("../../media/dirt_x_43.bmp"));
// stretch the texture * 2.5.
terrain->stretchTexture(core::vector2d<f32>(2.5f,2.5f));
Thanks
Sorry about so much question, but realy need to know and I have try but don't get it.
If I want to load a texture betwen some tiles lets say tile 0,0 and tile 500,500, How I do it?
First at all, should I use LoadColorMap ???? or something else?
if the texture has more pixels (or less) that the units in the area, what should I do, use strecht texture, strechttexturtile, resize the image in an image editor???? which?
Thanks.
If I want to load a texture betwen some tiles lets say tile 0,0 and tile 500,500, How I do it?
First at all, should I use LoadColorMap ???? or something else?
if the texture has more pixels (or less) that the units in the area, what should I do, use strecht texture, strechttexturtile, resize the image in an image editor???? which?
Thanks.
My terrain draws only portion of its surface at any one time typically. All data about terrain are stored in structure Data (you can find it in private part of ShTlTerrainSceneNode) Data is array of TlTData type which is defined in TLTMesh.h.Where did you storage the rest of the vertices? This informationn must have in some place right?
To render something however Irrlicht require that array of S3DVertex2TCoords is created. This is done on run time from Data array and is stored in Sector (which is private member of ShTlTerrainSceneNode) which is array of TlTSector type. It is defined in TLTMesh.h.
Beside Sector you can get access in to vertex array via array Tile which is of TlTTile type (defined in TLTMesh.h). Via Tile array you can get access in to vertex array in ordered manner based on position of vertex in tile.
However as was written at the beginning, vertex array is build and updated on run time and holds vertices only for part of terrain which is rendered.
To create Irrlicht mesh you want access in to Sector array since it holds both vertex and index of vertices. In fact TlTSector object is very similar to SMeshBuffer. It serve as mesh buffer for my terrain. With exception of material, which is kept on ShTlTerrainSceneNode level.
Visible part of terrain (means tiles which are rendered) is further cut in to smaller parts which I call sectors. These sectors are represented in array Sector which is private member of ShTlTerrainSceneNode. You can graphically view sectors if you switch debugging modes in my demo. One of the modes renders their bounding boxes.What represent "sectors" in your terrain?
This is quote from comunication between me and afecelis about modeling forum, menas quit old alreday. I hope he don't mind shoving it here:By the way Nico would add your terrain?
However design team probably decided against ti.BTW, Niko and us in the team are very impressed by your terrain scene node. Niko says he's always wanted that kind of node for Irrlicht, so we're discussing the possibility of merging it into the source. Would that be ok with you?
You build terrain 1000x1000 tiles large but you are loading color map 4000x4000 pixel large. loadColorMap() assign one pixel to one tile. This is hard coded, you cant have more pixels per tile. That means that only first 1000x1000 pixels are read from your file, rest are simply ignored.This code don't work me. It shows me the texture but diffuse or something like that.
Only way hove to change color of tile (apart of loadColorMap()) is with setColor() function. All other function like stretchTexture() work with detail texture ...in your case with "media/dirt_x_43.bmp"
Thanks for you reply, very informative.
I'll see if I can create the irrlicht mesh (am not so capable about vertext handle but I try ).
But the last thing you told me realy set me down .
I thought your terrain allows put textures per tile.
But I continue without undertand, why your terrain allows stretch up and down detail texture per tile and not for image texture (the most important).
Is it to hard to implement?
The other thing, distribuit a texture between the tiles I want, it is to hard to implement too?
In case this last two thing are hard to implement
¿What can I do for put a texture in my huge terrain and this one don't look crapy ? ).
Because, my problem is performance, and if take tile size =1 (when my uniti 5 unitis = 1 meter) then I will have 50.000 tiles* 50.000 tiles!!!! for my terrain. And if want some 1000 meter of vision (render size) this will mean 5000*5000 tiles to RENDER!!!!. And my computer doesn't handle at all, even your demos in my machine runs at 250 fps.
Any suggestion?
Thanks again.
I'll see if I can create the irrlicht mesh (am not so capable about vertext handle but I try ).
But the last thing you told me realy set me down .
I thought your terrain allows put textures per tile.
But I continue without undertand, why your terrain allows stretch up and down detail texture per tile and not for image texture (the most important).
Is it to hard to implement?
The other thing, distribuit a texture between the tiles I want, it is to hard to implement too?
In case this last two thing are hard to implement
¿What can I do for put a texture in my huge terrain and this one don't look crapy ? ).
Because, my problem is performance, and if take tile size =1 (when my uniti 5 unitis = 1 meter) then I will have 50.000 tiles* 50.000 tiles!!!! for my terrain. And if want some 1000 meter of vision (render size) this will mean 5000*5000 tiles to RENDER!!!!. And my computer doesn't handle at all, even your demos in my machine runs at 250 fps.
Any suggestion?
Thanks again.