It is currently Sat Aug 22, 2020 4:52 am


All times are UTC




Post new topic Reply to topic  [ 128 posts ]  Go to page 1, 2, 3, 4, 5 ... 13  Next
Author Message
 Post subject: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 5:31 am 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
Hi guys. I was just curious how I could go about using Polyvox to manipulate terrain in Ogre. I'm not sure really which parts would be handled by Ployvox, and which parts I would have to code myself. Has anyone any ideas to how this can be achieved or any ideas on what needs to be done in order for voxel terrain manipulation to occur? Thanks for any replies!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 5:53 am 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
I have a pretty solid open source example in the showcase forum to get you started. Its done in ogre 1.7 but should give you a good idea how to use the library to render paged terrain created using Polyvox.

viewtopic.php?f=18&t=294

I do not have manipulation implemented but it would be very easy to add. If you are interested I can go into more detail on that, but it sounds like you want more of an overview.

PolyVox itself purely contains the voxel representation of an object or world. You can add to and manipulate the values using the functions inside, but it has no way of rendering this data or generating it.

Generating terrain data will likely involve using fractal noise to generate random values, or by converting a previously created mesh into a voxel volume. Both of these you will have to do yourself.

Rendering will be done by Ogre in your case. Polyvox provides surface extractors which provide raw mesh data that can be converted to work with any rendering engine. The easiest way to do this is by using Ogre::ManualObject.

Once generation and rendering are in place you can use setvoxel to manipulate the terrain. If you want the user to click a location use polyVox's provided raycasting classes.

This is a simple overview, but your question was not very specific. Hopefully this will give you a general idea and if you have a more specific question we can go from there.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 5:07 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
GM_Riscvul wrote:
I do not have manipulation implemented but it would be very easy to add. If you are interested I can go into more detail on that, but it sounds like you want more of an overview.

Once generation and rendering are in place you can use setvoxel to manipulate the terrain. If you want the user to click a location use polyVox's provided raycasting classes.



Thanks for the response. I did find your project and it looks great, but I've been running into trouble building it - errors below. Which version of visual studio did you use, 2010? I've previously worked with metaballs to add or subtract terrain, is this any different? Can you explain further on the 2 quotes above? Thank you! and great work btw :)


And the errors I get when building it -

Code:
1>------ Build started: Project: WorldCraft, Configuration: Debug Win32 ------
1>  WorldManager.cpp
1>  WorldCraft.cpp
1>  StdAfx.cpp
1>  Perlin.cpp
1>PolyVoxCore.lib(MeshDecimator.obj) : warning LNK4217: locally defined symbol ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)) imported in function "private: void __thiscall std::bitset<6>::_Xran(void)const " (?_Xran@?$bitset@$05@std@@ABEXXZ)
1>PolyVoxCore.lib(MeshDecimator.obj) : warning LNK4217: locally defined symbol ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)) imported in function "private: void __thiscall std::bitset<6>::_Xran(void)const " (?_Xran@?$bitset@$05@std@@ABEXXZ)
1>PolyVoxCore.lib(MeshDecimator.obj) : warning LNK4217: locally defined symbol ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "public: __thiscall std::logic_error::logic_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0logic_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z)
1>PolyVoxCore.lib(MeshDecimator.obj) : warning LNK4217: locally defined symbol ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ (public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const ) imported in function "public: virtual char const * __thiscall std::logic_error::what(void)const " (?what@logic_error@std@@UBEPBDXZ)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: __thiscall PolyVox::Region::Region(class PolyVox::Vector<3,int> const &,class PolyVox::Vector<3,int> const &)" (??0Region@PolyVox@@QAE@ABV?$Vector@$02H@1@0@Z) referenced in function "public: void __thiscall MeshManager::operator()(void)" (??RMeshManager@@QAEXXZ)
1>WorldManager.obj : error LNK2001: unresolved external symbol "public: __thiscall PolyVox::Region::Region(class PolyVox::Vector<3,int> const &,class PolyVox::Vector<3,int> const &)" (??0Region@PolyVox@@QAE@ABV?$Vector@$02H@1@0@Z)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getLowerCorner(void)const " (?getLowerCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ) referenced in function "public: virtual bool __thiscall MeshManager::frameRenderingQueued(struct Ogre::FrameEvent const &)" (?frameRenderingQueued@MeshManager@@UAE_NABUFrameEvent@Ogre@@@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getLowerCorner(void)const " (?getLowerCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: void __thiscall PolyVox::Region::setUpperCorner(class PolyVox::Vector<3,int> const &)" (?setUpperCorner@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z) referenced in function "public: __thiscall PolyVox::SurfaceExtractor<class PolyVox::LargeVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >::SurfaceExtractor<class PolyVox::LargeVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >(class PolyVox::LargeVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> > *,class PolyVox::Region,class PolyVox::SurfaceMesh<class PolyVox::PositionMaterialNormal> *)" (??0?$SurfaceExtractor@VLargeVolume@PolyVox@@V?$MaterialDensityPair@E$03$03@2@@PolyVox@@QAE@PAV?$LargeVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@1@VRegion@1@PAV?$SurfaceMesh@VPositionMaterialNormal@PolyVox@@@1@@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "public: void __thiscall PolyVox::Region::setUpperCorner(class PolyVox::Vector<3,int> const &)" (?setUpperCorner@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getUpperCorner(void)const " (?getUpperCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ) referenced in function "public: __thiscall PolyVox::SurfaceExtractor<class PolyVox::LargeVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >::SurfaceExtractor<class PolyVox::LargeVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >(class PolyVox::LargeVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> > *,class PolyVox::Region,class PolyVox::SurfaceMesh<class PolyVox::PositionMaterialNormal> *)" (??0?$SurfaceExtractor@VLargeVolume@PolyVox@@V?$MaterialDensityPair@E$03$03@2@@PolyVox@@QAE@PAV?$LargeVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@1@VRegion@1@PAV?$SurfaceMesh@VPositionMaterialNormal@PolyVox@@@1@@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "public: class PolyVox::Vector<3,int> const & __thiscall PolyVox::Region::getUpperCorner(void)const " (?getUpperCorner@Region@PolyVox@@QBEABV?$Vector@$02H@2@XZ)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: void __thiscall PolyVox::Region::shift(class PolyVox::Vector<3,int> const &)" (?shift@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z) referenced in function "public: void __thiscall PolyVox::SurfaceExtractor<class PolyVox::LargeVolume,class PolyVox::MaterialDensityPair<unsigned char,4,4> >::execute(void)" (?execute@?$SurfaceExtractor@VLargeVolume@PolyVox@@V?$MaterialDensityPair@E$03$03@2@@PolyVox@@QAEXXZ)
1>MeshManager.obj : error LNK2019: unresolved external symbol "public: bool __thiscall PolyVox::Region::containsPoint(class PolyVox::Vector<3,int> const &,unsigned char)const " (?containsPoint@Region@PolyVox@@QBE_NABV?$Vector@$02H@2@E@Z) referenced in function "public: void __thiscall PolyVox::LargeVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::Sampler::setPosition(int,int,int)" (?setPosition@Sampler@?$LargeVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXHHH@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "public: bool __thiscall PolyVox::Region::containsPoint(class PolyVox::Vector<3,int> const &,unsigned char)const " (?containsPoint@Region@PolyVox@@QBE_NABV?$Vector@$02H@2@E@Z)
1>MeshManager.obj : error LNK2019: unresolved external symbol "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::canCollapseNormalEdge(unsigned int,unsigned int)" (?canCollapseNormalEdge@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAE_NII@Z) referenced in function "private: bool __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterialNormal>::canCollapseEdge(unsigned int,unsigned int)" (?canCollapseEdge@?$MeshDecimator@VPositionMaterialNormal@PolyVox@@@PolyVox@@AAE_NII@Z)
1>MeshManager.obj : error LNK2019: unresolved external symbol "unsigned char __cdecl PolyVox::logBase2(unsigned int)" (?logBase2@PolyVox@@YAEI@Z) referenced in function "public: void __thiscall PolyVox::Block<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::initialise(unsigned short)" (?initialise@?$Block@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXG@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "unsigned char __cdecl PolyVox::logBase2(unsigned int)" (?logBase2@PolyVox@@YAEI@Z)
1>MeshManager.obj : error LNK2019: unresolved external symbol "bool __cdecl PolyVox::isPowerOf2(unsigned int)" (?isPowerOf2@PolyVox@@YA_NI@Z) referenced in function "public: void __thiscall PolyVox::Block<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::initialise(unsigned short)" (?initialise@?$Block@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXG@Z)
1>WorldManager.obj : error LNK2001: unresolved external symbol "bool __cdecl PolyVox::isPowerOf2(unsigned int)" (?isPowerOf2@PolyVox@@YA_NI@Z)
1>WorldManager.obj : error LNK2019: unresolved external symbol "public: void __thiscall PolyVox::Region::setLowerCorner(class PolyVox::Vector<3,int> const &)" (?setLowerCorner@Region@PolyVox@@QAEXABV?$Vector@$02H@2@@Z) referenced in function "public: void __thiscall PolyVox::LargeVolume<class PolyVox::MaterialDensityPair<unsigned char,4,4> >::resize(class PolyVox::Region const &,unsigned short)" (?resize@?$LargeVolume@V?$MaterialDensityPair@E$03$03@PolyVox@@@PolyVox@@QAEXABVRegion@2@G@Z)
1>PolyVoxCore.lib(MeshDecimator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base_secure@std@@QBEXXZ) referenced in function __catch$?reserve@?$vector@UIntVertex@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@V?$allocator@UIntVertex@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@QAEXI@Z$0
1>PolyVoxCore.lib(MeshDecimator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::~_Container_base_secure(void)" (__imp_??1_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::IntVertex> >::~_Container_base_aux_alloc_empty<class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::IntVertex> >(void)" (??1?$_Container_base_aux_alloc_empty@V?$allocator@UIntVertex@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@IAE@XZ)
1>PolyVoxCore.lib(MeshDecimator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base_secure::_Container_base_secure(void)" (__imp_??0_Container_base_secure@std@@QAE@XZ) referenced in function "protected: __thiscall std::_Container_base_aux_alloc_empty<class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::IntVertex> >::_Container_base_aux_alloc_empty<class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::IntVertex> >(class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::IntVertex>)" (??0?$_Container_base_aux_alloc_empty@V?$allocator@UIntVertex@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@IAE@V?$allocator@UIntVertex@?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@1@@Z)
1>C:\Users\Andrew\Desktop\senior-project-voxel-terrain-generation\Debug\WorldCraft.exe : fatal error LNK1120: 13 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 7:40 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
I solved the linking errors by rebuilding PolyVox with vs 2010 instead of 2008. But I hit an Ogre error while running the app saying it could not find SceneNode xyz ... any ideas?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 7:53 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
I also got a few cg compile errors here -


11:47:54: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : "The compile returned an error."
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: High-level program Ogre/ParticleGS/GenerateVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : "The compile returned an error."
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : "The compile returned an error."
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: High-level program Ogre/ParticleGS/DisplayVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : "The compile returned an error."
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : "The compile returned an error."
(323) : fatal error C9999: unexpected cast operation
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: High-level program Ogre/ParticleGS/DisplayPS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : "The compile returned an error."
(323) : fatal error C9999: unexpected cast operation
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:54: Parsing script Penguin.material
11:47:54: Parsing script Posterize.material
11:47:54: Parsing script pssm.material
11:47:54: Parsing script RadialBlur.material
11:47:54: Parsing script RZR-002.material
11:47:54: Parsing script ShaderSystem.material
11:47:54: Parsing script shadows.material
11:47:55: Parsing script SharpenEdges.material
11:47:55: Parsing script sibenik.material
11:47:55: Parsing script smoke.material
11:47:55: Parsing script Tiling.material
11:47:55: Parsing script VarianceShadowmap.material
11:47:56: Parsing script WorldCraft.material
11:47:56: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program MyFragmentShader1: CG ERROR : "The compile returned an error."
(16) : fatal error C9999: Dependent texture operations don't meet restrictions of texture shaders
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:56: High-level program MyFragmentShader1 encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program MyFragmentShader1: CG ERROR : "The compile returned an error."
(16) : fatal error C9999: Dependent texture operations don't meet restrictions of texture shaders
in CgProgram::loadFromSource at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
11:47:56: Parsing script Examples.compositor
11:47:56: Finished parsing scripts for resource group Popular
11:47:56: Parsing scripts for resource group Schemes
11:47:56: Finished parsing scripts for resource group Schemes
11:47:56: Parsing scripts for resource group SkyX
11:47:56: Parsing script SkyX.material
11:47:59: Finished parsing scripts for resource group SkyX
11:47:59: Texture: _cegui_ogre_0: Loading 1 faces(PF_A8B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
11:47:59: Texture: _cegui_ogre_1: Loading 1 faces(PF_A8B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
11:50:29: Can't assign material _NULL_ to SubEntity of SkyXMeshEnt because this Material does not exist. Have you forgotten to define it in a .material script?
11:50:29: Texture: SkyX_Starfield.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
11:50:29: Texture: SkyX_Moon.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
11:50:29: Texture: SkyX_MoonHalo.png: Loading 1 faces(PF_A8R8G8B8,512x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x256x1.
11:50:29: *** Initializing OIS ***
11:50:29: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
11:50:30: Texture: Clouds.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
11:50:30: Texture: CloudsNormal.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
11:50:30: Texture: CloudsTile.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
11:51:00: WARNING: material Worldcraft/Greengrass has no supportable Techniques and will be blank. Explanation:
Pass 0: Fragment program MyFragmentShader1 cannot be used - compile error.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 8:04 pm 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
And here's a picture of the final result -

Attachment:
screenshot01132012_120153989.gif
screenshot01132012_120153989.gif [ 62.17 KiB | Viewed 10651 times ]



and an error msg after about 5 minutes of building -

---------------------------
An exception has occured!
---------------------------
OGRE EXCEPTION(5:ItemIdentityException): SceneNode '0x-5y1z' not found. in SceneManager::getSceneNode at ..\..\..\..\OgreMain\src\OgreSceneManager.cpp (line 895)
---------------------------
OK
---------------------------


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 8:38 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
Alright the scenenode error is an known error that I have been unable to determine the cause of yet. I have been busy with some other projects and I haven't had the time to track it down yet. I would be extremely grateful if you could find out why it does that. I'll try and hunt it down too.

I can still run the program most of the time without that error occurring though. Does it happen to you constantly, or after a certain amount of time? I believe it is related to generation being much slower than paging at the moment.

As for the compile errors, thats odd. By the look of it I might have forgotten to remove some example shader programs from the svn. I'll take a look today and see if I can find what the offensive files are.

Oh my looking at that picture I have another question. Are you running this under DirectX or OpenGl?

I don't have the shader working in DirectX yet :) I'm such a shader noob.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 8:46 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
Also I do believe after looking at your screenshot that the problem is likely related to generation being so much slower than paging. Likely some of the areas near the camera that should be generating are being paged out before they are generated leading to the error that you are experiencing.

In the long term I desperately need to find a faster way to generate my fractal noise.

Short term, a try catch block around the scenenode creation code solves the problem as this error is not fatal unless uncaught.

Again let me know whether you are running this in DirectX or OpenGL, because in directX my shader doesn't compile giving the same whitish appearance. I haven't fixed that yet because I will be throwing that crappy shader out soon for one that can handle multiple textures and Triplanar texturing.

EDIT: There are extra example files in the svn that probably shouldn't be there. I will have them removed shortly. All of the errors regarding myVertexShader and myFragmentShader are errors regarding my pitiful first attempt at shaders and I recieve the same errors in DirectX but not OpenGL Until I find out which renderer you are using there is not much else I can do for those errors.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 10:36 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I can't help you get the sample working, but I'll elaborate on the role of PolyVox. PolyVox provides two basic features, these being storage of volume data and the conversion of that data into a mesh. The idea is that you first fill you volume with data (by calling setVoxelAt()). This data might come from noise, from disk, or whatever you wish. Next you use PolyVox to convert that data to a mesh and upload it to Ogre (or whatever you're using).

After you've done this you can continue to modify the volume data however you wish, but the see the effect of these changes you need to extract the mesh again and send it to Ogre again. For this reason, it's useful to break the volume down into conceptual 'regions', with one mesh for each, and only regenerate the ones you have modified.

Also, check out the book article if you haven't already: http://books.google.com/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game%20engine%20gems&pg=PA39#v=onepage&q&f=false


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Realtime Ogre 1.8 Terrain Component manipulation
PostPosted: Fri Jan 13, 2012 10:54 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
Quote:

Quote:

GM_Riscvul wrote:
I do not have manipulation implemented but it would be very easy to add. If you are interested I can go into more detail on that, but it sounds like you want more of an overview.

Once generation and rendering are in place you can use setvoxel to manipulate the terrain. If you want the user to click a location use polyVox's provided raycasting classes.


Can you explain further on the 2 quotes above? Thank you! and great work btw


Sorry I missed this part earlier. The simple answer is what David posted for you.

David Williams wrote:
The idea is that you first fill you volume with data (by calling setVoxelAt()). This data might come from noise, from disk, or whatever you wish. Next you use PolyVox to convert that data to a mesh and upload it to Ogre (or whatever you're using).

After you've done this you can continue to modify the volume data however you wish, but the see the effect of these changes you need to extract the mesh again and send it to Ogre again. For this reason, it's useful to break the volume down into conceptual 'regions', with one mesh for each, and only regenerate the ones you have modified.

Also, check out the book article if you haven't already: http://books.google.com/books?id=WNfD2u8nIlIC&lpg=PR1&dq=game%20engine%20gems&pg=PA39#v=onepage&q&f=false


Any changes you want to make to the volume you have to do yourself by calling setVoxelAt() for each voxel you want to change. This allows you to customize the behavior. For example you can use the metaballs you mentioned earlier by calling setVoxalAt() for each point within the metaball. Or you could just find the center of the metaBall and the radius and loop through the affected voxels. Given thats a sphere not a metaball but it might be faster.

As far as the raycasting goes, polyvox provides a class that projects a ray of given length in a given direction and has variables that indicate if and where a collision occurred.

If you wanted to have a minecraft like editing system you could find the lookAt vector of the camera and pass in the reach of the player avatar and see if the ray hits anything, if it does then you can edit the voxels around the intersection point. Of course this can be done for bullets and any other effect which travels in a straight line (ok bullets don't technically, but usually do in games)

I hope this explains the basic concepts of manipulating volume data in Polyvox. Remember that polyvox doesn't render the volume so you will need to update the mesh your renderer is using everytime you change the volume.

That book article David mentioned is a good one if you are interested in voxels.

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 128 posts ]  Go to page 1, 2, 3, 4, 5 ... 13  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net