New Tiled Terrain Scene Node [works with Irr 1.5]
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
Arras.... you are a great man... lol
This works now!! i didn't tested very much because i'm in job.. but this noght i will start to play with this baby... it seems that its only a matter of calculate wich size i want for my terrain...
Thank you very much arras!!!
PS: I've tested your Blender yesterday... no words... it's AWESOME!
EDIT:
One issue left... i don't know if you know something about this.. but when i close the irlicht window i got a windows error like this..
This works now!! i didn't tested very much because i'm in job.. but this noght i will start to play with this baby... it seems that its only a matter of calculate wich size i want for my terrain...
Thank you very much arras!!!
PS: I've tested your Blender yesterday... no words... it's AWESOME!
EDIT:
One issue left... i don't know if you know something about this.. but when i close the irlicht window i got a windows error like this..
If you know what it is.. great.. if not.. nevermind!Debug Assertation Failed!
Program: d:\MISC\Nokturna.exe
Expression: _BLOCK_TYPE_IS_VALID (pHead->nBlockUse)
A caos world where only the strongest lives, weak is not an option... you must fight.. Nokturna!!
http://nokturna.varholl.com.ar
http://nokturna.varholl.com.ar
well nevermind... the only thing left is that the terrain is not getting the right color from the colorMap.. my code is this
Any idea???
From the other error... nevermind... i will fix it surelly..
EDIT:
One questions..
LoadColorMap.. works like LoadHeightMap?? so i can load different color maps setting the right parameters of position??
Thanks!
Code: Select all
ShTlTerrainSceneNode* terrain = new ShTlTerrainSceneNode(smgr, terrainWidth, terrainHeight, tileSize, meshSize);
terrain->drop();
terrain->loadHeightMap("terrain/mapafinal2.bmp", 400,0,0);
terrain->loadColorMap("terrain/nokturnafinal_TX.jpg");
terrain->setMaterialTexture(0, driver->getTexture("terrain/detailmap3.jpg"));
terrain->smoothNormals();
terrain->stretchTexture(vector2d<f32>(60.0f, 60.0f));
From the other error... nevermind... i will fix it surelly..
EDIT:
One questions..
LoadColorMap.. works like LoadHeightMap?? so i can load different color maps setting the right parameters of position??
Thanks!
A caos world where only the strongest lives, weak is not an option... you must fight.. Nokturna!!
http://nokturna.varholl.com.ar
http://nokturna.varholl.com.ar
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
varholl >> yes, loadColorMap() works the same way as loadHeightMap(). With exception of scale. There is none of course. Look inside ShTlTerrainSceneNode.h each function, its return value and parameters are described there.
What is working wrong when zou load color map? Your code seems to be OK.
monkeycracks >> you have to use some bitmap editing program like Phothoshop or Gimp. Create large new file, then copy textures in to it one by one. You have to decide order in which you put them in since their position inside (UV coordinates) are used to put right texture tile on right tile on terrain. You dont have use them in the same order as I did of course.
What is working wrong when zou load color map? Your code seems to be OK.
monkeycracks >> you have to use some bitmap editing program like Phothoshop or Gimp. Create large new file, then copy textures in to it one by one. You have to decide order in which you put them in since their position inside (UV coordinates) are used to put right texture tile on right tile on terrain. You dont have use them in the same order as I did of course.
Well the problem is that is not loading the color... the map is coolr, the texture is greate.. but the color is not loaded.. only a gray from textures...
But i will check on it at night... maybe is a lighting issue or another small thing..
Thanks for everything... i'll post my results of this night..
But i will check on it at night... maybe is a lighting issue or another small thing..
Thanks for everything... i'll post my results of this night..
A caos world where only the strongest lives, weak is not an option... you must fight.. Nokturna!!
http://nokturna.varholl.com.ar
http://nokturna.varholl.com.ar
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
monkeycracks >> dont worry, you are not
If you want to use my setMaterial() function from old demo, you have to keep textures in the same order since function works with them based on their position.
If you make your own function or set tileUV coordinates manualy, you may choose your own order.
In principle my setMaterial function works like this:
firsth it assign each terrain spot (place where tiles meets each other) material: fresh grass or dry grass. Note that material is not assigned to tiles but rather to its corners ...spots. It can be done in cusstom made array. 0 means one material, 1 means other.
Then it goes through each tile and test what materials are at its 4 corners. Depending on material combination it choose appropirate texture (or better its UV coordinates) and assign it to tile.
You can see this test in setMaterial function:
If you want to use my setMaterial() function from old demo, you have to keep textures in the same order since function works with them based on their position.
If you make your own function or set tileUV coordinates manualy, you may choose your own order.
In principle my setMaterial function works like this:
firsth it assign each terrain spot (place where tiles meets each other) material: fresh grass or dry grass. Note that material is not assigned to tiles but rather to its corners ...spots. It can be done in cusstom made array. 0 means one material, 1 means other.
Then it goes through each tile and test what materials are at its 4 corners. Depending on material combination it choose appropirate texture (or better its UV coordinates) and assign it to tile.
You can see this test in setMaterial function:
Code: Select all
for(u16 j=0; j<node->getSize().Height; j++)
for(u16 i=0; i<node->getSize().Width; i++)
{
if(mat[i][j+1] == 0 && mat[i+1][j+1] == 0 &&
mat[i][j] == 0 && mat[i+1][j] == 0 )
asignUVset(node, core::vector2d<s32>(i,j), &set[0]);
if(mat[i][j+1] == 1 && mat[i+1][j+1] == 1 &&
mat[i][j] == 1 && mat[i+1][j] == 1 )
asignUVset(node, core::vector2d<s32>(i,j), &set[1]);
if(mat[i][j+1] == 1 && mat[i+1][j+1] == 0 &&
mat[i][j] == 1 && mat[i+1][j] == 0 )
asignUVset(node, core::vector2d<s32>(i,j), &set[5]);
if(mat[i][j+1] == 0 && mat[i+1][j+1] == 1 &&
mat[i][j] == 0 && mat[i+1][j] == 1 )
asignUVset(node, core::vector2d<s32>(i,j), &set[6]);
if(mat[i][j+1] == 1 && mat[i+1][j+1] == 1 &&
mat[i][j] == 0 && mat[i+1][j] == 0 )
asignUVset(node, core::vector2d<s32>(i,j), &set[3]);
...and so on....
}
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
EDITED:
It WORKS.. NOT GOOD... NOT FINE... IT WORKS INCREDIBLY GOOD AND FAST!!!!!!!
Arras... you are God...
It WORKS.. NOT GOOD... NOT FINE... IT WORKS INCREDIBLY GOOD AND FAST!!!!!!!
Arras... you are God...
A caos world where only the strongest lives, weak is not an option... you must fight.. Nokturna!!
http://nokturna.varholl.com.ar
http://nokturna.varholl.com.ar