Single page + way more complicated than I expected

praetor

20-11-2005 18:13:36

Recently started going over terrain stuff, and chose PLSM since the normal one doesn't have very good lighting. Anyway, been at it for 2+ days and nothing. Not a thing on the screen. I have my heightmap, and this is turning out to be much harder than I thought. I was hoping someone had a tutorial written like a tutorial. The articles on the wiki now are written like references (config and what it does, no more) with no real tutorials. Or maybe a specific question from me can get me going and I'll take care of the rest.

If I have a single page, do I still have to run it through MapSplitter? What do I have to do above and beyond terrainscenemanager to get it to work? Not sure how much narrower I can get this question. I hope it's all just config work. The heightmap is 16-bit raw from terragen, 257x257.

praetor

20-11-2005 21:42:57

Just to help here's my latest attempt at the runtime plsm config


GroupName=General
demo=demo_terrain
DefaultMap=demo
paged=no

Data2DFormat=HeightFieldRaw
LandScapeFileName=demo_terrain
LandScapeExtension=raw

TextureMode=Image
TextureExtension=jpg
ImageFilename=dirt01


ScaleX=1000
ScaleY=100
ScaleZ=1000
PageSize=257
TileSize=65

Width=1
Height=1
MaxAdjacentPages=1
MaxPreloadedPages=3

MaxPixelError=10
VertexNormals=yes
VertexCompression=yes
HorizonVisibilityComputing=yes


Must be missing something. Seems to have to do with texturing, or the material in general. The crash happens on load when the app tries to mMaterial->load. mMaterial seems not be initialized before this. Seems I can't just load a heightfield with nothing else and see how it all goes, but I'm messing up some material configs somewhere. Can't see it, though.

tuan kuranes

21-11-2005 07:39:57

you have to run mapsplitter to get correct naming.

in your case here's the demo_terrain.gen.cfg that mapsplitter needs.

GroupName=General
LandScapeFileName=demo_terrain
LandScapeExtension=raw
RawWidth=257
RawHeight=257
OutDirectory=../../../../Samples/Media/paginglandscape2/terrains/LandScapeFileName

HeightMap=yes


as you don't seems to provide maps (if yes you have to split it too.)
you can also make mapsplitter generates for you.
adding this to the demo_terrain.gen.cfg:

BaseMap=yes
CoverageMap=yes
AlphaMaps=yes

NumMatHeightSplat=5

MaterialHeight1=12
MaterialHeight2=35
MaterialHeight3=80
MaterialHeight4=100

AvgColorsExists=yes

#Sand
MaterialColor0.r=0.0f
MaterialColor0.g=0.0f
MaterialColor0.b=1.0f
#Grass
MaterialColor1.r=0.145f
MaterialColor1.g=0.624f
MaterialColor1.b=0.0f
#Rock
MaterialColor2.r=0.411764f
MaterialColor2.g=0.811764f
MaterialColor2.b=0.811764f
#Rock
MaterialColor3.r=0.411764f
MaterialColor3.g=0.811764f
MaterialColor3.b=0.811764f
#Snow
MaterialColor4.r=1.0f
MaterialColor4.g=0.0f
MaterialColor4.b=0.0f

praetor

21-11-2005 17:43:00

Alright I was afraid I'd need to run it through mapsplitter first. Oh well, I'll get to that some time thanks. Does that second part mean that you must have some sort of texturing on the terrain or it won't work?

tuan kuranes

21-11-2005 19:18:29

it may work. but be being blank.

if you want to use dynamic texturing (splatting and basetexture mode) you have to provides those anyway but in the .cfg file.

praetor

21-11-2005 21:34:55


-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: Codec::getCodec
Description: Cannot find codec for extension .
File: \Programming\Ogre3D\ogrenew\OgreMain\src\OgreCodec.cpp
Line: 46
Stack unwinding: <<beginning of stack>>
16:15:57: Termination handler: uncaught exception!
16:15:57: *-*-* OGRE Shutdown


That's what I get with this config


GroupName=General
LandScapeFileName=demo_height
LandScapeExtension=raw
TextureStretchFactor=2

RawWidth=257
RawHeight=257

PageSize=257
TileSize=65

OutDirectory=D:\Programs\Odyssey Engine\demo\media\demo

ColorMapName=demo_surface.jpg
ColorMapSplit=yes

Paged=yes
HeightMap=yes


MapSplitter must not be set up properly with the right configs, or plugins or something. If I take out the ColorMap stuff it works. Any ideas? I gotta say I'm very frustrated. The readmes seem to include info on everything but obvious things like: how to set up mapsplitter. And how about the readme referring me to a phantom pglsm2.cfg file. It's nowhere to be found. And what is this Textureformat config? I see it mentioned every now and then in the wiki, but it doesn't appear in any of the sample configs. Is it an actual option or not?

Sorry if my frustration is showing through. I do appreciate the work, and probably will really appreciate once I get it working. I just expected getting terrain displaying to be the "easy" part of the project.

praetor

21-11-2005 21:59:28

Scrap the last part. Figured it out. I'm definitely writing a tutorial for this stuff when I actually am comfortable with it. Now lets see if I can get it to display...

tuan kuranes

22-11-2005 08:49:34

Sorry if documentation is misleading, please point modification to do on readme or make a patch so that It doesn't happen another time.

"pglsm2.cfg" should be paginglanscape2.cfg which has to be in exe folder.

Textureformat is how texture will be applied at runtime. From simple texture to splatting, or dynamic texture creation.

I'm all for a tutorial, even if only for the "simple" case of 1 heightmap + 1 color map.