Black screen on load a osm file with terrain.cfg

kintaro

18-04-2006 21:51:22

I am having a problem in running a scene in oSceneLoader demo, where the scene has a terrain.cfg file. The scene is ok in oFusion on 3ds max, but when I run it on ogre, it appers a black screen, just as the discussion in:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=982&highlight=terrain

My previous scenes had worked very well, but the scene that I had putted a terrain is not working. I tried to enable shadows like it was sugested in the url above, but nothing happened. I am using OGRE Azathoth 1.0.7

Below there are the osm file and then my code:

terrain.osm:

<oe_scene>
<sceneManager type="1" worldGeometry="terraintiago.cfg" />
<bkgcolor r="0" g="0" b="0" />
<lightColor r="0.5" g="0.5" b="0.5" />
<shadowTechnique type="0" tex_size="512" tex_count="1">
<color r="0" g="0" b="0" />
</shadowTechnique>
<lights>
<light name="Omni01" type="omni" on="true" CastShadows="no" intensity="1">
<position x="5.82818e-08" y="143.583" z="-1.33333" />
<rotation x="-0.5" y="0.5" z="-0.5" w="-0.5" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
</light>
</lights>
<cameras>
<camera name="Camera01" FOV="0.785398">
<position x="1227.94" y="363.591" z="376.078" />
<rotation x="-0.348469" y="-0.642317" z="0.410208" w="-0.545644" />
<scale x="1" y="1" z="1" />
<target name="Camera01.Target">
<position x="458.71" y="2.22222" z="502.108" />
<rotation x="-0.5" y="0.5" z="-0.5" w="-0.5" />
<scale x="1" y="1" z="1" />
</target>
</camera>
</cameras>
<entities>
<entity name="Box01" hidden="false" filename="Box01.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="235.769" y="52.635" z="409.583" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="0.540132" y="0.540132" z="0.540132" />
</entity>
</entities>
</oe_scene>


my code:

#include "ExampleApplication_mod.h"

// oScene loader library header file
#include "OgreOSMScene.h"

#include <OgreNewt.h>

// Callback handler to post-process created objects
class oSceneCallback : public OSMSceneCallbacks {
public:

// We override the OnCreate method for cameras (See IXMLSceneCallbacks class)
void OnCameraCreate(Ogre::Camera* pCamera, TiXmlElement* pCameraDesc) {

// If a camera of name "FirstCamera" is loaded, it will be set as the default current
if(pCamera->getName() == "FirstCamera")
Ogre::Root::getSingleton().getAutoCreatedWindow()->getViewport(0)->setCamera(pCamera);
}

};


// Event handler to animate
class oSceneLibDemoFrameListener : public ExampleFrameListener
{
protected:

SceneManager* mSceneMgr;

public:
oSceneLibDemoFrameListener(SceneManager* sceneMgr, RenderWindow* win, Camera* cam)
: mSceneMgr(sceneMgr), ExampleFrameListener(win, cam)
{
}


bool frameStarted(const FrameEvent& evt)
{

static Real timeDelay = 0;
static Real currentTime = 0;

timeDelay -= evt.timeSinceLastFrame;

// We can cycle cameras with the 'c' key
if (mInputDevice->isKeyDown(KC_C) && timeDelay <= 0) {

Camera* firstCam;
Camera* currentCam = mWindow->getViewport(0)->getCamera();

Viewport* vp = mWindow->getViewport(0);

SceneManager::CameraIterator it = mSceneMgr->getCameraIterator();

if(it.hasMoreElements())
firstCam = it.peekNextValue();

while(it.hasMoreElements()) {

Ogre::Camera* cam = it.getNext();

if(currentCam == cam) {
Ogre::Camera* camera = it.hasMoreElements() ? it.getNext() : firstCam;
vp->setCamera(camera);
}
}

timeDelay = 0.5f;

}

// We update all loaded animations each frame
SceneManager::AnimationIterator animationIt = mSceneMgr->getAnimationIterator();

while(animationIt.hasMoreElements()) {
Animation* animation = animationIt.getNext();

const Animation::TrackList& trackList = animation->_getTrackList();

Animation::TrackList::const_iterator it = trackList.begin();
Animation::TrackList::const_iterator iend = trackList.end();

for(; it != iend; ++it) {
const Ogre::AnimationTrack* track = it->second;
track->getAssociatedNode()->resetToInitialState();
}

currentTime += evt.timeSinceLastFrame;
animation->apply(currentTime);
}

// Call default
return ExampleFrameListener::frameStarted(evt);

}
};

class oSceneLibApplication : public ExampleApplication {
public:

oSceneLibApplication()
{}



protected:

OgreNewt::World* m_World;

// Just override the mandatory create scene method
void createScene(void)
{
// Here is the code that will load the scene file
// A fixed filename "scene.osm" is implemented for this demo

// create OgreNewt world.
m_World = new OgreNewt::World();

// Create the scene loader
OSMScene oScene;

// Create an oE_Loader Callback object to post-process created objects
oSceneCallback oe_Callback;

// Initialises with the scene to be loaded and the callback if requiered
oScene.initialise("C:\\Programming\\Ogre\\ogreaddons\\oSceneLoader_demo\\Media\\terrain.osm", &oe_Callback);

// create and setup the scene in the root node
oScene.createScene();

mSceneMgr = oScene.getSceneManager();

mCamera = oScene.getCameraList().at(0);

oScene.getSceneManager()->setShadowTechnique( SHADOWTYPE_STENCIL_MODULATIVE );

oScene.getLightList().at(0)->setCastShadows(true);

/*// Create a default camera in case no cameras were saved in the scene
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position it at 500 in Z direction
mCamera->setPosition(Vector3(0,0,500));
// Look back along -Z
mCamera->lookAt(Vector3(0,0,-300));
mCamera->setNearClipDistance(5);*/

// Create one viewport, entire window
Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0,0,0));

// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));

//create a ninja for phisics
Entity* mEntity;

mEntity = mSceneMgr->createEntity( "Ninja", "ninja.mesh" );

SceneNode* mEntity_node;

mEntity_node = mSceneMgr->getRootSceneNode()->createChildSceneNode();

mEntity_node->attachObject(mEntity);

mEntity_node->translate(0,3000,0);

mEntity_node->scale(2,2,2);

//create phisics
OgreNewt::Collision* mEntity_col = new OgreNewt::CollisionPrimitives::Box( m_World, Ogre::Vector3( 100 , 700 , 100 ) );

OgreNewt::Body* mEntity_body = new OgreNewt::Body( m_World, mEntity_col );

Ogre::Vector3 mEntity_inertia = OgreNewt::MomentOfInertia::CalcBoxSolid( 10, Ogre::Vector3( 20 , 100 , 20) );

mEntity_body->setMassMatrix( 10 , mEntity_inertia );

mEntity_body->attachToNode( mEntity_node );

OgreNewt::BasicFrameListener* mNewtonListener;

mNewtonListener = new OgreNewt::BasicFrameListener( mWindow, mCamera, mSceneMgr, m_World, 60 );
mRoot->addFrameListener(mNewtonListener);

mEntity_body->setStandardForceCallback();

}

// The scene manager will be created by the Scene Loader lib
void chooseSceneManager(void) {}
void createCamera(void) {}
void createViewports(void) {}


// Create new frame listener
void createFrameListener(void)
{
mFrameListener= new oSceneLibDemoFrameListener(mSceneMgr, mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}

};




Notice that in my code I had implemented a code for phisics to a ninja, this code is working, and I had tested the scene with the terrain without the code for phisics, and the same happened, a black screen.

Thanks for help me to find out what is wrong.

Lioric

18-04-2006 22:04:24

Are the cfg file, the terrain textures and the hightmap image in the resource path of your application?

If you are using the sample terrain, then you need the terrain.cfg, the terain.png, the terain_detail.jpg and the terain_texture.jpg

In your example you need a "terraintiago.cfg" file and its dependencies

If you change the line :


<sceneManager type="1" worldGeometry="terraintiago.cfg" />


to:


<sceneManager type="1" />


are your scene objects loaded?

kintaro

19-04-2006 18:15:25

Ok, I'll tell where is each file of the scene:

  1. terraintiago.cfg -> my_program\bin\debug

    terrain.osm -> my_program\media

    terrain.png -> my_program->media->materials->textures

    terrain_detail.jpg -> my_program->media->materials->textures

    terrain_texture.jpg -> my_program->media->materials->textures
    [/list:u]

    When I change from:

    <sceneManager type="1" worldGeometry="terraintiago.cfg" />

    to:

    <sceneManager type="1" />

    Nothing happens, still only a black screen appears.

Lioric

20-04-2006 02:15:46

Is your "bin\debug\" folder in your resource locations?
The cfg terrain file should be in the media folder

Test setting:

The scene manager type to "0" in the scene file
Set the name of your camera to "FirstCamera"

Post your "ogre.log" file

kintaro

20-04-2006 18:19:42

Ok, I tried what you ask me to do but the same problem occurs.

Here is my resources.cfg:

[General]
FileSystem=./
FileSystem=../../Media
FileSystem=../../Media/fonts
FileSystem=../../Media/GUI/fonts
FileSystem=../../Media/GUI/imagesets
FileSystem=../../Media/GUI/schemes
FileSystem=../../Media/materials/scripts
FileSystem=../../Media/materials/textures
FileSystem=../../Media/models
FileSystem=../../Media/ms3d
FileSystem=../../Media/packs
FileSystem=../../Media/primitives

Zip=../../Media/packs/OgreCore.zip
Zip=../../Media/packs/cubemapsJS.zip


Here is my ogre.log

13:48:21: Creating resource group General
13:48:21: Registering ResourceManager for type Material
13:48:21: Registering ResourceManager for type Mesh
13:48:21: Registering ResourceManager for type Skeleton
13:48:21: Loading library OgrePlatform_d.dll
13:48:21: OverlayElementFactory for type Panel registered.
13:48:21: OverlayElementFactory for type BorderPanel registered.
13:48:21: OverlayElementFactory for type TextArea registered.
13:48:21: Registering ResourceManager for type Font
13:48:21: ArchiveFactory for archive type FileSystem registered.
13:48:21: ArchiveFactory for archive type Zip registered.
13:48:21: DevIL version: Developer's Image Library (DevIL) 1.6.7 Oct 28 2005
13:48:21: DevIL image formats: bmp dib cut dcx dds gif hdr ico cur jpg jpe jpeg lif mdl mng jng pcx pic pix png pbm pgm pnm ppm psd pdd psp pxr sgi bw rgb rgba tga vda icb vst tif tiff wal xpm raw
13:48:21: Registering ResourceManager for type HighLevelGpuProgram
13:48:21: Loading library .\RenderSystem_Direct3D7
13:48:21: Direct3D7 Rendering Subsystem created.
13:48:21: ----- DirectDraw Detection Starts
13:48:21: Detected DirectDraw driver Primary Display Driver
13:48:21: Detected DirectDraw driver ATI MOBILITY RADEON Xpress 200 Series
13:48:21: ----- DirectDraw Detection Ends
13:48:21: Loading library .\RenderSystem_Direct3D9
13:48:22: D3D9 : Direct3D9 Rendering SubSystem created.
13:48:22: D3D9: Driver Detection Starts
13:48:22: D3D9: Driver Detection Ends
13:48:22: Loading library .\RenderSystem_GL
13:48:22: OpenGL Rendering Subsystem created.
13:48:22: Loading library .\Plugin_ParticleFX
13:48:22: Particle Emitter Type 'Point' registered
13:48:22: Particle Emitter Type 'Box' registered
13:48:22: Particle Emitter Type 'Ellipsoid' registered
13:48:22: Particle Emitter Type 'Cylinder' registered
13:48:22: Particle Emitter Type 'Ring' registered
13:48:22: Particle Emitter Type 'HollowEllipsoid' registered
13:48:22: Particle Affector Type 'LinearForce' registered
13:48:22: Particle Affector Type 'ColourFader' registered
13:48:22: Particle Affector Type 'ColourFader2' registered
13:48:22: Particle Affector Type 'ColourImage' registered
13:48:22: Particle Affector Type 'ColourInterpolator' registered
13:48:22: Particle Affector Type 'Scaler' registered
13:48:22: Particle Affector Type 'Rotator' registered
13:48:22: Loading library .\Plugin_BSPSceneManager
13:48:22: Registering ResourceManager for type BspLevel
13:48:22: Loading library .\Plugin_OctreeSceneManager
13:48:22: TerrainSceneManager: Registered a new PageSource for type Heightmap
13:48:22: Loading library .\Plugin_CgProgramManager
13:48:22: *-*-* OGRE Initialising
13:48:22: *-*-* Version 1.0.7 (Azathoth)
13:48:22: Added resource location './' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/fonts' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/GUI/fonts' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/GUI/imagesets' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/GUI/schemes' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/materials/scripts' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/materials/textures' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/models' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/ms3d' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/packs' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/primitives' of type 'FileSystem' to resource group 'General'
13:48:22: Added resource location '../../Media/packs/OgreCore.zip' of type 'Zip' to resource group 'General'
13:48:22: Added resource location '../../Media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
13:48:22: D3D9 : RenderSystem Option: Anti aliasing = None
13:48:22: D3D9 : RenderSystem Option: Floating-point mode = Fastest
13:48:22: D3D9 : RenderSystem Option: Full Screen = Yes
13:48:22: D3D9 : RenderSystem Option: Rendering Device = ATI MOBILITY RADEON Xpress 200 Series
13:48:22: D3D9 : RenderSystem Option: VSync = No
13:48:22: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
13:48:24: D3D9 : Subsystem Initialising
13:48:24: D3D9RenderSystem::createRenderWindow "OGRE Render Window", 800x600 fullscreen miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 vsync=false
13:48:24: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
13:48:26: Registering ResourceManager for type Texture
13:48:26: Registering ResourceManager for type GpuProgram
13:48:26: RenderSystem capabilities
13:48:26: -------------------------
13:48:26: * Hardware generation of mipmaps: yes
13:48:26: * Texture blending: yes
13:48:26: * Anisotropic texture filtering: yes
13:48:26: * Dot product texture operation: yes
13:48:26: * Cube mapping: yes
13:48:26: * Hardware stencil buffer: yes
13:48:26: - Stencil depth: 8
13:48:26: - Two sided stencil support: yes
13:48:26: - Wrap stencil values: yes
13:48:26: * Hardware vertex / index buffers: yes
13:48:26: * Vertex programs: yes
13:48:26: - Max vertex program version: vs_2_0
13:48:26: * Fragment programs: yes
13:48:26: - Max fragment program version: ps_2_0
13:48:26: * Texture Compression: yes
13:48:26: - DXT: yes
13:48:26: - VTC: no
13:48:26: * Scissor Rectangle: yes
13:48:26: * Hardware Occlusion Query: yes
13:48:26: * User clip planes: yes
13:48:26: * VET_UBYTE4 vertex element type: yes
13:48:26: * Infinite far plane projection: yes
13:48:26: * Hardware render-to-texture: yes
13:48:26: * Floating point textures: yes
13:48:26: * Non-power-of-two textures: yes
13:48:26: * Volume textures: yes
13:48:26: ***************************************
13:48:26: *** D3D9 : Subsystem Initialised OK ***
13:48:26: ***************************************
13:48:26: ResourceBackgroundQueue - threading disabled
13:48:26: Particle Renderer Type 'billboard' registered
13:48:26: Parsing scripts for resource group General
13:48:26: Parsing script Example.material
13:48:26: Parsing script terrain.material
13:48:26: Parsing script zombie.material
13:48:26: Parsing script OgreCore.material
13:48:26: Parsing script OgreProfiler.material
13:48:26: Parsing script sample.fontdef
13:48:26: Bad attribute line: glyph 0.152344 0.125 0.160156 0.1875 in font Ogre
13:48:26: Parsing script Ogre.fontdef
13:48:26: Parsing script OgreDebugPanel.overlay
13:48:26: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8B8G8R8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
13:48:26: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
13:48:26: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8B8G8R8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
13:48:26: Font TrebuchetMSBoldusing texture size 512x512
13:48:26: Info: Freetype returned null for character 160 in font TrebuchetMSBold
13:48:26: Texture: TrebuchetMSBoldTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
13:48:26: Texture: ogretext.png: Loading 1 faces(PF_A8B8G8R8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
13:48:26: Parsing script OgreLoadingPanel.overlay
13:48:26: Finished parsing scripts for resource group General
13:48:26: ********************************
13:48:26: ** oScene Loader Lib **
13:48:26: ********************************
13:48:26: oSceneLoader: Loading 'C:\Programming\Ogre\ogreaddons\oSceneLoader_demo\Media\terrain.osm' file
13:48:26: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 8
Function: ResourceGroupManager::openResource
Description: Cannot locate resource C:\Programming\Ogre\ogreaddons\oSceneLoader_demo\Media\terrain.osm in resource group General..
File: c:\programming\ogre\ogrenew\ogremain\src\ogreresourcegroupmanager.cpp
Line: 501
Stack unwinding: <<beginning of stack>>
13:48:29: *-*-* OGRE Shutdown
13:48:29: Unregistering ResourceManager for type Font
13:48:29: Unregistering ResourceManager for type Skeleton
13:48:29: Unregistering ResourceManager for type Mesh
13:48:29: Unregistering ResourceManager for type HighLevelGpuProgram
13:48:29: Unloading library .\Plugin_CgProgramManager
13:48:29: Unloading library .\Plugin_OctreeSceneManager
13:48:29: Unregistering ResourceManager for type BspLevel
13:48:29: Unloading library .\Plugin_BSPSceneManager
13:48:29: Unloading library .\Plugin_ParticleFX
13:48:29: *** Stopping Win32GL Subsystem ***
13:48:29: Unloading library .\RenderSystem_GL
13:48:29: Render Target 'OGRE Render Window' Average FPS: 0 Best FPS: 0 Worst FPS: 999
13:48:30: D3D9 : Shutting down cleanly.
13:48:30: Unregistering ResourceManager for type Texture
13:48:30: Unregistering ResourceManager for type GpuProgram
13:48:30: D3D9 : Direct3D9 Rendering SubSystem destroyed.
13:48:30: Unloading library .\RenderSystem_Direct3D9
13:48:30: *-*-* Direct3D Subsystem shutting down cleanly.
13:48:30: Direct3D7 Rendering Subsystem destroyed.
13:48:30: Unloading library .\RenderSystem_Direct3D7
13:48:30: Unregistering ResourceManager for type Material
13:48:30: Unloading library OgrePlatform_d.dll


I tried other configurations with terraintiago.cfg in media folder, like changing again sceneManager type to "1", but doesn't work, of course I tried with "0" too.

I renamed the camera to FirstCam.

Here is my terrain.osm file:

<oe_scene>
<sceneManager type="0" worldGeometry="terraintiago.cfg"/>
<bkgcolor r="0" g="0" b="0" />
<lightColor r="0.5" g="0.5" b="0.5" />
<shadowTechnique type="0" tex_size="512" tex_count="1">
<color r="0" g="0" b="0" />
</shadowTechnique>
<lights>
<light name="Omni01" type="omni" on="true" CastShadows="no" intensity="1">
<position x="5.82818e-08" y="143.583" z="-1.33333" />
<rotation x="-0.5" y="0.5" z="-0.5" w="-0.5" />
<scale x="1" y="1" z="1" />
<color r="1" g="1" b="1" />
<specular r="1" g="1" b="1" />
</light>
</lights>
<cameras>
<camera name="FirstCamera" FOV="0.785398">
<position x="1227.94" y="363.591" z="376.078" />
<rotation x="-0.348469" y="-0.642317" z="0.410208" w="-0.545644" />
<scale x="1" y="1" z="1" />
<target name="FirstCamera.Target">
<position x="458.71" y="2.22222" z="502.108" />
<rotation x="-0.5" y="0.5" z="-0.5" w="-0.5" />
<scale x="1" y="1" z="1" />
</target>
</camera>
</cameras>
<entities>
<entity name="Box01" hidden="false" filename="Box01.mesh" CastShadows="yes" ReceiveShadows="yes">
<position x="235.769" y="52.635" z="409.583" />
<rotation x="0" y="0" z="0" w="-1" />
<scale x="0.540132" y="0.540132" z="0.540132" />
</entity>
</entities>
</oe_scene>


Here is my terraintiago.cfg:

# The main world texture (if you wish the terrain manager to create a material for you)
WorldTexture=Tterrain_texture.jpg

# The detail texture (if you wish the terrain manager to create a material for you)
DetailTexture=Tterrain_detail.jpg

#number of times the detail texture will tile in a terrain tile
DetailTile=3

# Heightmap source
PageSource=Heightmap

# Heightmap-source specific settings
Heightmap.image=Tterrain.png

# If you use RAW, fill in the below too
# RAW-specific setting - size (horizontal/vertical)
#Heightmap.raw.size=513
# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
#Heightmap.raw.bpp=2

# How large is a page of tiles (in vertices)? Must be (2^n)+1
PageSize=513

# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
TileSize=65

# The maximum error allowed when determining which LOD to use
MaxPixelError=3

# The size of a terrain page, in world units
PageWorldX=1500
PageWorldZ=1500
# Maximum height of the terrain
MaxHeight=300

# Upper LOD limit
MaxMipMapLevel=5

#VertexNormals=yes
#VertexColors=yes
#UseTriStrips=yes

# Use vertex program to morph LODs, if available
VertexProgramMorph=yes

# The proportional distance range at which the LOD morph starts to take effect
# This is as a proportion of the distance between the current LODs effective range,
# and the effective range of the next lower LOD
LODMorphStart=0.2

# This following section is for if you want to provide your own terrain shading routine
# Note that since you define your textures within the material this makes the
# WorldTexture and DetailTexture settings redundant

# The name of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamName=morphFactor

# The index of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamIndex=4

# The name of the material you will define to shade the terrain
#CustomMaterialName=TestTerrainMaterial




The files name I changed to:

WorldTexture=Tterrain_texture.jpg

DetailTexture=Tterrain_detail.jpg

Heightmap.image=Tterrain.png

They are in the folder media\materials\texture

This terrain, and all it's files are working well, I had tested then in demo_terrain program that comes with ogre.

Lioric

20-04-2006 22:09:25

According to your log file, the scene file is not in the resource location of your application (i.e. not in some folder from your resource paths)

If you still have this issue after moving the scene file to another folder that is visible to your application, send me the all files and i will test it (no need to send the real files, like original textures, if you dont have to)

kintaro

21-04-2006 22:05:50

Hi, thanks very much Lioric, it worked. I really had commited this mistake, the folder path was wrong. But it doesnt work, totally. In the osm file I had change:

<sceneManager type="1" worldGeometry="terraintiago.cfg" />


to:

<sceneManager type="1" />


and than add to the program code:

mSceneMgr->setWorldGeometry("terraintiago.cfg");

and then the program worded. But its importantant for me, speaking in workflow, that the terraintiago.cfg file is called inside the osm file. So I am still trying to solve the problem. Before I change the osm file and the program cade, the ogre log:

17:43:09: Creating resource group General
17:43:09: Registering ResourceManager for type Material
17:43:09: Registering ResourceManager for type Mesh
17:43:09: Registering ResourceManager for type Skeleton
17:43:09: Loading library OgrePlatform_d.dll
17:43:09: OverlayElementFactory for type Panel registered.
17:43:09: OverlayElementFactory for type BorderPanel registered.
17:43:09: OverlayElementFactory for type TextArea registered.
17:43:09: Registering ResourceManager for type Font
17:43:09: ArchiveFactory for archive type FileSystem registered.
17:43:09: ArchiveFactory for archive type Zip registered.
17:43:09: DevIL version: Developer's Image Library (DevIL) 1.6.7 Oct 28 2005
17:43:09: DevIL image formats: bmp dib cut dcx dds gif hdr ico cur jpg jpe jpeg lif mdl mng jng pcx pic pix png pbm pgm pnm ppm psd pdd psp pxr sgi bw rgb rgba tga vda icb vst tif tiff wal xpm raw
17:43:09: Registering ResourceManager for type HighLevelGpuProgram
17:43:09: Loading library .\RenderSystem_Direct3D7
17:43:09: Direct3D7 Rendering Subsystem created.
17:43:09: ----- DirectDraw Detection Starts
17:43:09: Detected DirectDraw driver Primary Display Driver
17:43:09: Detected DirectDraw driver ATI MOBILITY RADEON Xpress 200 Series
17:43:09: ----- DirectDraw Detection Ends
17:43:09: Loading library .\RenderSystem_Direct3D9
17:43:09: D3D9 : Direct3D9 Rendering SubSystem created.
17:43:09: D3D9: Driver Detection Starts
17:43:09: D3D9: Driver Detection Ends
17:43:09: Loading library .\RenderSystem_GL
17:43:09: OpenGL Rendering Subsystem created.
17:43:09: Loading library .\Plugin_ParticleFX
17:43:09: Particle Emitter Type 'Point' registered
17:43:09: Particle Emitter Type 'Box' registered
17:43:09: Particle Emitter Type 'Ellipsoid' registered
17:43:09: Particle Emitter Type 'Cylinder' registered
17:43:09: Particle Emitter Type 'Ring' registered
17:43:09: Particle Emitter Type 'HollowEllipsoid' registered
17:43:09: Particle Affector Type 'LinearForce' registered
17:43:09: Particle Affector Type 'ColourFader' registered
17:43:09: Particle Affector Type 'ColourFader2' registered
17:43:09: Particle Affector Type 'ColourImage' registered
17:43:09: Particle Affector Type 'ColourInterpolator' registered
17:43:09: Particle Affector Type 'Scaler' registered
17:43:09: Particle Affector Type 'Rotator' registered
17:43:09: Loading library .\Plugin_BSPSceneManager
17:43:09: Registering ResourceManager for type BspLevel
17:43:09: Loading library .\Plugin_OctreeSceneManager
17:43:09: TerrainSceneManager: Registered a new PageSource for type Heightmap
17:43:09: Loading library .\Plugin_CgProgramManager
17:43:09: *-*-* OGRE Initialising
17:43:09: *-*-* Version 1.0.7 (Azathoth)
17:43:09: Added resource location './' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/fonts' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/GUI/fonts' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/GUI/imagesets' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/GUI/schemes' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/materials/scripts' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/materials/textures' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/models' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/ms3d' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/packs' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/primitives' of type 'FileSystem' to resource group 'General'
17:43:09: Added resource location '../../Media/packs/OgreCore.zip' of type 'Zip' to resource group 'General'
17:43:09: Added resource location '../../Media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
17:43:09: D3D9 : RenderSystem Option: Anti aliasing = None
17:43:09: D3D9 : RenderSystem Option: Floating-point mode = Fastest
17:43:09: D3D9 : RenderSystem Option: Full Screen = Yes
17:43:09: D3D9 : RenderSystem Option: Rendering Device = ATI MOBILITY RADEON Xpress 200 Series
17:43:09: D3D9 : RenderSystem Option: VSync = No
17:43:09: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
17:43:11: D3D9 : Subsystem Initialising
17:43:11: D3D9RenderSystem::createRenderWindow "OGRE Render Window", 800x600 fullscreen miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 vsync=false
17:43:11: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
17:43:12: Registering ResourceManager for type Texture
17:43:12: Registering ResourceManager for type GpuProgram
17:43:12: RenderSystem capabilities
17:43:12: -------------------------
17:43:12: * Hardware generation of mipmaps: yes
17:43:12: * Texture blending: yes
17:43:12: * Anisotropic texture filtering: yes
17:43:12: * Dot product texture operation: yes
17:43:12: * Cube mapping: yes
17:43:12: * Hardware stencil buffer: yes
17:43:12: - Stencil depth: 8
17:43:12: - Two sided stencil support: yes
17:43:12: - Wrap stencil values: yes
17:43:12: * Hardware vertex / index buffers: yes
17:43:12: * Vertex programs: yes
17:43:12: - Max vertex program version: vs_2_0
17:43:12: * Fragment programs: yes
17:43:12: - Max fragment program version: ps_2_0
17:43:12: * Texture Compression: yes
17:43:12: - DXT: yes
17:43:12: - VTC: no
17:43:12: * Scissor Rectangle: yes
17:43:12: * Hardware Occlusion Query: yes
17:43:12: * User clip planes: yes
17:43:12: * VET_UBYTE4 vertex element type: yes
17:43:12: * Infinite far plane projection: yes
17:43:12: * Hardware render-to-texture: yes
17:43:12: * Floating point textures: yes
17:43:12: * Non-power-of-two textures: yes
17:43:12: * Volume textures: yes
17:43:12: ***************************************
17:43:12: *** D3D9 : Subsystem Initialised OK ***
17:43:12: ***************************************
17:43:12: ResourceBackgroundQueue - threading disabled
17:43:12: Particle Renderer Type 'billboard' registered
17:43:12: Parsing scripts for resource group General
17:43:12: Parsing script Example.material
17:43:12: Parsing script scterrain.material
17:43:12: Parsing script zombie.material
17:43:12: Parsing script OgreCore.material
17:43:12: Parsing script OgreProfiler.material
17:43:12: Parsing script sample.fontdef
17:43:12: Bad attribute line: glyph 0.152344 0.125 0.160156 0.1875 in font Ogre
17:43:12: Parsing script Ogre.fontdef
17:43:12: Parsing script OgreDebugPanel.overlay
17:43:12: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8B8G8R8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
17:43:12: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
17:43:12: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8B8G8R8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
17:43:12: Font TrebuchetMSBoldusing texture size 512x512
17:43:12: Info: Freetype returned null for character 160 in font TrebuchetMSBold
17:43:12: Texture: TrebuchetMSBoldTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
17:43:12: Texture: ogretext.png: Loading 1 faces(PF_A8B8G8R8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
17:43:12: Parsing script OgreLoadingPanel.overlay
17:43:12: Finished parsing scripts for resource group General
17:43:12: ********************************
17:43:12: ** oScene Loader Lib **
17:43:12: ********************************
17:43:12: oSceneLoader: Loading 'C:\Programming\Ogre\ogreaddons\oSceneLoader_plus_OgreNewt\Media\scterrain.osm' file
17:43:12: oSceneLoader: Creating scene on 'Root' node
17:43:12: TerrainSceneManager: Activated PageSource Heightmap
17:43:12: Texture: Tterrain_texture.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
17:43:12: Texture: Tterrain_detail.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
17:43:12: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: TerrainRenderable::_calculateCFactor
Description: You have not created a camera yet!.
File: c:\programming\ogre\ogrenew\plugins\octreescenemanager\src\ogreterrainrenderable.cpp
Line: 693
Stack unwinding: <<beginning of stack>>
17:43:14: *-*-* OGRE Shutdown
17:43:14: Unregistering ResourceManager for type Font
17:43:14: Unregistering ResourceManager for type Skeleton
17:43:14: Unregistering ResourceManager for type Mesh
17:43:14: Unregistering ResourceManager for type HighLevelGpuProgram
17:43:14: Unloading library .\Plugin_CgProgramManager
17:43:14: Unloading library .\Plugin_OctreeSceneManager
17:43:14: Unregistering ResourceManager for type BspLevel
17:43:14: Unloading library .\Plugin_BSPSceneManager
17:43:14: Unloading library .\Plugin_ParticleFX
17:43:14: *** Stopping Win32GL Subsystem ***
17:43:14: Unloading library .\RenderSystem_GL
17:43:15: Render Target 'OGRE Render Window' Average FPS: 0 Best FPS: 0 Worst FPS: 999
17:43:15: D3D9 : Shutting down cleanly.
17:43:15: Unregistering ResourceManager for type Texture
17:43:15: Unregistering ResourceManager for type GpuProgram
17:43:15: D3D9 : Direct3D9 Rendering SubSystem destroyed.
17:43:15: Unloading library .\RenderSystem_Direct3D9
17:43:15: *-*-* Direct3D Subsystem shutting down cleanly.
17:43:15: Direct3D7 Rendering Subsystem destroyed.
17:43:15: Unloading library .\RenderSystem_Direct3D7
17:43:15: Unregistering ResourceManager for type Material
17:43:15: Unloading library OgrePlatform_d.dll


Thanks for help Lioric. And how can I send you my files?

Lioric

22-04-2006 00:11:15

This is a known issue with terrains, it will fixed in the next update

kintaro

25-04-2006 19:06:37

Thanks again Lioric, you had help me a lot.