New Terrain Early Shots
-
- Halfling
- Posts: 79
- Joined: Tue Jan 20, 2009 9:31 am
Re: New Terrain Early Shots
I use new terrain in my project.
Today I meet a problem:After I set direction light which diffuse(1,1,1) and specular(0.5,0.5,0.5),the terrain is too bright;
After I set direction light which diffuse(1,1,1) and specular(0.1,0.1,0.1),the model's specular is too dark.
So I think whether can the new terrain support setting of the specular or not.
But I don't find some useful info in ogre forums and ogre source.
Anybody can solve the problem?
Today I meet a problem:After I set direction light which diffuse(1,1,1) and specular(0.5,0.5,0.5),the terrain is too bright;
After I set direction light which diffuse(1,1,1) and specular(0.1,0.1,0.1),the model's specular is too dark.
So I think whether can the new terrain support setting of the specular or not.
But I don't find some useful info in ogre forums and ogre source.
Anybody can solve the problem?
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: New Terrain Early Shots
Experiment.
That's what 'the rest of us' do.
If 0.5 is too bright, and 0.1 is too dark..
And, yes: I noticed that the specular is a bit.. shall we call it: aggressive?
That's what 'the rest of us' do.

If 0.5 is too bright, and 0.1 is too dark..
And, yes: I noticed that the specular is a bit.. shall we call it: aggressive?

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
Re: New Terrain Early Shots
Adjust the brightness of your specular texture in photoshop until it is exactly what you want.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
http://www.darkwindmedia.com
-
- Halfling
- Posts: 79
- Joined: Tue Jan 20, 2009 9:31 am
Re: New Terrain Early Shots
What I say above is not that the model's specular has problem(I set model material specular(1,1,1,1)).
Just when the terrain show normal ,the model show too dark.
Because only a direction light,if you set the light suited the terrain,then the light will not suited the model.
Moreover,I don't want to add specular texture,because it is aptotic and don't change if the light's direction changes.
So I want to set the terrain's specular as same as the model's specular can be set in the material.
But apparently the new terrain doesn't support to set the terrain's specular now.
I expect this function can come true at an early date.
Just when the terrain show normal ,the model show too dark.
Because only a direction light,if you set the light suited the terrain,then the light will not suited the model.
Moreover,I don't want to add specular texture,because it is aptotic and don't change if the light's direction changes.
So I want to set the terrain's specular as same as the model's specular can be set in the material.
But apparently the new terrain doesn't support to set the terrain's specular now.
I expect this function can come true at an early date.
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: New Terrain Early Shots
That's what I did, using Pixplant.Praetor wrote:Adjust the brightness of your specular texture in photoshop until it is exactly what you want.
I posted how I did the textures using the free ShaderMap CL here:
http://www.ogre3d.org/forums/viewtopic. ... 50#p374183
Sinbad said he used Pixplant (some posts down), and so I switched to using that.
A proper set of textures is absolutely *crucial* to achieve the right look.

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Halfling
- Posts: 79
- Joined: Tue Jan 20, 2009 9:31 am
Re: New Terrain Early Shots
hi,jacmoe.
What you say is ogitor,right?
yes,I see.
But it seems that the most important use of pixplent should be creating normal texture.
I don't find use of the specular texture when ogre can support dynamic light on model.
Just Torchlight, it uses apparent dynamic specular on its model.
If what I say has some error,please point out.
What you say is ogitor,right?
yes,I see.
But it seems that the most important use of pixplent should be creating normal texture.
I don't find use of the specular texture when ogre can support dynamic light on model.
Just Torchlight, it uses apparent dynamic specular on its model.
If what I say has some error,please point out.
-
- Gnoblar
- Posts: 4
- Joined: Sun Dec 20, 2009 10:34 pm
Re: Multiple viewports
Bostich wrote:Hi guys,
iam currently running into a small problem, mb someone is able to help me.
For a simple water plane iam currently develope, i need the depth of the scene within a texture.
On my depthRenderTarget viewport, the Terrain LOD looks diffrent, then in my main viewport. Do i have to inform the terrain about a new viewport?
thanks,
//bostich
Solved it by updating the viewport/rendertarget by myself, instead of automaticly by ogre.
//bostich
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: New Terrain Early Shots
No. It doesn't.haibo19981985 wrote:I don't find use of the specular texture when ogre can support dynamic light on model.
Just Torchlight, it uses apparent dynamic specular on its model.

The terrain does not support true dynamic lighting because it bakes for performance.
So if you need some real-time day-night cycle stuff, you need to fake it using fog and periodic updates of the terrain textures in the background.
At least that's how I understand how it works.
If you leave any of those 4 texture channels out of your textures, you are going to see visual artefacts.

You are, of course, free to create your own material generator/handler.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Halfling
- Posts: 79
- Joined: Tue Jan 20, 2009 9:31 am
Re: New Terrain Early Shots
I'm sorry for my English.
what I say above about "dynamic light" is just the ogre light effect on model.
Though the direction of light is fixed,the model can rotate and the light effect on model show dynamic.
The terrain light bases on shader.
I see the ogre source and find the setting of specular,as follows:
Only set value of "scaleBiasSpecular",it must change the specular of the terrain.
I'm trying to come true it today.
what I say above about "dynamic light" is just the ogre light effect on model.
Though the direction of light is fixed,the model can rotate and the light effect on model show dynamic.
The terrain light bases on shader.
I see the ogre source and find the setting of specular,as follows:
Code: Select all
void TerrainMaterialGeneratorA::SM2Profile::ShaderHelper::updateFpParams(
const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, const GpuProgramParametersSharedPtr& params)
{
params->setIgnoreMissingParams(true);
// TODO - parameterise this?
Vector4 scaleBiasSpecular(0.03, -0.04, 32, 1);
params->setNamedConstant("scaleBiasSpecular", scaleBiasSpecular);
}
I'm trying to come true it today.
-
- Gremlin
- Posts: 179
- Joined: Mon Nov 21, 2005 6:16 pm
- Location: UK
- x 7
Re: New Terrain Early Shots
Is this true? Doesn't that sort of defeat the object of having an outdoor setting if there is no day/night cycle? (well not for every game but for a major % of people needing terrain)jacmoe wrote:haibo19981985 wrote:The terrain does not support true dynamic lighting because it bakes for performance.
So if you need some real-time day-night cycle stuff, you need to fake it using fog and periodic updates of the terrain textures in the background.
At least that's how I understand how it works.
EDIT: just read post 1 again and it says the lighting is dynamic. Is it just the shadow maps then that are baked?
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Re: New Terrain Early Shots
Yes - you can update the lightmap in the background thread (the default) if you want to reflect changing time of day scenarios but the lightmap is presumed to be static so very fast day/night changes are not possible, but realistic ones are.Captain_Deathbeard wrote:EDIT: just read post 1 again and it says the lighting is dynamic. Is it just the shadow maps then that are baked?
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
DeflateStream and terrain
I just added a new feature to 1.8, 'DeflateStream' which as the name suggests wraps another stream and compresses / uncompresses the contents using the standard 'deflate' algorithm (via zlib which we already use). The advantages of this over using a .zip archive are:
Because of the safe fallbacks in DeflateStream, uncompressed terrain data will continue to load as before. However as soon as you re-save it it will suddenly shrink
Enjoy. Hopefully this should appease those that found the terrain data files to be a bit weighty
We may change the underlying format to be even smaller later on too, but this has the benefit of being lossless and almost completely free, except for a few CPU cycles which are no doubt regained from faster disk access on read anyway.
- You can write to them - ZipArchive is read-only and it's inefficient to try to update whole zips anyway
- It can literally compress / decompress any other stream; so not only a file stream but also a network stream, database stream or anything else you choose to implement
- It preserves the underlying stream state so you can embed compressed data in a chunk inside a stream which has other data in it too (uncompressed, compressed otherwise, stream from shared data packs etc)
- When reading, it detects if the underlying stream is compressed or not, and if it isn't it silently does a pass-through read on the original stream. This means you can pass a stream to it that's actually uncompressed and it will continue to work without requiring any work on the part of the caller.
Because of the safe fallbacks in DeflateStream, uncompressed terrain data will continue to load as before. However as soon as you re-save it it will suddenly shrink

Enjoy. Hopefully this should appease those that found the terrain data files to be a bit weighty

-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
Thats great news Sinbad, can be very handy for other stuff too. Do you plan to use it for mesh files too?
Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Re: New Terrain Early Shots
It's definitely an option, I haven't decided yet. The trouble is it would break tools built against previous versions in less obvious ways than the version bump does - unless I only compressed the data after the header or something like that. I might do it.stealth977 wrote:Thats great news Sinbad, can be very handy for other stuff too. Do you plan to use it for mesh files too?
-
- Ogre Magi
- Posts: 1173
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 76
Re: New Terrain Early Shots
I would sugest a little tool be wrote to revert a mesh into it's uncompressed state for older tools that won't support the compressed format.sinbad wrote:It's definitely an option, I haven't decided yet. The trouble is it would break tools built against previous versions in less obvious ways than the version bump does - unless I only compressed the data after the header or something like that. I might do it.stealth977 wrote:Thats great news Sinbad, can be very handy for other stuff too. Do you plan to use it for mesh files too?
There are 10 types of people in the world: Those who understand binary, and those who don't...
-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
Sinbad:
Today i switched to BYATIS for Ogitor and i have 2 major problems one of them is related to Ogre::Terrain:
- The decal cursor wont show up!!
Now i know that its because vertex compression, but i dont know what vertex program to use for the decal pass...
Any ideas?
Today i switched to BYATIS for Ogitor and i have 2 major problems one of them is related to Ogre::Terrain:
- The decal cursor wont show up!!
Now i know that its because vertex compression, but i dont know what vertex program to use for the decal pass...
Any ideas?
Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Re: New Terrain Early Shots
As ever the answers are in TerrainMaterialGeneratorA: you just need to expand the vertices in the same way I do:
You can get 'posIndexToObjectSpace' from terrain->getPointTransform and 'baseUVScale' from the calculation '1.0f / (terrain->getSize() - 1)';
If you like just run the demo in debug mode and the generated shaders will be dumped into Ogre.log in their entirety anyway, look for "*** Terrain Vertex Program" and "*** Terrain Fragment Program"
Code: Select all
pos = mul(posIndexToObjectSpace, float4(posIndex, height, 1));
uv = float2(posIndex.x * baseUVScale, 1.0 - (posIndex.y * baseUVScale));
If you like just run the demo in debug mode and the generated shaders will be dumped into Ogre.log in their entirety anyway, look for "*** Terrain Vertex Program" and "*** Terrain Fragment Program"
-
- Kobold
- Posts: 29
- Joined: Fri Apr 20, 2007 9:02 pm
- Location: Russian Federation
Re: New Terrain Early Shots
Anyone have ideas how solve problem with artefact on decal, which cross line beetween batches(with skirt).
I can see this, for example, in Ogitor Another screenshot, from our application. Any magic stuff with deptbias?(make it depend from camera distance? or somewhat else?)
I can see this, for example, in Ogitor Another screenshot, from our application. Any magic stuff with deptbias?(make it depend from camera distance? or somewhat else?)
You do not have the required permissions to view the files attached to this post.
-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
@Sinbad:
this is v1-7 branch but i guess development has the same issue...
Code: Select all
Ogre Memory: Detected memory leaks !!!
Ogre Memory: (10) Allocation(s) with total 5243080 bytes.
Ogre Memory: Dumping allocations ->
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3259) : {40 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3257) : {1048576 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3259) : {40 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3257) : {1048576 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3257) : {1048576 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3259) : {40 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3259) : {40 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3259) : {40 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3257) : {1048576 bytes} function: Ogre::Terrain::calculateLightmap
..\..\..\OGRE17\Components\Terrain\src\OgreTerrain.cpp(3257) : {1048576 bytes} function: Ogre::Terrain::calculateLightmap
Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
IMPORTANT BUG:
during manual prepare, mPos is initialized, but rootnode's position is never set...
Code: Select all
bool Terrain::prepare(const ImportData& importData)
..................
..................
mPos = importData.pos;
mRootNode->setPosition(mPos); <<< THIS NEEDS TO BE ADDED!!!!
Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
-
- Orc
- Posts: 459
- Joined: Sat Jan 24, 2009 11:16 am
- Location: Italy
- x 6
Re: New Terrain Early Shots
Agree,terrain position doesn't change to me too..
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Re: New Terrain Early Shots
Presumably you're either using non-standard depth write/check settings, or using a depth bias which is 'pulling' the skirt above the terrain surface.moadib wrote:Anyone have ideas how solve problem with artefact on decal, which cross line beetween batches(with skirt).
The best option is to render your decals differently. Really, using the primary terrain geometry to decal is highly inefficient since the majority of the area you're rendering is not within the circle you want to decal on. You can construct separate decal geometry by sampling the terrain at a known frequency of your choice, over the area of the decal, and render that instead (with a depth bias, or just manually shift the geometry up a little). Not only will it avoid the skirts issue, it will be considerably more efficient as a static decal - especially if you render many of them.
If these are dynamic decals (as in painting tools Ogitor) then it won't be quite as efficient, although it's still likely to be very doable even updating the decal mesh every frame, assuming there's only one of them.
@stealth977: will investigate
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
Re: New Terrain Early Shots
Both the position and memory leak issues should now be fixed in both branches.
-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
Thank you
We are going to make a new release of Ogitor tonight, so the fixes are very much appreciated 


Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
-
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
BTW, a minor problem:
if i add a new layer and getPointer to the layer and modify it, and then getMaterial() and modify the passes (add a decal pass since its lost when layer is added) and then call terrainGroup->update()
following problem occurs:
:retPair.second && "Error inserting new pass entry into PassGroupRenderableMap".
sorry for not clarifying it enough, but its the only way for me to reproduce the bug
NOTE: it was being caused in my terrain splatting code, so i just removed terrainGroup->update() since it was not needed for splatting and the problem disappeared, but still, its a sign that something is wrong...
if i add a new layer and getPointer to the layer and modify it, and then getMaterial() and modify the passes (add a decal pass since its lost when layer is added) and then call terrainGroup->update()
following problem occurs:
:retPair.second && "Error inserting new pass entry into PassGroupRenderableMap".
sorry for not clarifying it enough, but its the only way for me to reproduce the bug
NOTE: it was being caused in my terrain splatting code, so i just removed terrainGroup->update() since it was not needed for splatting and the problem disappeared, but still, its a sign that something is wrong...
Ismail TARIM
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor
Ogitor - Ogre Scene Editor
WWW:http://www.ogitor.org
Repository: https://bitbucket.org/ogitor