How to deal with terrain and Heightmap?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

How to deal with terrain and Heightmap?

Post by phuvinh1408 »

His guys, I want to ask you guys about dealing with terrain and heightmap files. I wonder to know If we have any tools or software to open and edit terrain and heightmap. The terrain file was written by XML structure and the heighmap show up binary code. So I want to open and edit them because some of my Scene map terrain texture was not correct like the ground showed the square shape in their edges. If you guys have any suggestions, just shout It out to me. Thank you alot.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 155

Re: How to deal with terrain and Heightmap?

Post by sercero »

Hello,

There is OGITOR: https://github.com/OGRECave/ogitor

But I'm not sure if you can open a heightmap that already exist.

What is the problem you are having? Do you have a screenshot?

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: How to deal with terrain and Heightmap?

Post by phuvinh1408 »

As you can see how the terrain texture is. It still show the edges so pointy. It does not look a real terrain. So I want to make It smoother and look realistic.

Image

The second thing is the background that clip out objects like those images below :

This one is the full objects:

Image

This one was clip out the objects:

Image

That means the camera was clip out the objects far distance.

So I want to remove that background or make It turn into transparent.

And how can I install and run the ogitor.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 155

Re: How to deal with terrain and Heightmap?

Post by sercero »

As you can see how the terrain texture is. It still show the edges so pointy. It does not look a real terrain. So I want to make It smoother and look realistic.

I'm not sure how this is being done in this game but what you want here is what is called Alpha Splatting.
The idea is to mix different textures using alpha blending.
https://wiki.ogre3d.org/-Alpha+splatting
https://wiki.ogre3d.org/Terrain+Alpha+Splatting

The second thing is the background that clip out objects like those images below

I don't know why this is happening, perhaps the developers have put the background on a small sphere that is clipping the geometry.
This might have been on purpose to reduce the amount of geometry thinking of slow GPUs and they mask this effect with the fog.

And how can I install and run the ogitor.

You can download the binaries from here:
https://github.com/OGRECave/ogitor

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: How to deal with terrain and Heightmap?

Post by phuvinh1408 »

So how to use the orgito, I dont know how to use It. We have to load Int into VS by Cmake?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 155

Re: How to deal with terrain and Heightmap?

Post by sercero »

No, you have to download the binaries from the site and run them.

It is a visual editor.

phuvinh1408
Halfling
Posts: 45
Joined: Tue Aug 09, 2022 7:55 am
x 1

Re: How to deal with terrain and Heightmap?

Post by phuvinh1408 »

Thanks, so one more thing I wonder to know. In the scene, It has Environment, then I figured out that my Scene above has the background that clipping out the objects was inherrit the color of the ambient in environment function. So in the new Ogre model source, do we have a function of environment like that?

Areba21
Gnoblar
Posts: 2
Joined: Tue Oct 18, 2022 5:47 am
x 1

Re: How to deal with terrain and Heightmap?

Post by Areba21 »

phuvinh1408 wrote: Sat Aug 27, 2022 7:03 pm

His guys, I want to ask you guys about dealing with terrain and heightmap files. I wonder to know If we have any tools or software to open and edit terrain and heightmap. The terrain file was written by XML structure and the heighmap show up binary code. So I want to open and edit them because some of my Scene map terrain texture was not correct like the ground showed the square shape in their edges. If you guys have any suggestions, just shout It out to me. Thank you alot.

If you're using picture data as the source for your height map, you should investigate gradient kernels like the Scharr or Sobel operators. These should result in better-looking normal maps or vertex normals.

Ryan8
Gnoblar
Posts: 17
Joined: Wed Jul 27, 2022 2:38 am
x 2

Re: How to deal with terrain and Heightmap?

Post by Ryan8 »

Following from above, i've had trouble building Ogitor with my Ogre 13.5.2 installation.

I've downloaded the Ogitor source via git/clone, and configured with cmake-gui. The build starts to compile but stops with an error at CameraEditor.cpp.

If anyone has ideas that would be appreciated.

Code: Select all

[ 10%] Building CXX object Ogitor/CMakeFiles/Ogitor.dir/src/CameraEditor.cpp.o
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘void Ogitors::CCameraEditor::lookAt(const Ogre::Vector3&)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:194:18: error: ‘class Ogre::Camera’ has no member named ‘lookAt’
  194 |         mHandle->lookAt(value);
      |                  ^~~~~~
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:195:36: error: ‘class Ogre::Camera’ has no member named ‘getOrientation’; did you mean ‘getRealOrientation’?
  195 |         mOrientation->set(mHandle->getOrientation());
      |                                    ^~~~~~~~~~~~~~
      |                                    getRealOrientation
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘bool Ogitors::CCameraEditor::_setPosition(Ogitors::OgitorsPropertyBase*, const Ogre::Vector3&)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:233:18: error: ‘class Ogre::Camera’ has no member named ‘setPosition’; did you mean ‘getRealPosition’?
  233 |         mHandle->setPosition(position);
      |                  ^~~~~~~~~~~
      |                  getRealPosition
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:236:22: error: ‘class Ogre::Camera’ has no member named ‘lookAt’
  236 |             mHandle->lookAt(mAutoTrackTargetPtr->getNode()->_getDerivedPosition());
      |                      ^~~~~~
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:237:50: error: ‘class Ogre::Camera’ has no member named ‘getOrientation’; did you mean ‘getRealOrientation’?
  237 |             mOrientation->initAndSignal(mHandle->getOrientation());
      |                                                  ^~~~~~~~~~~~~~
      |                                                  getRealOrientation
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘bool Ogitors::CCameraEditor::_setOrientation(Ogitors::OgitorsPropertyBase*, const Ogre::Quaternion&)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:250:18: error: ‘class Ogre::Camera’ has no member named ‘setOrientation’; did you mean ‘setOrientationMode’?
  250 |         mHandle->setOrientation(orientation);
      |                  ^~~~~~~~~~~~~~
      |                  setOrientationMode
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘bool Ogitors::CCameraEditor::_setAutoTrackTarget(Ogitors::OgitorsPropertyBase*, const Ogre::String&)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:364:22: error: ‘class Ogre::Camera’ has no member named ‘setAutoTracking’
  364 |             mHandle->setAutoTracking(true, mAutoTrackTargetPtr->getNode());
      |                      ^~~~~~~~~~~~~~~
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:366:22: error: ‘class Ogre::Camera’ has no member named ‘lookAt’
  366 |             mHandle->lookAt(mAutoTrackTargetPtr->getNode()->_getDerivedPosition());
      |                      ^~~~~~
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:367:40: error: ‘class Ogre::Camera’ has no member named ‘getOrientation’; did you mean ‘getRealOrientation’?
  367 |             mOrientation->set(mHandle->getOrientation());
      |                                        ^~~~~~~~~~~~~~
      |                                        getRealOrientation
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:375:22: error: ‘class Ogre::Camera’ has no member named ‘setAutoTracking’
  375 |             mHandle->setAutoTracking(false);
      |                      ^~~~~~~~~~~~~~~
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘virtual bool Ogitors::CCameraEditor::load(bool)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:397:16: error: ‘class Ogre::Camera’ has no member named ‘setPosition’; did you mean ‘getRealPosition’?
  397 |       mHandle->setPosition(mPosition->get());
      |                ^~~~~~~~~~~
      |                getRealPosition
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:398:16: error: ‘class Ogre::Camera’ has no member named ‘setOrientation’; did you mean ‘setOrientationMode’?
  398 |       mHandle->setOrientation(mOrientation->get());
      |                ^~~~~~~~~~~~~~
      |                setOrientationMode
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp: In member function ‘void Ogitors::CCameraEditor::onTrackTargetPositionChange(const Ogitors::OgitorsPropertyBase*, Ogre::Any)’:
/home/xxxxxx/Downloads/ogitor/Ogitor/src/CameraEditor.cpp:485:36: error: ‘class Ogre::Camera’ has no member named ‘getOrientation’; did you mean ‘getRealOrientation’?
  485 |         mOrientation->set(mHandle->getOrientation());
      |                                    ^~~~~~~~~~~~~~
      |                                    getRealOrientation
make[2]: *** [Ogitor/CMakeFiles/Ogitor.dir/build.make:118: Ogitor/CMakeFiles/Ogitor.dir/src/CameraEditor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:593: Ogitor/CMakeFiles/Ogitor.dir/all] Error 2
make: *** [Makefile:156: all] Error 2






loath
Platinum Sponsor
Platinum Sponsor
Posts: 290
Joined: Tue Jan 17, 2012 5:18 am
x 67

Re: How to deal with terrain and Heightmap?

Post by loath »

the camera API was refactored and ogitor probably wasn't ported over. as far as i recall, ogitor needs to make these calls on the Ogre::SceneNode* instead of on the Ogre::Camera. i believe enabling "OGRE_NODELESS_POSITIONING" in cmake when building Ogre will also enable the old behavior.

Ryan8
Gnoblar
Posts: 17
Joined: Wed Jul 27, 2022 2:38 am
x 2

Re: How to deal with terrain and Heightmap?

Post by Ryan8 »

Thanks loath. This helped. I reinstalled Ogre with "OGRE_NODELESS_POSITIONING" enabled. This got me past the camera issue at 10%. However, the build now fails at 50% with a plugin and AngelScriptInterpreter.cpp.

I couldn't find an easy way to disable this plugin (or if it is required). Unless there's an obvious fix that I've missed, I think I'll hold off on Ogitor for now. Maybe I'll try again with an earlier Ogre release with static libraries. Sorry for hijacking this thread.

Code: Select all

[ 50%] Building CXX object Plugins/OgAngelScript/CMakeFiles/OgAngelScript.dir/AngelScriptInterpreter.cpp.o
/home/ryandl/Downloads/ogitor/Plugins/OgAngelScript/AngelScriptInterpreter.cpp: In member function ‘virtual Ogre::StringVector Ogitors::AngelScriptInterpreter::runUpdateFunction(std::string&, Ogitors::CBaseEditor*, Ogre::Real)’:
/home/ryandl/Downloads/ogitor/Plugins/OgAngelScript/AngelScriptInterpreter.cpp:479:21: error: ordered comparison of pointer with integer zero (‘asIScriptFunction*’ and ‘int’)
  479 |     if( def->funcID < 0 )
      |         ~~~~~~~~~~~~^~~
make[2]: *** [Plugins/OgAngelScript/CMakeFiles/OgAngelScript.dir/build.make:76: Plugins/OgAngelScript/CMakeFiles/OgAngelScript.dir/AngelScriptInterpreter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:963: Plugins/OgAngelScript/CMakeFiles/OgAngelScript.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Post Reply