New Terrain Early Shots
- aguru
- Goblin
- Posts: 236
- Joined: Tue Feb 26, 2008 5:48 pm
- x 3
Re: New Terrain Early Shots
oki
*crawls back into corner*
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
The lightmap isn't generated from dynamic lights because it's not dynamic. You need to call TerrainGlobalOptions::setLightMapDirection. This just looks like a simple case of having your dynamic directional facing one way and TerrainGlobalOptions::setLightMapDirection facing the other.
The dynamic lighting / shading on the terrain does pick up the light because it's a dynamic calculation at render time, the lightmap is not. They're separate so you can control them the way they actually get built.
And don't bother trying to use any other light than a directional light for the dynamic elements, only directional lights are supported right now. You're welcome to set up your own TerrainMaterialGenerator that does something else of course.
The dynamic lighting / shading on the terrain does pick up the light because it's a dynamic calculation at render time, the lightmap is not. They're separate so you can control them the way they actually get built.
And don't bother trying to use any other light than a directional light for the dynamic elements, only directional lights are supported right now. You're welcome to set up your own TerrainMaterialGenerator that does something else of course.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Yep. That's what I'm doing.
Until I figure out how to generate those texture maps, I'll just use the dual diffuse texture trick.
Or turn off all lights.
<edit>I know that its a diffuse map with specular in the alpha channel, and a normal map with heightmap in the alpha.
I guess I just need to read up on the nvDxt command-line syntax.</edit>
Until I figure out how to generate those texture maps, I'll just use the dual diffuse texture trick.
Or turn off all lights.
<edit>I know that its a diffuse map with specular in the alpha channel, and a normal map with heightmap in the alpha.
I guess I just need to read up on the nvDxt command-line syntax.</edit>
/* 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.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
Honestly I don't think you are setting the lightmap and dynamic dir light correctly. Or, maybe you're doing it at the wrong time (e.g. after you've created the terrain and didn't dirty the lightmap). I've played with lots of different directional setups and they're fine. I've also seen an effect like that and it's always when I change one without changing the other.jacmoe wrote:Yep. That's what I'm doing.
Until I figure out how to generate those texture maps, I'll just use the dual diffuse texture trick.
Or turn off all lights.
[edit]Unless by "that's what I'm doing" you were referring to making your own TerrainMaterialGenerator, in which case it's not my problem
To make a diffuse/spec, normal/height image, use Image::loadTwoImagesAsRGBA or Image::combineTwoImagesAsRGBA and save the results for future use. That's how I created the textures for the demo.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
This is what I am doing now:
As you can probably see, I've converted the first texture to using a proper diffuse_specular, normal_heightmap, but the rest of the images are duplicated (because then the artifact doesn't show, but it obviously doesn't look good).
I create a new TerrainPage from the standard createScene function:
Setting a skydome, setting the position of the camera, adjusting the farclip distance and creating the terrain.
No additional stuff, no other lights than the directional.
I tried to copy the terrain sample as closely as I could.
Code: Select all
TerrainPage::TerrainPage(Ogre::SceneManager* sceneMgr)
{
bool loadTerrain = false;
Ogre::Vector3 lightdir(0, -0.3, 0.75);
lightdir.normalise();
Ogre::Light* l = sceneMgr->createLight("tstLight");
l->setType(Ogre::Light::LT_DIRECTIONAL);
l->setDirection(lightdir);
l->setDiffuseColour(Ogre::ColourValue(1.0, 1.0, 1.0));
l->setSpecularColour(Ogre::ColourValue(0.4, 0.4, 0.4));
sceneMgr->setAmbientLight(Ogre::ColourValue(0.6, 0.6, 0.6));
Ogre::TerrainGlobalOptions::setMaxPixelError(8);
Ogre::TerrainGlobalOptions::setCompositeMapDistance(2000);
Ogre::TerrainGlobalOptions::setLightMapDirection(lightdir);
Ogre::TerrainGlobalOptions::setCompositeMapAmbient(sceneMgr->getAmbientLight());
Ogre::TerrainGlobalOptions::setCompositeMapDiffuse(l->getDiffuseColour());
mTerrain = OGRE_NEW Ogre::Terrain(sceneMgr);
if(loadTerrain)
{
mTerrain->load("terrain.dat");
}
else
{
Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource("demoraw.raw", "General" );
size_t size = stream.get()->size();
if(size != 1025 * 1025 * 4)
{
OGRE_EXCEPT( Ogre::Exception::ERR_INTERNAL_ERROR, "Size of stream does not match terrainsize!", "TerrainPage" );
}
float* buffer = OGRE_ALLOC_T(float, size, Ogre::MEMCATEGORY_GENERAL);
stream->read(buffer, size);
Ogre::Terrain::ImportData imp;
imp.terrainSize = 1025;
imp.worldSize = 1024;
imp.inputFloat = buffer;
imp.minBatchSize = 33;
imp.maxBatchSize = 65;
// textures
imp.layerList.resize(4);
imp.layerList[0].textureNames.push_back("gras_diffuse_specular.tga");
imp.layerList[0].textureNames.push_back("gras_normal_height.tga");
imp.layerList[0].worldSize = 30;
imp.layerList[1].textureNames.push_back("ground01.jpg");
imp.layerList[1].textureNames.push_back("ground01.jpg");
imp.layerList[1].worldSize = 30;
imp.layerList[2].textureNames.push_back("schlamm_getrocknet2.jpg");
imp.layerList[2].textureNames.push_back("schlamm_getrocknet2.jpg");
imp.layerList[2].worldSize = 30;
imp.layerList[3].textureNames.push_back("Boulder_Rocky_01_COL.dds");
imp.layerList[3].textureNames.push_back("Boulder_Rocky_01_COL.dds");
imp.layerList[3].worldSize = 20;
mTerrain->prepare(imp);
mTerrain->load();
Ogre::String blendImages[4];
blendImages[0] = "gras_00000_00000_000.PNG";
blendImages[1] = "ground01_00000_00000_000.PNG";
blendImages[2] = "schlamm_getrocknet2_00000_00000_000.PNG";
blendImages[3] = "moos2_00000_00000_000.PNG";
for(int j = 1;j < mTerrain->getLayerCount();j++)
{
Ogre::TerrainLayerBlendMap *blendmap = mTerrain->getLayerBlendMap(j);
Ogre::Image img;
img.load(blendImages[j],"General");
int blendmapsize = mTerrain->getLayerBlendMapSize();
if(img.getWidth() != blendmapsize)
img.resize(blendmapsize, blendmapsize);
float *ptr = blendmap->getBlendPointer();
Ogre::uint8 *data = static_cast<Ogre::uint8*>(img.getPixelBox().data);
for(int bp = 0;bp < blendmapsize * blendmapsize;bp++)
ptr[bp] = static_cast<float>(data[bp]) / 255.0f;
blendmap->dirty();
blendmap->update();
}
mTerrain->freeTemporaryResources();
}
mTerrain->setPosition(Ogre::Vector3(512,0,512));
}
I create a new TerrainPage from the standard createScene function:
Code: Select all
mSceneMgr->setSkyDome(true, "Examples/CloudySky");
mCamera->setPosition(91.5022f, 49.8703f, 680.376f);
if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_INFINITE_FAR_PLANE))
{
mCamera->setFarClipDistance(0); // enable infinite far clip distance if we can
}
mTerrainPage = new TerrainPage(mSceneMgr);
No additional stuff, no other lights than the directional.
I tried to copy the terrain sample as closely as I could.
/* 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.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
Code: Select all
if(loadTerrain)
{
mTerrain->load("terrain.dat");
}
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
I'm finding in the current version the lightmap calculation seems to be aborting early when generating terrain from an image and the dynamic update doesn't work anymore. I have no idea when this started happening, I'll look when I get time. Still, the bits that are updated are correct, including using your light direction.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
<edit>I saw your in-between reply just now - the problem I had can be solved by providing the full set of textures. So I need to study texture tools, which I needed to study anyway, eventually.</edit>
What I discovered was: without light, everything's fine. With just the diffuse textures.
With light, the lightmap is barfed.
I can prevent it from barfing by providing a proper set of all four maps: diffuse, specular, normal and height.
Or I can just duplicate the diffuse, but then without the desired effect.
Diffuse maps alone won't cut it. At least not on my NVIDIA GeForce 8500 GT - not the best card around.
So, I need to look into that.
Then I can write a 'how-do-I-use-this-new-Ogre-terrain' tutorial.
So, I am deliberately trying to stay as close to a known good configuration here, obviously.
The saved terrain data file loads alright. It was just a separate test, which I probably should have edited out of my posted code to prevent any confusion.
The directional light doesn't change at all. It's copied directly from the sample.
I believed that any missing texture 'channels' would be handled by the terrain component, but it seems to be true only for unlit terrain.
<edit>But it seems that you're on the issue. No rush - I've found a work around</edit>
What I discovered was: without light, everything's fine. With just the diffuse textures.
With light, the lightmap is barfed.
I can prevent it from barfing by providing a proper set of all four maps: diffuse, specular, normal and height.
Or I can just duplicate the diffuse, but then without the desired effect.
Diffuse maps alone won't cut it. At least not on my NVIDIA GeForce 8500 GT - not the best card around.
So, I need to look into that.
Then I can write a 'how-do-I-use-this-new-Ogre-terrain' tutorial.
So, I am deliberately trying to stay as close to a known good configuration here, obviously.
The saved terrain data file loads alright. It was just a separate test, which I probably should have edited out of my posted code to prevent any confusion.
The directional light doesn't change at all. It's copied directly from the sample.
I believed that any missing texture 'channels' would be handled by the terrain component, but it seems to be true only for unlit terrain.
<edit>But it seems that you're on the issue. No rush - I've found a work around</edit>
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Alright.
Here's one way to generate those textures:
1) Get ShaderMap CL from http://www.shadermap.renderingsystems.com/
2) Create a bat file with the following contents:
Replace the directory and texture name with what you want to generate maps for.
3) Generate the maps by running the bat script, once for each texture.
4) Use the following code to combine the images:
5) Get the nVidida texture tools (DDS Utilities) and convert the output textures to dds.
6) Done.
Thanks to Sinbad for leaving that image combine code in the playpen.
Here's one way to generate those textures:
1) Get ShaderMap CL from http://www.shadermap.renderingsystems.com/
2) Create a bat file with the following contents:
Code: Select all
CD "C:\Program Files\ShaderMap CL 1.2.2"
START /WAIT shadermap.exe cdiff "<texture_directory>\<texture_name>" -disp (60,100,12,xy) -norm (100,200,xy,0) -spec (100,-50,52,xy) -v 3) Generate the maps by running the bat script, once for each texture.
4) Use the following code to combine the images:
Code: Select all
Ogre::Image combined;
combined.loadTwoImagesAsRGBA("moos1.jpg", "moos1_SPEC.bmp",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::PF_BYTE_RGBA);
combined.save("moos1_diffusespecular.png");
combined.loadTwoImagesAsRGBA("moos1_NORM.tga", "moos1_DISP.bmp",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::PF_BYTE_RGBA);
combined.save("moos1_normalheight.png");
6) Done.
Thanks to Sinbad for leaving that image combine code in the playpen.
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
This is how it looks with proper textures:
If I had any artistic skill, it would look better.
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Using the default material generator, we have a limit of 6 layers?
That's 6 textures we can blend? (if we're not using a global colour map, which we don't when splatting)
Or, am I missing anything?
That's 6 textures we can blend? (if we're not using a global colour map, which we don't when splatting)
Or, am I missing anything?
Code: Select all
uint8 TerrainMaterialGeneratorA::SM2Profile::getMaxLayers(const Terrain* terrain) const
{
// count the texture units free
uint8 freeTextureUnits = 16;
// lightmap
--freeTextureUnits;
// normalmap
--freeTextureUnits;
// colourmap
if (terrain->getGlobalColourMapEnabled())
--freeTextureUnits;
// TODO shadowmaps
// each layer needs 2.25 units (1xdiffusespec, 1xnormalheight, 0.25xblend)
return static_cast<uint8>(freeTextureUnits / 2.25f);
}
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Is this per terrain page?
So you can actually have 6 different layers for a different page?
So you can actually have 6 different layers for a different page?
/* 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.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
I use PixPlant to create my textures. It uses Ogre 
The limit on the number of layers depends on what other features you use, but it's a base of 6. Adding a colour map and 3xPSSM can reduce this to 5.
And yes, those 5/6 can be different per page. Only the declaration is shared between pages, the textures that fill the slots can be different. (well, actually you can have different declarations & material generators per page if you want too, it's just simpler not to)
The limit on the number of layers depends on what other features you use, but it's a base of 6. Adding a colour map and 3xPSSM can reduce this to 5.
And yes, those 5/6 can be different per page. Only the declaration is shared between pages, the textures that fill the slots can be different. (well, actually you can have different declarations & material generators per page if you want too, it's just simpler not to)
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Great, thanks! 
So, if I wanted to overcome this limit, I'd have to create a new multi-pass material generator, right?
And suffer the performance hit, of course.
But, all in all: this new terrain component is far less of a head ache to setup and use than ye olde terrain scenemanager.
So, if I wanted to overcome this limit, I'd have to create a new multi-pass material generator, right?
And suffer the performance hit, of course.
But, all in all: this new terrain component is far less of a head ache to setup and use than ye olde terrain scenemanager.
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Oh, I see that too now, after updating to newest revision.sinbad wrote:I'm finding in the current version the lightmap calculation seems to be aborting early when generating terrain from an image and the dynamic update doesn't work anymore. I have no idea when this started happening, I'll look when I get time. Still, the bits that are updated are correct, including using your light direction.
Could have spared myself the trouble of making those fancy textures - it looks flat as if I've used only diffuse maps.
At least I am ready for it when it's fixed.
/* 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.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
You're probably not interested, but here it is anyway:
Really quick screenshot from when the terrain is loaded: Less than a second later: First screenshot is with normal height and specular, but the second one is flat.
So, something happens. But it seems to bail out extremely quickly.
<edit>
Interestingly, when I save the terrain and load it, the terrain is lit and the diffuse_specular, normal_height textures are rendered correctly.
No lightmap, though. I think I can live with that for the time being.
</edit>
Really quick screenshot from when the terrain is loaded: Less than a second later: First screenshot is with normal height and specular, but the second one is flat.
So, something happens. But it seems to bail out extremely quickly.
<edit>
Interestingly, when I save the terrain and load it, the terrain is lit and the diffuse_specular, normal_height textures are rendered correctly.
No lightmap, though. I think I can live with that for the time being.
</edit>
/* 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.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
That's probably just the lightmap calculation failing for some reason and darkening everything. I will investigate why soon. My examples look fine, they just don't update the lightmap dynamically correctly, I don't know what broke this yet. I'm working on other issues for now but it's on my list.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
Lightmap generation is fixed now (bug was introduced in something as innocuous as fixing warnings, but the location of some casts was wrong).
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Yes, that fixed it! 
Thanks a lot.
Thanks a lot.
/* 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.
- stealth977
- Gnoll
- Posts: 638
- Joined: Mon Dec 15, 2008 6:14 pm
- Location: Istanbul, Turkey
- x 42
Re: New Terrain Early Shots
Just a small complaint. When a Terrain Instance is unloaded and deleted, if i create another Terrain instance, it crashes due to a problem in OgreTerainQuadTreeNode::load(), couldnt really track what causes it.
using OGRE trunk ( 1.8 )
ismail,
using OGRE trunk ( 1.8 )
ismail,
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
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: New Terrain Early Shots
I'll need a repro case, TerrainGroup does exactly this when being used for paging and I don't get this problem. Make sure you updated to the latest too since I fixed some issues.
-
James Proctor
- Orc
- Posts: 406
- Joined: Fri May 16, 2008 7:33 pm
- x 5
Re: New Terrain Early Shots
Here are some screenshots from a Procedural Terrain Engine I am working on for a MMO Engine using the new Terrain system:
- Attachments
-
- Terrain1.jpg (151.26 KiB) Viewed 16606 times
-
- Terrain6.jpg (203.24 KiB) Viewed 16606 times
-
- Terrain7.jpg (157.17 KiB) Viewed 16606 times
Follow me on Twitter - https://twitter.com/EmpireGames
Follow my Blog on Blogger - http://empiredevelopment.blogspot.com/
Follow my Blog on Blogger - http://empiredevelopment.blogspot.com/
-
rubasurex
- Gnoblar
- Posts: 15
- Joined: Mon Aug 25, 2008 4:08 pm
Re: New Terrain Early Shots
I was just playing with the terrain sample and I moved the tudor houses around a bit. I noticed a couple of things.
Firstly, the colour shadows appear to project two sets of shadows in opposite directions. The each house has two shadows protruding opposite from one another.
Secondly, with the depth shadows, I noticed that the houses shadow the terrain, themselves and each other, however the terrain shadow never effects the houses. If I place a house in the shadow of a large hill, the house stays fully lit. I understand that the terrain is using a lightmap, which obviously only effects itself. However I was thinking that perhaps with depth shadows, the terrain could cast a shadow that could affect the houses? Is this possible or are there technical or performance limitations to this?
Firstly, the colour shadows appear to project two sets of shadows in opposite directions. The each house has two shadows protruding opposite from one another.
Secondly, with the depth shadows, I noticed that the houses shadow the terrain, themselves and each other, however the terrain shadow never effects the houses. If I place a house in the shadow of a large hill, the house stays fully lit. I understand that the terrain is using a lightmap, which obviously only effects itself. However I was thinking that perhaps with depth shadows, the terrain could cast a shadow that could affect the houses? Is this possible or are there technical or performance limitations to this?
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: New Terrain Early Shots
Unless you're working off the current Ogre 1.7 svn branch, chances are that it's fixed.rubasurex wrote:I was just playing with the terrain sample and I moved the tudor houses around a bit. I noticed a couple of things.
Firstly, the colour shadows appear to project two sets of shadows in opposite directions. The each house has two shadows protruding opposite from one another.
So update first.
The houses (anything) needs to be added to the shadow queue for pre-processing, as I understand it.rubasurex wrote:Secondly, with the depth shadows, I noticed that the houses shadow the terrain, themselves and each other, however the terrain shadow never effects the houses. If I place a house in the shadow of a large hill, the house stays fully lit. I understand that the terrain is using a lightmap, which obviously only effects itself. However I was thinking that perhaps with depth shadows, the terrain could cast a shadow that could affect the houses? Is this possible or are there technical or performance limitations to this?
Check out the terrain sample, and the playpen.cpp in Ogre/tests.
/* 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.
-
rubasurex
- Gnoblar
- Posts: 15
- Joined: Mon Aug 25, 2008 4:08 pm
Re: New Terrain Early Shots
I tried it with the bleeding edge 1.7 svn... updated just before trying it.jacmoe wrote:Unless you're working off the current Ogre 1.7 svn branch, chances are that it's fixed.
So update first.
I was trying it in the terrain sample. It appears as though the terrain sample only uses depth shadow mapping for the houses. The terrain itself still uses a lightmap by the looks of it (I could be wrong), which explains why the terrain shadow doesn't affect the houses. I'm just wondering if there is any reason why the terrain doesn't also use depth shadows to cast on to the houses?jacmoe wrote:Check out the terrain sample, and the playpen.cpp in Ogre/tests.
