Difference between old terrain and new terrain

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Difference between old terrain and new terrain

Post by jacmoe » Sat Jan 23, 2010 10:51 pm

I am baffled by how different a terrain looks like in the new terrain compared to how it looks in the 'old' terrain.

Looks like this in the 'old' one:
screenshot_1.jpg
screenshot_1.jpg (164.73 KiB) Viewed 938 times
And like this in the 'new' one:
screenshot01232010_210827512.jpg
screenshot01232010_210827512.jpg (61.61 KiB) Viewed 938 times
Don't worry about the awful terrain textures.

It's difficult to see, but the house is placed correctly in both pictures, at least according to the textures (splatting matches).
But the terrain itself is off in the second screenie.
The house is buried and floating.
The house on the first picture is aligned perfectly.

Same heightmap.
Same textures.
Same model.

I assume that the settings are the same too.

So that's where I need some help. :)

The new terrain is setup like this:

Code: Select all

		Ogre::Terrain::ImportData imp;
		imp.terrainSize = 1025;
		imp.worldSize = 1024;
		imp.inputFloat = buffer;
		imp.minBatchSize = 33;
		imp.maxBatchSize = 65;
The old terrain like this:

Code: Select all

Heightmap.raw.size=1025
Heightmap.raw.bpp=2
PageSize=1025
TileSize=65
MaxHeight=2000
The heightmap for the new terrain is unscaled raw (terrainsize * terrainsize * 4), but I've also tried with a raw image.
Same result.

What am I missing? :)
I can't live with imprecision like that, but I am not going to use the old terrain, I want to use the new terrain component!

Anyone else experienced that difference?
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sat Jan 23, 2010 11:03 pm

I just tried it using a word based raw heightmap, using the same settings as the old terrain.. Same result.

The only difference is that I move the terrain origin because the terrain origin has changed in the new terrain.

It can't be that, because the house and the splatting matches in both terrains.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
Contact:

Re: Difference between old terrain and new terrain

Post by DanielSefton » Sat Jan 23, 2010 11:09 pm

I also experience precision problems with the new terrain. There are parts where my raycasted character floats above the ground, and parts where it sinks... So the visual representation of the terrain must be different to the actual heights. :? That's for both raw and PNG (though PNG was worse).
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sat Jan 23, 2010 11:18 pm

Is this with out without moving the terrain?

I am using unscaled floats with the same result, so it can't be dogdy heightmaps.

The heights seems to be right, but sort of offset..

Strange, because - as I said - the textures and the house are aligned perfectly to each other. The heights seems to be off by 5 to 10 Ogre units in the north-western direction. :)

<edit>I am assuming that the source of the errors is in front of my keyboard. Until further notice.
I just wish I knew what it was..
</edit>
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
Contact:

Re: Difference between old terrain and new terrain

Post by DanielSefton » Sat Jan 23, 2010 11:26 pm

Well I use terrain groups, no idea if there's a difference between the page at the origin and the offset pages. I don't think it matters...

I'd post a screenshot of the problem, but can't right now.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sat Jan 23, 2010 11:49 pm

I also tried not setting the position of the terrain, but adjusting the position of my house and camera - exact same result.
That rules out any bug in the terrain->setPosition function.
What's strange is that it works for the terrain scenemanager, but not in the terrain component.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm

Re: Difference between old terrain and new terrain

Post by aguru » Sun Jan 24, 2010 12:07 am

I can confirm that sometimes my character is floating/sinking into the terrain. I suspect that the ray query might not be calculated using the highest lod?
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sun Jan 24, 2010 12:32 am

I used the modifiers x + 5, y - 0.5 on my object positions and that seemed to do the trick.
I'll find out if it's consistent. :)

@Haffax: Yes, that is indeed a Rastullahs Lockenpracht house! Using it because of it's scale. :)
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
Contact:

Re: Difference between old terrain and new terrain

Post by DanielSefton » Sun Jan 24, 2010 12:37 am

aguru wrote:I can confirm that sometimes my character is floating/sinking into the terrain. I suspect that the ray query might not be calculated using the highest lod?
IMO the ray query is correct, but the terrain itself at parts is off. Sometimes the terrain "pops", in and out of place. At areas where I'm floating, the terrain looks wrong; and sometimes you can see ridges where it occurs.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sun Jan 24, 2010 12:40 am

I seem to get those cracks/ridges when setting the minbatch value to 17 (instead of 33).

But I am confident that those issues are sorted out eventually.
If I have to position my objects by some fixed amount, I am happy to do that. For now. :wink:
I was just wondering what was up.

It does look like some LOD issue.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Sun Jan 24, 2010 12:44 am

But, still - that shouldn't mean an offset of x - 5, y + 0.5 ?
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Mon Feb 01, 2010 2:52 pm

I figured it out! :D

Very simple - if you know how:

Code: Select all

Ogre::TerrainGlobalOptions::setMaxPixelError(8);
screenshot02012010_000505777.jpg
Using a maxPixelError of 8
screenshot02012010_000505777.jpg (91.36 KiB) Viewed 844 times

Code: Select all

Ogre::TerrainGlobalOptions::setMaxPixelError(1);
screenshot02012010_151240458.jpg
Using a maxPixelError of 1
screenshot02012010_151240458.jpg (94.11 KiB) Viewed 844 times
I am using a terrain where 1 unit is roughly 1 metre, so I need a maxPixelError of 1. :)

Everything aligns totally perfect now. :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
Contact:

Re: Difference between old terrain and new terrain

Post by DanielSefton » Mon Feb 01, 2010 4:52 pm

Ooh, I didn't know that either, I also have pixel error set to 8 :roll:

Thanks for the discovery :)
0 x

User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2702
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 3

Re: Difference between old terrain and new terrain

Post by syedhs » Wed Feb 03, 2010 7:38 am

I am wondering - did that reduce the performance?
0 x
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Difference between old terrain and new terrain

Post by jacmoe » Wed Feb 03, 2010 1:50 pm

Not noticable. :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Post Reply