Posted: Sat Jun 05, 2010 11:03 am
i have also work for an lod in irrlicht
the main idea is
int lenght_ = 500;
while()
if (camera->getpos() > objet->getpos()+ lenght)// dont work likle this , you may have getpos().X so multiply condition by 2 or 3 like:
camera->getpos().X > objet->getpos().X+ lenght || camera->getpos().Z > objet->getpos().Z+ lenght
//Secondly, you must have positive values or do that :
#include "math.h"
if ( abs(camera->getpos() > objet->getpos()+ lenght))//
//third, a lod exist for irrlicht ; with boxes but not very hight performances ?
http://khayyam.developpez.com/articles/3d/irrlicht/lod/
//you may have binary mesh for dynamic rendering
//i think that LOD change with distance is better than LOD change by time , if there is any time required , but it is very "rare"
Lod:
for (each objects)//for (int i = 1; i< maxnodes;i++)
nodehight->setvisble(true);
nodelow->setvisble(false);
else
nodehight->setvisble(False);
nodelow->setvisble(true);
//declare (pseudo code) irrscenenode nodehight[100]= 0;
nodehight[1] -> addanimatedmesh // same for nodelow
this kind of lod work for me.I know that the code is node in state-of-art.but it work (it is enought for me).next, i have ideas of a decimate mesh engine each 100 meters.For terrain and others complexes géométries :
the idea :
int distance = 100;
int olddistance = camera->getposition
while()
if (camera > olddistance+100)
{ olddistance = camera->getpos //2 (X and Z)
for (each vertex in mesh)// HOW to do that ? help ! (vertex3d , any specialist of that ?)
{ (if vertex.posX > distance)
remove vertex;
}
//construct new mesh in super low
for (int i = 1;i< max vertex ;i+=4)//lod
construct new mesh
}
//advantage
we know absolute position of player
a unique mesh that contain complexes model like moutain or usine etc...
//possibility of multiple resolutions of texture (new super low model = assign a super low texture (decal and positions of texture can or must be know, imporving performance rendering
//i don't like megatexture of id teck5 RAGE , i beleive that hardware can be improve in rendering like an another way, like texcoord.
sorry for bad english (iam french)
the main idea is
int lenght_ = 500;
while()
if (camera->getpos() > objet->getpos()+ lenght)// dont work likle this , you may have getpos().X so multiply condition by 2 or 3 like:
camera->getpos().X > objet->getpos().X+ lenght || camera->getpos().Z > objet->getpos().Z+ lenght
//Secondly, you must have positive values or do that :
#include "math.h"
if ( abs(camera->getpos() > objet->getpos()+ lenght))//
//third, a lod exist for irrlicht ; with boxes but not very hight performances ?
http://khayyam.developpez.com/articles/3d/irrlicht/lod/
//you may have binary mesh for dynamic rendering
//i think that LOD change with distance is better than LOD change by time , if there is any time required , but it is very "rare"
Lod:
for (each objects)//for (int i = 1; i< maxnodes;i++)
nodehight->setvisble(true);
nodelow->setvisble(false);
else
nodehight->setvisble(False);
nodelow->setvisble(true);
//declare (pseudo code) irrscenenode nodehight[100]= 0;
nodehight[1] -> addanimatedmesh // same for nodelow
this kind of lod work for me.I know that the code is node in state-of-art.but it work (it is enought for me).next, i have ideas of a decimate mesh engine each 100 meters.For terrain and others complexes géométries :
the idea :
int distance = 100;
int olddistance = camera->getposition
while()
if (camera > olddistance+100)
{ olddistance = camera->getpos //2 (X and Z)
for (each vertex in mesh)// HOW to do that ? help ! (vertex3d , any specialist of that ?)
{ (if vertex.posX > distance)
remove vertex;
}
//construct new mesh in super low
for (int i = 1;i< max vertex ;i+=4)//lod
construct new mesh
}
//advantage
we know absolute position of player
a unique mesh that contain complexes model like moutain or usine etc...
//possibility of multiple resolutions of texture (new super low model = assign a super low texture (decal and positions of texture can or must be know, imporving performance rendering
//i don't like megatexture of id teck5 RAGE , i beleive that hardware can be improve in rendering like an another way, like texcoord.
sorry for bad english (iam french)