[DotSceneLoader] load Terrain from Ogitor crash on StreamSerialiser::readHeader

Problems building or running the engine, queries about how to use features etc.
Post Reply
Whisperd130
Halfling
Posts: 77
Joined: Wed Feb 01, 2017 4:02 pm
x 1

[DotSceneLoader] load Terrain from Ogitor crash on StreamSerialiser::readHeader

Post by Whisperd130 »

Hello,
I had using Ogitor to create a sample terrain and some meshs.
Image

After that I just exported it as file: *.scene. Inside this file, it describe the terrain with a Page_00000000.ogt file.

Code: Select all

    <terrain worldSize="512" mapSize="129" pagenameprefix="Page" colourmapEnabled="false" colourMapTextureSize="128" tuningCompositeMapDistance="2000" tuningMaxPixelError="3" tuningMinBatchSize="33" tuningMaxBatchSize="65" tuningSkirtSize="10" tuningUseRayBoxDistancealculation="false">
        <terrainPages>
            <terrainPage name="Page_00000000.ogt" pageX="0" pageY="0" pagedGeometryPageSize="40" pagedGeometryDetailDistance="240" />
        </terrainPages>
    </terrain>
For using scene file, I had download the DotSceneLoader project from https://github.com/OGRECave/DotSceneFormat.
So I got DotSceneLoader.h, DotSceneLoader.cpp, rapidxml.hpp and main.cpp. By using this file I built up project in Visual Studio 2015.

Other material shows nice but only crash in running into terrain part and VS2015 shows like the image says.
Image

When I look inside the code, I found it crash in OgreStreamSerialiser.

Code: Select all

    void StreamSerialiser::readHeader()
    {
        uint32 headerid;
        size_t actually_read = mStream->read(&headerid, sizeof(uint32));
        // skip back
        mStream->skip(0 - (long)actually_read);
        // validate that this is a header chunk
        if (headerid == REVERSE_HEADER_ID)
        {
            mFlipEndian = true;
        }
        else if (headerid == HEADER_ID)
        {
            mFlipEndian = false;
        }
        else
        {
            // no good
            OGRE_EXCEPT(Exception::ERR_INVALID_STATE, 
                "Cannot determine endian mode because header is missing", 
                "StreamSerialiser::readHeader");
        }
... other code...
    }
Image

Ogitor version 0.5.0
OGRE version 1.10.7

Is there any ideas to fix this? I'm not sure what should I do next.

Thanks for advice.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: [DotSceneLoader] load Terrain from Ogitor crash on StreamSerialiser::readHeader

Post by paroj »

I am not sure whether you can just feed the .ogt file in there. It might be a ogitor specific file format. The best thing is probably to try loading it in ogitor again and if it works look what ogitor does.

The terrain part is actually outside the .scene spec: https://github.com/OGRECave/DotSceneFor ... tscene.dtd

So while the code is there, I would not bet that it does the right thing..
Whisperd130
Halfling
Posts: 77
Joined: Wed Feb 01, 2017 4:02 pm
x 1

Re: [DotSceneLoader] load Terrain from Ogitor crash on StreamSerialiser::readHeader

Post by Whisperd130 »

well, I have just solved the problem by seeing https://forums.ogre3d.org/viewtopic.php ... 4&start=25 this.

After that, I want to know is there any possible to see the Terrain by using OpenGL?
When I using Plugin=RenderSystem_Direct3D9_d, the Terrain shows fine.
Image

But when I change render system to Plugin=RenderSystem_GL_d, the Terrain disappeared.
Image

What should I do to deal with this situation?

Thanks.
Post Reply