[Solved] Having trouble getting maps to work in demo.

sklug

31-07-2006 05:04:34

Greetings,

This is my first time trying to get PLSM2 to work. I went through all the wiki's, got the demo to build, and I am able to use it to view the included maps. They work just fine. However, I seem to be doing something wrong when generating my own maps. I've tried using Terragen (exporting to Intel 16 bit raw) and also using L3dT, exporting to 16 bit png.

Let me describe what happens. I run the demo specifying my map, and it comes up with just a blue screen. Assuming this is just some problem with the starting camera position, I hit th b key to go into "ground" mode. This gets me to the landscape, however, now whenever I move the mouse around, the entire landscape warps in odd ways, it's very hard to describe, but it's not just rotating the camera', it's actully warping the landscape as well, as if being viewed through some kind of stange lens. This doesn't happen with the provided maps, only the one's I have tried to generate, so I know it's something with the maps themselves.

I've tried a 1024x1024 heightmap with page size of 513. I've also tried a 512x512 heightmap with page-size of 513( one page). I've tried various texture formats, with a big texture, and with splatting. It always seems to come out the same. I know the map splitter is working correctly, as the provided maps are precessed just fine. I created my cfg files using the provided ones as examples.

Has anyone else had ths problem?

Thanks for your help. One day I'd like to learn enough to contribute to these project rather than just ask for help. :)

Steve

tuan kuranes

31-07-2006 13:05:24

All I can think of now is the ATI + Hardware Lod Morph incompatibilities ?
try disabling morphing in you config file and the cfg file.

As it's difficult to understand the problem, a screenshot might help if you can post one.

sklug

31-07-2006 17:01:50

I'm running an nVidia 6800 GT with fairly recent drivers. So it's not an ATI thing. I'm at work, but I'll try to post a screenshot later. I can try to describe the effect. Basically, when you move the mose left and right, instead of rotating the camera, the landscape stretches horizontally when you move the mouse to the right, and contracts again when you move the mouse to the left. Very strange, no? I'll also try disabling morphing, just in case there's some unknown problem on nvidia as well.

Steve

HexiDave

31-07-2006 17:39:58

I've had that - try stretching the terrain more and putting the camera higher. Not exactly sure what causes it.

Buckcherry

31-07-2006 17:45:27

Could you send me the resources stuff you have to get the demo working, please?.

What are you using to compile it?. VC++ 7.1 ?

I am not able to compile and run the demo... :(

I am trying first to get working the Map Editor. Do you have an old version of it?.

tuan kuranes

31-07-2006 17:57:15

Basically, when you move the mose left and right, instead of rotating the camera, the landscape stretches horizontally when you move the mouse to the right, and contracts again when you move the mouse to the left
did you make sure aspectratio is respected ?

myCamera->setAspectRatio(
(Real)myViewport->getActualWidth() / myViewport->getActualHeight()
);

sklug

31-07-2006 19:41:35

This is the demo application, so I'd assume it's setting the aspect ratio, but I can check when I get home this evenning. I have it partially integrated into my own app, but there I was getting nothing, so reverted back to the demo app, where I had the problems described.

HexiDave: What do you mean strecth the landscape more? Do you mean increasing the ScaleX and ScaleZ numbers? Or do you mean texture streching?

BuckCherry: I'm using VC8 to build it. I'm using Dagon (1.2.2) built from source, and using the 1.2.0 compatible source from Tuan's site. I may have had to tweak some paths and config file settings to get it to run, however.

Steve

sklug

01-08-2006 07:27:24

Ok, I played with it a bunch more, and am still having the same problem. I took some screenshots, but without a movie, I'm not sure they're really show what's going on very well. To reiterate:

Run the demo.
Comes up with a blue screen (landscape is not visible).
Hit th 'b' button to bring me to ground level.
Landscape is visible.
Pitch the camera up, things are ok.
Move the camera left and the height of all the landscape features starts to stretch upward to the point of distoring and disappearing if I turn more then say 90 degrees.
Same effect if I move the camear to the right.
I can move forward and backwards and everything looks fine.


I tried disabling VertextProgramMorph. No difference.
I tried messing with the scale values, which affected the features of the landscape but did not get rid of the strange effect.
Raising the camera further above the landscape doesn't seem to make any difference.
I tried various TextureFormats, and noticed that I can't select and shader based ones or I get into an infinte loop (which eventually causes a stack overflow at line 344 of OgrePagingLandScapeTexture.cpp in setOptinos(). I'm not sure exactly what the function is doing, but if you get to the end of the function, it calls setOptions() again, with no apparent exit to the recursion. It may be related to another problem I noticed, where I can't enable vertex compression, as it tries to find materials with Decompress concatenated on the end of the name, and there are no materials named that way (though Decompress is in other parts of some of the names).

All very strange. Any other thoughts? Would it help to post my .cfg and .gen.cfg?

BTW, I'm running the compiled code from Tuan's site http://tuan.kuranes.free.fr/OgreSDK_PLSM2_source.zip

Using the latest dagon (1.2.2), and compiling with VC8.

Steve

sklug

01-08-2006 07:35:36

Hrm.. since I won't have access to these at work, I'll just post em:

Level1Terrain.cfg:

GroupName=PLSM2

LandScapeFileName=Level1
FileSystem=LandScapeFileName

Width=1
Height=1
MaxAdjacentPages=0
PageSize=513

Data2DFormat=HeightField

ScaleX=400
ScaleY=100
ScaleZ=400

NumTextureFormatSupported=17

TextureFormatSupported0=Base
TextureFormatSupported1=Base2
TextureFormatSupported2=InstantBase
TextureFormatSupported3=Splatting
TextureFormatSupported4=Splatting2
TextureFormatSupported5=Splatting4
TextureFormatSupported6=Splatting6
TextureFormatSupported7=Splatting7
TextureFormatSupported8=Base
TextureFormatSupported9=Base2
TextureFormatSupported10=InstantBase
TextureFormatSupported11=Splatting3
TextureFormatSupported12=Splatting5
TextureFormatSupported13=SplattingShader

TextureFormat=SplattingShader
TextureStretchFactor=2
VertexNormals=no
VertexCompression=no
VertexProgramMorph=no

NumMatHeightSplat=4

MaterialHeight0=0
MaterialHeight1=30
MaterialHeight2=70
MaterialHeight3=100

SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.png

#VisibleRenderables=256
MaxRenderLevel=5

# where to put camera on load.
BaseCameraViewpoint.x=0.0f
BaseCameraViewpoint.y=1000.0f
BaseCameraViewpoint.z=0.0f

Baselookat.x=0.0f
Baselookat.y=0.0f
Baselookat.z=0.0f


And Level1Terrain.gen.cfg:

GroupName=PLSM2

LandScapeFileName=Level1
LandScapeExtension=raw
RawWidth=513
RawHeight=513

PageSize=513

## for some reason water is 65035 in SRTM files...
#SRTM_water=yes

TextureStretchFactor=2.0

OutDirectory=LandScapeFileName

HeightMap=yes

BaseMap=yes
CoverageMap=yes
AlphaMaps=yes
LightMap=no
Sunx=0.0f
Suny=0.88f
Sunz=0.47f
Ambient=0.5f
Diffuse=0.5f
Blur=0.0f

MiniMap=yes
MiniMapWidth=64
MiniMapHeight=64

NumMatHeightSplat=4

MaterialHeight0=0
MaterialHeight1=30
MaterialHeight2=70
MaterialHeight3=100

SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.png

tuan kuranes

01-08-2006 20:11:33

it calls setOptions() again, with no apparent exit to the recursion.
That looks like an old version of the plsm2 SDK, try with the newest one, redownload it.
If problem still here, please post at least some screenshots.

sklug

01-08-2006 21:50:47

That same code was in the latest CVS that I pulled down last week. I'm using the source zip from your web-site as it claimed compatibility with Ogre 1.2.x. Should I re-grab the latest CVS as the best source for updated code?

Is the latest CVS always stable?

Steve

sklug

02-08-2006 06:10:40

Ok. I finally figured out what was going on. I'd been placing my viewpoint camera position at x=0, y=(some positive number) z=0.

Apparently with x and z == 0 it causes this wierd warping problem. Moving it to just x=10, z=10, the problem goes away. I guess there's some kind of discontinuity at zero. Oddly, even after moving the camera after starting up with x=0, z=0 doesn't make the problem go away. So it's some kind of startup calculation.

Anyway, thanks for the assistance. Onward into the fog!

Steve

tuan kuranes

02-08-2006 09:32:15


BaseCameraViewpoint.x=0.0f
BaseCameraViewpoint.y=1000.0f
BaseCameraViewpoint.z=0.0f

Baselookat.x=0.0f
Baselookat.y=0.0f
Baselookat.z=0.0f


look at cannot be same point on two axes at where you are... if you change position change lookat or don't provide one.