Thank you guys for all your kind words! I really appreciate it.
Crystal Hammer wrote:If I had more time I would try compiling. I'm guessing there will be a lot of trouble to upgrade to Ogre 1.8, if there wasn't you had done some update to newer Ogre before, am I right ?
This project has been collecting dust for four years (I won't go into it, but I've recently been given the rights to do whatever I want with it). When I coded it, Ogre 1.4.6 was the latest version. However, I did some hacking last year for a different project and was able to reuse the custom terrain render code with Ogre 1.7 without too much difficulty. The only really tricky hurdle was finding out that Ogre 1.7's interface for setting shader constants was changed semantically but still compiled fine without any warnings. But once that was out of the way, it was pretty easy. I have no idea if that would be true for 1.8 as well, and I never tried upgrading the (at least as complicated) terrain texture editing section of Scape. But anyway, the point here is that the lack of upgrades is not the result of porting difficulties already encountered.
dark_sylinc wrote:One question: When importing, I can't choose the scale of the terrain (width & depth + height). Is this not possible? Do I have to code that on my own? (don't worry about me for that, I can do it)
What is the current scale? 1 pixel = 1 Ogre unit? And for height? For example 16-bit images... 0 means -1000? what's the scale?
That's right I'm afraid. However, if you're able to compile Scape yourself, you can easilty change the hardcoded values: Update 'getHeightfieldBufferSetManager()->create(_T("Project"), 4096, 4096, 0, 500, 512, 512);' in Engine/EngineCore/EngineCore.cpp to change the number of samples in both directions, and the min&max height value. So currently, a 4Kx4K map between heights 0 and 500 is always created (even though the actual heightfield values are always between the min and max of the internal heightfield representation format, so 0 and 65535, for example). And indeed, one pixel/sample is one unit. In theory you can change this by changing mWorldQuadSize in HeightfieldGeom.cpp, but currently the camera and brush radius rendering/editing don't compensate correctly for values other than 1.0, so I wouldn't recommend changing/exposing that right now. Also, as the editor is currently a standalone app, only the relative width/height ratio really matters anyway. Btw, a more hacky way to achieve the same without having to recompile would involve changing Bin\Materials\Programs\HeightfieldShaderCg.cg. For example, changing the line 'oPosition = mul(worldViewProj, localPosition);' to oPosition = mul(worldViewProj, localPosition * float4(1,10,1,1));' would scale the height's range by a factor of 10.
As a side note, it's also possible to change the internal representation of heightfield samples from 16-bit integers to 32-bit floats: Change the PF_SHORT_L in heightfieldBufferSet->create(_T("Render"), Ogre::PF_SHORT_L); in EngineCore.cpp to PF_FLOAT32_R, and select a different packer in the brush shaders: Open Bin\Materials\Programs\pack.cgh, change '#define PACK_IN 565' and '#define PACK_OUT 565' to '#define PACK_IN 32' and '#define PACK_OUT 32'. Lastly, change the '#else if ......' to '#elif .....' in the same cgh file to fix an issue that would otherwise still make it choose the wrong 'branch' (I'll fix that last part in the next release). Ideally, this would all be possible to do through the UI, but I had to finish my thesis at some point...
Crystal Hammer wrote:Unfortunatelly for me exe crashes at start, looks liks some dll depencency problems.
Thanks, dark_sylinc, for your excellent pointers. I hope they already fixed the problem. The Scape 0.1.0 binary was built using VC2005, so use
this to install the studio redistib package. Scape comes with the original Direct3D9_Rendersystem.dll from the pre-built Eihort 1.4.6 SDK, and i think that was compiled against the DirectX 2004 SDK using dll version 33, or something. The
DX9 webinstaller sounds like a good idea to check.
If Scape stil crashes, try to see if you can get some info from Bin/Scape.log (which is generated a.s.a.p. at startup) or run
DebugView to see the log in real-time.
Again, thanks for all the feedback!