ahmedali
23-09-2008 21:38:20
I don't know whats the reason, but i would like to see more crisp/sharp-edged clear impostors
ahmedali
23-09-2008 21:38:20
JohnJ
24-09-2008 03:01:06
ahmedali
24-09-2008 10:44:42
void comGameWorld::createPagedGeometry(SceneManager* sceneMgr, Camera* camera)
{
std::cout << "..COMPONENT: comGameWorld::createPagedGeometry() {START}" << std::endl;
self = this;
using namespace PagedGeometry;
//-------------------------------------- LOAD TREES --------------------------------------
//Create and configure a new PagedGeometry instance for trees
trees = new ::PagedGeometry::PagedGeometry(camera, 80);
trees->addDetailLevel<BatchPage>(150*1, 50);
trees->addDetailLevel<ImpostorPage>(800, 50);
//Create a new TreeLoader2D object
treeLoader = new TreeLoader2D(trees, TBounds(0, 0, 3000, 3000));
trees->setPageLoader(treeLoader);
//Supply the height function to TreeLoader2D so it can calculate tree Y values
treeLoader->setHeightFunction(&getTerrainHeight);
//Load a tree entity
Entity *myTree = sceneMgr->createEntity("Tree", "palm_up.mesh");
const float xzextents = 3000;
//Randomly place 10,000 copies of the tree on the terrain
Vector3 position = Vector3::ZERO;
Radian yaw;
Real scale;
for (int i = 0; i < 60000; i++){
yaw = Degree(Math::RangeRandom(0, 360));
position.x = Math::RangeRandom(0, xzextents);
position.z = Math::RangeRandom(0, xzextents);
scale = Math::RangeRandom(0.8f, 1.3f);
treeLoader->addTree(myTree, position, yaw, scale);
}
//-------------------------------------- LOAD BUSHES --------------------------------------
//Create and configure a new PagedGeometry instance for bushes
bushes = new ::PagedGeometry::PagedGeometry(camera, 50*1);
bushes->addDetailLevel<BatchPage>(80*1, 50*1);
//Create a new TreeLoader2D object for the bushes
TreeLoader2D *bushLoader = new TreeLoader2D(bushes, TBounds(0, 0, xzextents, xzextents));
bushes->setPageLoader(bushLoader);
//Supply the height function to TreeLoader2D so it can calculate tree Y values
bushLoader->setHeightFunction(&getTerrainHeight);
//Load a bush entity
Entity *myBush = sceneMgr->createEntity("Bush", "Bush.mesh");
//Randomly place 30,000 copies of the bush on the terrain
for (int i = 0; i < 30000*0.2; i++){
yaw = Degree(Math::RangeRandom(0, 360));
position.x = Math::RangeRandom(0, xzextents);
position.z = Math::RangeRandom(0, xzextents);
scale = Math::RangeRandom(0.7f, 0.8f);
bushLoader->addTree(myBush, position, yaw, scale);
}
}
ahmedali
24-09-2008 10:58:06
JohnJ
24-09-2008 15:56:42
ahmedali
24-09-2008 17:50:08
JohnJ
24-09-2008 18:23:05
JohnJ
25-09-2008 16:26:47
p->setLightingEnabled(false);
m->setReceiveShadows(false);
t->setTextureMipmapBias(-1.0); <---- add this
if (group->getBlendMode() == ALPHA_REJECT_IMPOSTOR){
ahmedali
25-10-2008 14:06:52
JohnJ
05-11-2008 18:00:34
ahmedali
09-11-2008 10:13:17
(Sorry about my [really] late reply Embarassed)