question ???build Release pagedGeometry-1.1.0 with ogre 1.7

msgamelover

01-06-2010 05:47:05

As title mentioned
In ogre 1.7 getLodIndexSquaredDepth no exist and in pagedGeometry-1.1.0

material->getLodIndex(parent->minDistanceSquared * parent->minDistanceSquared));

instead of

bestTechnqiue = material->getBestTechnique(material->getLodIndexSquaredDepth(parent->minDistanceSquared));

but when i compile example 1 with this(pagedGeometry-1.1.0 ,ogre 1.7, vs2008), i havent seen any trees

then i look for answers in source code

in ogre1.6.5
unsigned short Material::getLodIndex(Real d) const
{
return getLodIndexSquaredDepth(d * d);
}
// --------------------------------------------------------------------
unsigned short Material::getLodIndexSquaredDepth(Real squaredDistance) const
{
LodDistanceList::const_iterator i, iend;
iend = mLodDistances.end();
unsigned short index = 0;
for (i = mLodDistances.begin(); i != iend; ++i, ++index)
{
if (*i > squaredDistance)
{
return index - 1;
}
}

// If we fall all the way through, use the highest value
return static_cast<ushort>(mLodDistances.size() - 1);
}


in ogre1.7
ushort Material::getLodIndex(Real value) const
{
return mLodStrategy->getIndex(value, mLodValues);
}

// Initialise to default strategy
mLodStrategy = LodStrategyManager::getSingleton().getDefaultStrategy();

LodStrategyManager::LodStrategyManager()
{
// Add default (distance) strategy
LodStrategy *distanceStrategy = OGRE_NEW DistanceLodStrategy();
addStrategy(distanceStrategy);

// Add new pixel-count strategy
LodStrategy *pixelCountStrategy = OGRE_NEW PixelCountLodStrategy();
addStrategy(pixelCountStrategy);

// Set the default strategy
setDefaultStrategy(distanceStrategy);

ushort DistanceLodStrategy::getIndex(Real value, const Material::LodValueList& materialLodValueList) const
{
// Get index assuming ascending values
return getIndexAscending(value, materialLodValueList);
}

ushort LodStrategy::getIndexAscending(Real value, const Mesh::MeshLodUsageList& meshLodUsageList)
{
Mesh::MeshLodUsageList::const_iterator i, iend;
iend = meshLodUsageList.end();
ushort index = 0;
for (i = meshLodUsageList.begin(); i != iend; ++i, ++index)
{
[quote] if (i->value > value)[/quote]
{
return index ? index - 1 : 0;
}
}

// If we fall all the way through, use the highest value
return static_cast<ushort>(meshLodUsageList.size() - 1);
}


i think getLodIndex(parent->minDistanceSquared * parent->minDistanceSquared)) is not right
as parent->minDistanceSquared is acturally a squares value you can find this
minDistanceSquared = max(0.0f, centerDistanceSquared - (radius * radius));

so you just past getLodIndex(parent->minDistanceSquared) it is right

but modified this i still cannt seen any trees, i don't kong why ? any one help me ,thanks a lot

msgamelover

01-06-2010 05:54:54

cannt seen any trees means that th e render window is blank
no trees no terrain
but when i shut off trees->update(); i can seen the terrain

void World::render()
{
//[NOTE] PagedGeometry::update() is called every frame to keep LODs, etc. up-to-date
trees->update();

//Render the scene with Ogre
root->renderOneFrame();
}

Fish

01-06-2010 14:10:19

Can you check your Ogre.log for errors? It seems to be working fine here.

-Fish

msgamelover

03-06-2010 04:50:19

find answer

my graphics card is ati

when i tried on a nVIDIA card , it is ok

Fish

03-06-2010 12:38:03

What ATI model is your video card? Do you get the same results with both OpenGL and DirectX?

edit: make sure you have the newest video card drivers and BIOS updates for your system.

- Fish

msgamelover

03-06-2010 15:18:06

My graphics card is PowerColor hd4870 fire 1GB

Directx:
The Render Window is blank, no trees and no terrain

OpenGL:
It show that error on Plugin_CgProgramManager_d.dll, and then appication exit

Then i test example on another card, Nvidia GxForce 5200, very old one, everything is ok

o, my master board is asus, memory is kingston DDR3 1333

stealth977

04-06-2010 08:31:54

did you try to update to latest drivers for your card? Most of the time those problems are caused by hurried out drivers (which gets fixed after a while with a new release)

msgamelover

07-06-2010 12:54:04

I update to latest drivers and try again

Run the example app, only a blank window,still no trees and terrain.
After several seconds, there is no response.

In the log, there is no error, donn't know why?

luke

10-06-2010 05:50:45

I have simillar troubles. If I use the newest Ogre 1.7.1 (with boost threads) and DirectX9 Renderer 1.7.1, something is wrong and there is no render output. If I downgrade to the renderer 1.7.0 (without downgrade Ogre), render runs correctly. Just try this these changes and give feedback.

Fish

10-06-2010 12:52:20

It's working fine here under Ogre 1.7.1. It might be an ATI driver issue.

I'm using an nVidia 7900GS.

- Fish