Simple Paged Terrain [v2.00 Released! Page 21]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Alright, today is going to mostly be some upkeep, documentation and experimentation. I need to work on other projects as well, but I did notice something interesting: the ECW Mapper SDK is free for non-commercial use. I could have sworn it used to be license-only, but apparently I can use their ridiculously powerful decompression system to work with really large files to load data without having to decompress the entire image at once.

In other words, I could have huge height-maps without causing the computer to explode. I doubt I'll get it into SPT for a while (there's quite a few things that need to be cared for), but it's awesome that it's free for non-commercial use.
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

Well f**k me... I just fixed the addTerrainModifier problems with linux gcc by changing this ...

Code: Select all

gTerrain->addTerrainModifier(RectFlatten(vRayPos,2000,1000));
into this ...

Code: Select all

RectFlatten ble(vRayPos,2000,1000); gTerrain->addTerrainModifier(ble);
... same with the second call to RectFlatten. Time to file a gcc bug I guess.

About the spherical harmonics stuff... great you got it to work so fast, the pic you posted looks really nice! Can't wait to try it with spt2 and some tree models of mine!

I spent some of the weekend reading Xaviers excellent book on ogre, next on the list is some basic Cg reading. :)
Last edited by aguru on Sun Jul 06, 2008 11:37 pm, edited 1 time in total.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Post by DanielSefton »

SPT has been playing up ever since I abstracted it into a composition class. It executes exactly the same as when calling it directly, so I have no idea what is wrong.

Now the program crashes at this line:

Code: Select all

m_Terrain->createLightmapper("Lightmapper","SPT_Comp",2048,2049);
With this error:
Debug Assertion Failed!

Program: ...test.exe
File: xtree
Line: 384

Expression: map/set iterator not incrementable
Then it points to:

Code: Select all

CEGUI::System::getSingleton().injectMouseButtonUp(mouseBtn);
Wtf would cause it to crash at the CEGUI injection?

All the stack trace shows is the loop function which calls the input manager, all the way down to the press of the mouse button, to that function. Shows nothing about SPT. Neither does the ogre log. No errors. If I comment out createLightmapper(), it works fine.

Also, the camera clamping doesn't work at all.

And to top that... The sky is going crazy. Check it out:

Image

It seems to rotate around the camera horizontally when I move it. Its like a borg ship, the skybox moves all over the place when the camera orientation changes. (Btw, ignore the blue stripes - that's SPT; I'm just taking the shots below it on top of the default terrain, as its the only place you can see the skybox.)

I was just wondering if you would know what is going on off the top of your head. I'm not sure if there's anything in SPT that could trigger this, like in conflict with my program design. I'll post the code if you need it; but its exactly the same as the demo code, just in a class.

Cheers.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Are you calling both of these:

Code: Select all

		// This is set to update every frame for SPT
		gTerrain->onFrameStart(evt.timeSinceLastFrame);

		// Updates the end-of-frame duties of SPT
		if (gTerrain)
			gTerrain->onFrameEnd(evt.timeSinceLastFrame);
The second one is in the frameEnded() function of the ExampleFramelistener. I'll be getting rid of it soon, but for now both need to be called.

As for the light-mapper failing, is it actually getting the material and compositor? They're in the media directory (well, media\materials I think).

Edit: Scratch the compositor, I forgot - I create that, it's not in a file (whoops).

If you want me to test the code myself to see what's going on (could be something completely un-related), feel free to either post the code here or PM it to me.

aguru: It's possible that GCC is more strict about those things (or VS is being non-standard), so I'll try something else.

If you feel like giving this a shot, go to Terrain.h and Terrain.cpp and change

Code: Select all

addTerrainModifier(TerrainModifier& modifier)

to

Code: Select all

addTerrainModifier(const TerrainModifier& modifier)
I originally had it set as pointers, but it was a bit ugly generating new modifiers all the time. I've got some better methods coming, but those were really just test implementations.
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

morning, hex.

I did try consting the refenrence and in theory it fixes the problem (in the demo). But I got all kinds of const errors in the lib itself (i.e. a non-const member function is being invoked for a const object and I don't think we want ) so I wasn't sure if this is really the way to go.

Anyway I spent a few more minutes on this and I got it to compile cleanly now. Here is the diff:

Code: Select all

Index: library/include/CircleDisplacement.h                                                                          
===================================================================                                                  
--- library/include/CircleDisplacement.h        (revision 2471)                                                      
+++ library/include/CircleDisplacement.h        (working copy)                                                       
@@ -13,11 +13,11 @@                                                                                                  
        public:                                                                                                      
                CircleDisplacement(const Ogre::Vector3& center, Ogre::Real radius, Ogre::Real displacement, bool addative = true);
                                                                                                                                  
-               void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale  );                      
+               void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) const;                 
                                                                                                                                  
                //void displace(Ogre::Vector3* pVerts);                                                                           
                                                                                                                                  
-               bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax);                                            
+               bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax) const;                                      
                                                                                                                                  
        private:                                                                                                                  
                Ogre::Real mDisplacement;                                                                                         
@@ -25,4 +25,4 @@                                                                                                                 
                Ogre::Vector3 mCenter;                                                                                            
                bool mAddative;                                                                                                   
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/include/Terrain.h                                                                                                  
===================================================================                                                               
--- library/include/Terrain.h   (revision 2471)                                                                                   
+++ library/include/Terrain.h   (working copy)                                                                                    
@@ -162,7 +162,7 @@                                                                                                               
                                                                                                                                  
                void updateLightmap();                                                                                            
                                                                                                                                  
-               QNode* addTerrainModifier(TerrainModifier& pModifier);                                                            
+               QNode* addTerrainModifier(const TerrainModifier& pModifier);                                                      
                                                                                                                                  
                AtmosphericCubeMap* createAtmosphere(                                                                             
                        Ogre::Real fPlanetRadius,                                                                                 
@@ -301,4 +301,4 @@                                                                                                               
                TerrainEventListener mDefaultListener;                                                                            
                                                                                                                                  
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/include/QNode.h                                                                                                    
===================================================================                                                               
--- library/include/QNode.h     (revision 2471)                                                                                   
+++ library/include/QNode.h     (working copy)                                                                                    
@@ -33,8 +33,8 @@                                                                                                                 
                //Heightmap* getParentHeightmap(){return mParentMap;}                                                             
                //void setParentHeightmap(Heightmap* pParentMap){mParentMap = pParentMap;}                                        
                                                                                                                                  
-               QNode* getHighestAffected(TerrainModifier* pModifier);                                                            
-               void checkModifier(TerrainModifier* pModifier);                                                                   
+               QNode* getHighestAffected(const TerrainModifier* pModifier);                                                      
+               void checkModifier(const TerrainModifier* pModifier);                                                             
                                                                                                                                  
                void _testUpdate();                                                                                               
                                                                                                                                  
@@ -114,4 +114,4 @@                                                                                                               
                                                                                                                                  
                bool mForceSplit;                                                                                                 
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/include/Heightmap.h                                                                                                
===================================================================                                                               
--- library/include/Heightmap.h (revision 2471)                                                                                   
+++ library/include/Heightmap.h (working copy)                                                                                    
@@ -48,4 +48,4 @@                                                                                                                 
                                                                                                                                  
                bool mHasBorder;                                                                                                  
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/include/RectFlatten.h                                                                                              
===================================================================                                                               
--- library/include/RectFlatten.h       (revision 2471)                                                                           
+++ library/include/RectFlatten.h       (working copy)                                                                            
@@ -14,9 +14,9 @@                                                                                                                 
        public:                                                                                                                   
                RectFlatten(const Ogre::Vector3& center, Ogre::Real width, Ogre::Real height);                                    
                                                                                                                                  
-               void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale  );                      
+               void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) const;                 
                                                                                                                                  
-               bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax);                                            
+               bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax) const;                                      
                                                                                                                                  
        private:                                                                                                                  
                Ogre::Vector3 mCenter;                                                                                            
@@ -25,4 +25,4 @@                                                                                                                 
                Ogre::Vector2 mMin;                                                                                               
                Ogre::Vector2 mMax;                                                                                               
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/include/TerrainModifier.h                                                                                          
===================================================================                                                               
--- library/include/TerrainModifier.h   (revision 2471)                                                                           
+++ library/include/TerrainModifier.h   (working copy)                                                                            
@@ -11,8 +11,8 @@                                                                                                                 
                virtual ~TerrainModifier(){}                                                                                      
                                                                                                                                  
                //virtual void displace(Ogre::Vector3* pVerts) = 0;                                                               
-               virtual void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) = 0;           
+               virtual void displace(Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) const = 0;     
                                                                                                                                  
-               virtual bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax) = 0;                                
+               virtual bool isInBounds(const Vec2D<double>& vMin, const Vec2D<double>& vMax) const = 0;                          
        };                                                                                                                        
-}                                                                                                                                
\ No newline at end of file                                                                                                       
+}                                                                                                                                
Index: library/src/Terrain.cpp                                                                                                    
===================================================================                                                               
--- library/src/Terrain.cpp     (revision 2471)                                                                                   
+++ library/src/Terrain.cpp     (working copy)                                                                                    
@@ -318,7 +318,7 @@                                                                                                               
                        mRootNode->runQuadTreeChecks();                                                                           
        }                                                                                                                         
                                                                                                                                  
-       QNode* Terrain::addTerrainModifier( TerrainModifier& pModifier )                                                          
+       QNode* Terrain::addTerrainModifier(const TerrainModifier& pModifier )                                                     
        {                                                                                                                         
                if (pModifier.isInBounds(mRootNode->getFloatingPointOffset(),mRootNode->getFloatingPointOffset() + mRootNode->getFloatingPointWidth()))
                {                                                                                                                                      
@@ -630,4 +630,4 @@                                                                                                                                    
                }                                                                                                                                      
                DefaultRaySceneQuery::execute(listener);                                                                                               
        }                                                                                                                                              
-}                                                                                                                                                     
\ No newline at end of file                                                                                                                            
+}                                                                                                                                                     
Index: library/src/Heightmap.cpp                                                                                                                       
===================================================================                                                                                    
--- library/src/Heightmap.cpp   (revision 2471)                                                                                                        
+++ library/src/Heightmap.cpp   (working copy)                                                                                                         
@@ -160,7 +160,7 @@                                                                                                                                    
                        y += 1;                                                                                                                        
                }                                                                                                                                      
                                                                                                                                                       
-               if (x < 0 || x >= mAllocatedWidth || y < 0 || y >= mAllocatedWidth)                                                                    
+               if (x < 0 || (unsigned int)x >= mAllocatedWidth || y < 0 || (unsigned int)y >= mAllocatedWidth)                                        
                        return (HEIGHTMAPTYPE)0;                                                                                                       
                                                                                                                                                       
                return mData[x + y * mAllocatedWidth];                                                                                                 
@@ -243,4 +243,4 @@                                                                                                                                    
                        - plane.d) / plane.normal.y;                                                                                                   
                                                                                                                                                       
        }                                                                                                                                              
-}                                                                                                                                                     
\ No newline at end of file                                                                                                                            
+}                                                                                                                                                     
Index: library/src/QNode.cpp                                                                                                                           
===================================================================                                                                                    
--- library/src/QNode.cpp       (revision 2471)                                                                                                        
+++ library/src/QNode.cpp       (working copy)                                                                                                         
@@ -329,7 +329,7 @@                                                                                                                                    
                }                                                                                                                                      
        }                                                                                                                                              
                                                                                                                                                       
-       void QNode::checkModifier( TerrainModifier* pModifier )                                                                                        
+       void QNode::checkModifier( const TerrainModifier* pModifier )                                                                                  
        {                                                                                                                                              
                if (pModifier->isInBounds(mFloatingPointOffset,mFloatingPointOffset + mFloatingPointWidth))                                            
                {                                                                                                                                      
@@ -381,7 +381,7 @@                                                                                                                                    
                }                                                                                                                                      
        }                                                                                                                                              
                                                                                                                                                       
-       QNode* QNode::getHighestAffected( TerrainModifier* pModifier )                                                                                 
+       QNode* QNode::getHighestAffected( const TerrainModifier* pModifier )                                                                           
        {                                                                                                                                              
                if (mHasChildren)                                                                                                                      
                {                                                                                                                                      
@@ -404,4 +404,4 @@                                                                                                                                    
                                                                                                                                                       
                return this;                                                                                                                           
        }                                                                                                                                              
-}                                                                                                                                                     
\ No newline at end of file                                                                                                                            
+}                                                                                                                                                     
Index: library/src/RectFlatten.cpp                                                                                                                     
===================================================================                                                                                    
--- library/src/RectFlatten.cpp (revision 2471)                                                                                                        
+++ library/src/RectFlatten.cpp (working copy)                                                                                                         
@@ -23,7 +23,7 @@                                                                                                                                      
                                                                                                                                                       
        }                                                                                                                                              
                                                                                                                                                       
-       void RectFlatten::displace( Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale )                                       
+       void RectFlatten::displace( Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) const                                 
        {                                                                                                                                              
                Real fDelta = fWidth / Real(pHeightmap->getWidth()-1);                                                                                 
                Real fStartX = vTopLeft.x;                                                                                                             
@@ -49,7 +49,7 @@                                                                                                                                      
                }                                                                                                                                      
        }                                                                                                                                              
                                                                                                                                                       
-       bool RectFlatten::isInBounds( const Vec2D<double>& vMin, const Vec2D<double>& vMax )                                                           
+       bool RectFlatten::isInBounds( const Vec2D<double>& vMin, const Vec2D<double>& vMax ) const                                                     
        {                                                                                                                                              
                // This inside checked node                                                                                                            
                if (mMin.x >= vMin.x &&                                                                                                                
@@ -87,4 +87,4 @@                                                                                                                                      
                                                                                                                                                       
                //return false;                                                                                                                        
        }                                                                                                                                              
-}                                                                                                                                                     
\ No newline at end of file                                                                                                                            
+}                                                                                                                                                     
Index: library/src/TerrainMesh.cpp                                                                                                                     
===================================================================                                                                                    
--- library/src/TerrainMesh.cpp (revision 2471)                                                                                                        
+++ library/src/TerrainMesh.cpp (working copy)                                                                                                         
@@ -328,7 +328,7 @@                                                                                                                                    
                                                                                                                                                       
        Ogre::IndexData* TerrainMesh::getIndexData( size_t iLOD /*= 0*/ )                                                                              
        {                                                                                                                                              
-               if (iLOD > mMaxLOD)                                                                                                                    
+               if (iLOD > (unsigned size_t)mMaxLOD)                                                                                                   
                        iLOD = mMaxLOD;                                                                                                                

                IndexData* indexData = mTerrain->getIndexData(iLOD);
@@ -598,7 +598,7 @@

        void TerrainMesh::setRenderLevel( size_t iLOD /*= 0*/ )
        {
-               if (iLOD > mMaxLOD)
+               if (iLOD > (unsigned size_t)mMaxLOD)
                        iLOD = mMaxLOD;

                mIndexData = getIndexData(iLOD);
@@ -1424,4 +1424,4 @@
                mLODMorphFactor = LODMorph;
                setRenderLevel(mRenderLevel);
        }
-}
\ No newline at end of file
+}
Index: library/src/CircleDisplacement.cpp
===================================================================
--- library/src/CircleDisplacement.cpp  (revision 2471)
+++ library/src/CircleDisplacement.cpp  (working copy)
@@ -49,7 +49,7 @@
                }
        }*/

-       void CircleDisplacement::displace( Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale )
+       void CircleDisplacement::displace( Vec2D<double> vTopLeft, double fWidth, Heightmap* pHeightmap, float fScale ) const
        {
                Real fDelta = fWidth / Real(pHeightmap->getWidth()-1);
                Real fStartX = vTopLeft.x;
@@ -84,7 +84,7 @@
                        vTopLeft.y += fDelta;
                }
        }
-       bool CircleDisplacement::isInBounds( const Vec2D<double>& vMin, const Vec2D<double>& vMax )
+       bool CircleDisplacement::isInBounds( const Vec2D<double>& vMin, const Vec2D<double>& vMax ) const
        {
                Vector2 center = Vector2(mCenter.x,mCenter.z);
                Vector2 corner;
@@ -137,4 +137,4 @@


        }
-}
\ No newline at end of file
+}
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

You must have your warnings set as errors because a lot of those should compile without a hitch. Either way, there are some quality-control things in there that might as well go in, so I'll get all that taken care of today. (Although, what on earth is an 'unsigned size_t' ? size_t is "unsigned int" for me)

Thanks for the input :D
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

Yup I corrected some of the warnings, too (you wouldn't even believe what gcc finds with full warning on) but they are all optional. The only relevant stuff are the const fixes.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

We're going with Vimeo for our movie today:
http://www.vimeo.com/1296948

Just showing that I can, in fact, use scattering and light-mapping on the models in the scene. Unfortunately, (and I should have realized this earlier) you need to build the scattering into the shader of the object - adding an extra pass doesn't work when the first one(s) are fixed-function and the last one is a shader; there apparently is just enough precision error to cause it to flicker.

Anyways, I added more editor functionality, so you'll be able to edit your terrain shader parameters at run-time per-scheme.

I'll update SVN a little later today (with aguru's suggested fixes in tow).
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Post by DanielSefton »

Doh. For some reason my frame listener update didn't work - so I had to move it into my main loop. The sky and clamping works a treat again. :)

But.. The first error still occurs. I can't use createLightmapper without the assertion failed error. I'll investigate further tomorrow. It's probably something simple, but a real pain to track down.

Great work with the updates! -- You should have used Vimeo before, it's much better. ;)
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Ya, if you can send me the Ogre.log and the stack trace, I can probably find the source of the problem at the very least.
User avatar
Nicki
Gnoblar
Posts: 8
Joined: Sat Jun 07, 2008 8:06 pm
Location: Germany

Post by Nicki »

hello HexiDave ..

where can i get the code from this video ??

http://www.vimeo.com/1296948

im realy interrested for this
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

Nicki, it's available through the addons svn:

https://ogreaddons.svn.sourceforge.net/ ... rain/trunk

[edit] If you were referring specifically to the newly added stuff, I'm afraid its not in svn yet (rev 2471).
Last edited by aguru on Tue Jul 08, 2008 5:01 pm, edited 1 time in total.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

That code isn't up just yet, will be shortly.

Update: Getting some rest now; will finish the updates tomorrow.
The only thing I really need to do for the update is flesh out the validation code, so it won't explode if something is missing. I'm also working on some general purpose shaders that'll pretend to be like the fixed-function pipeline (so you'll be able to quickly plug the shaders into your own materials and feed them into SPT - I've been wanting to make Fixed-Function fake shaders for a while).

I also spent time on OgrePlanet today and got some major work done - feels good to get that back on track!

To wit, I've got the following coming for SPT's editor functionality:

- 3D brushes so you can edit the terrain
- Texture/splatting editing
- Add SPT to a Windows Form to do editing (need to test portability on that - I've read you can use Windows Forms on other OSs, but haven't tried it yet)
- Re-build the atmosphere shader as a replacement option to the skybox system.
- Finish work on the Libnoise editor so you can build terrains that way as well.

There's more (isn't there always?), but I'm kind of torn between half a dozen projects right now, so I'm trying to keep them all balanced.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Arg, minor set-back today. I was trying to create an automated system to feed shader compile arguments to the terrain, but there doesn't seem to be a way to feed the arguments and then re-compile without losing all those changes =/ I had to inherit from a few things to even get to that point (I was actually feeding it parameters correctly, but they weren't being used after that point), but the only other option would be to include all the renderers and inherit from them inside SPT's code, but that's stupid, so I'm skipping it. I'll have to make more general purpose materials now.

Anyways, just updated SVN with the first test to add skybox/lightmap textures to the objects' materials.


I REALLY need to find a way to push compile parameters to shaders at run-time as I need to push a lot of stuff down the pipeline to tell the shader how to behave and there'd be a LOT of wasted space if I don't have #defines and such.
User avatar
DanielSefton
Ogre Magi
Posts: 1235
Joined: Fri Oct 26, 2007 12:36 am
Location: Mountain View, CA
x 10

Post by DanielSefton »

Just to confirm, is SPT::SceneObject a complete replacement/alternitive for placing objects, rather than SceneManager->createEntity? Also, there seems to be hickups when referring to the objects in functions that would normally call entity meshes e.g. for physics.

What do you recommend for large scenes with SPT? How would I go about it? For example, I could generate a heightmap, build objects around that heightmap in a 3D package, then export the objects. Could I use DotScene? Or would you need to create a special format for importing masses of models compatible with SPT? Or would you have to do it all manually in the editor you are developing? (Which would be perfectly fine depending on the amount of control).

P.S. As for the error I got earlier, I'm having great trouble getting the libraries to load the symbols for the stack trace. (Suddenly stopped working a few days ago.) So it's almost impossible to track it down. Once I've sorted that out, I'll take it from there.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

SceneObject was just mostly there for testing purposes, but it turned into a utility for people that just want ray-casting for their object placement. You can actually create a SceneObject by passing it an existing MovableObject as well, but the SceneObject stuff isn't directly tied to SPT (it's just an "extra" feature).

Not sure what that second part means about hickups - could you explain a bit more?


I haven't really messed with DotScene much, but if you get me an example file from it, I can probably build something that works with it until I get my editor done.


Really wish I could help you with that error. If you send me relevant code and the Ogre.log file, I can try to re-create the issue.
User avatar
denreaper
Greenskin
Posts: 105
Joined: Wed May 31, 2006 10:52 pm

Post by denreaper »

Do you plan on adding the ability to export terrain to a heightmap in the future? (I assume so since you talk of adding other editor-style features) If so do you have an ETA? Not trying to be pushy, just wondering since we're about to begin working on an editor focused around SPT2 soon in my project (we were going to use ETM to build the editor but if you're planning on adding the needed features, that kills two birds with one stone). :)
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

I'm going to start building the SPT editor Monday, actually - just getting some OgrePlanet work going (GeoMorphing, normals, noise integration, full-globe - full-scale planet, and Z-Buffer precision control done!) while I had the energy to get past the stupid bits.

I finished building my OgreWindow UserControl in Managed C++ today, so I'm ready to push SPT into it without any problems.

And, yes, height-map export is definitely planned (as well as my noise editor):
Image

That was my crash-course into .NET and I'm pretty damn happy with it. I'll be releasing the code for that (and the .NET companion module that I put together - I added the "Fast Noise" implementation Yseneya wrote about over on GameDev.net, so it's lightning fast) along with the editor.
User avatar
leonardoaraujo.santos
Greenskin
Posts: 141
Joined: Fri Apr 27, 2007 6:00 pm
Location: Brazil

Post by leonardoaraujo.santos »

How! Very nice!
User avatar
denreaper
Greenskin
Posts: 105
Joined: Wed May 31, 2006 10:52 pm

Post by denreaper »

Will these editor features be available in the library code or only in the editor?

P.S. Insanely amazing work on SPT2!!! It's just really well done.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

All that noise editor stuff is stand-alone - it's in it's own UserControl so I can flip between the editor windows. The in-game terrain editor (i.e. brush type work) will have commands in the library (such as setBrush("Image", val1,val2, etc); ) and then the options will be available through the editor window, so you'll have the ease of use available from either setup.

Honestly, I don't think it'll take a very long time. I've done texture editing in the past, so a full-blown editor shouldn't take me very long. I'll be surprised if I don't have a demo ready by the end of next week.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Alright, I uploaded to Vimeo, but it's going to take another hour and a half for the queue to loosen up, so Viddler it is for today:
http://www.viddler.com/explore/HexiDave/videos/9/

Brush editing for geometry works! Those were just a couple of 8-bit grayscale PNGs I made real quick in GIMP and presto! All you need to do is feed it a file name, an Ogre::Image or a set of float's and it's good to go.

I spent most of today failing at basic math, but now that that's out of the way, I can finish cleaning up my UserControl for rendering Ogre in .NET and I'm good to go. Tomorrow I should have some basic integration testing going and maybe I'll get the material editor working (nothing fancy) and a height-map exporter. If that goes well, I should be able to get texture editing rolling and you'll be able to build the whole system from scratch in the editor (splat maps, height-maps, materials all in one rig).

Edit: Oh, also, I did some updates to the way the deformation system works on the height-map it's fed, so now it only works on the pixels included in the defined area instead of running through the entire height-map and passing ones it didn't need. Got quite a good speed boost out of that.



A quick plea to you Mac and Linux people: if you're not busy near the end of the week, would you be willing to help me test SPT on your OS? My Ubuntu copy is fried (still scratching my head over that), so I need to see if Mono and such will run the SPT editor on non-Windows platforms. If you're willing to help, post here or PM me with the best way to get in touch.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16

Post by KungFooMasta »

wow, looks good! I'm not a fan of the fog, but I guess there is no other way when you have limitless amounts of terrain, right? How would this work with a physics lib, in terms of heightmaps and creating a terrain shape? (sorry if this has been asked before)
Creator of QuickGUI!
User avatar
leonardoaraujo.santos
Greenskin
Posts: 141
Joined: Fri Apr 27, 2007 6:00 pm
Location: Brazil

Post by leonardoaraujo.santos »

Very nice man! HexiDave do you think that would be dificult to make SPT2 a scenemanager plugin like ETM or PLSM?

I'm studing ogre and would be glad to help and learn about scenemanagers and SPT2.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

KungFooMasta wrote:wow, looks good! I'm not a fan of the fog, but I guess there is no other way when you have limitless amounts of terrain, right? How would this work with a physics lib, in terms of heightmaps and creating a terrain shape? (sorry if this has been asked before)
It's on my list of things to test, but while you could constantly destroy and re-build physics data during editing (since it updates the height-map and then specific geometry and has a listener callback for it), you'd most likely just re-build the physics data AFTER you're done editing. The listener callback gives you access to geometry data, so it shouldn't be too hard. You're also not re-building the entire terrain each frame, just specific patches (and the base height-map).


As for the fog, that's just one setting for the atmospheric scattering that builds a skybox to work with. There are plenty of other ways to do it, but that's the one I stuck with for now since it's fast (only calculates it when you need to update the sky and then builds a cube-map out of it) and doesn't have much impact on the shaders. I'll be getting it to work with external sources of data like Caelum this week.

leonardoaraujo.santos wrote:Very nice man! HexiDave do you think that would be dificult to make SPT2 a scenemanager plugin like ETM or PLSM?

I'm studing ogre and would be glad to help and learn about scenemanagers and SPT2.

Well, I have somethings that might need SceneManager work eventually (like EarlyZ and extra culling mechanisms later), it works with the core SceneManager and, when I have time, PCZSceneManager. It just handles geometry data on it's own and feeds it to Ogre as Renderables.