Lots of issues

penneydude

25-05-2006 06:42:43

So, I've been trying to implement PLSM2 in a project, and I've had little to no luck because I can't find any real documentation on it, and I've been getting error, after error, after error when I try to do anything. Right now, I've created a new scenemanager in my .cpp file, and defined it as ST_EXTERIOR_REAL_FAR. That works fine. The only other line relating to terrain is a setWorldGeometry("heightmap.cfg"). This is my terrain.cfg file:

### WARNING
## read Wiki page
##
# resource group name
GroupName=Terrains

DefaultMap=heightmap

#resource either one or other (could also already part of resource "GroupName", so it's optionnal.)
#FileSystem=../../../Media/paginglandscape2/terrains/TsmTerrain
#Zip=../../../Media/paginglandscape2/terrains/TsmTerrain.zip

##
##

################## HeightMap OPTIONS.


#
# Before using the paginglandscape2 plugins,
# you'll have to split your big heightmap file into pages.
# Use the Mapsplitter tool for that

# Base file name for the landscape heightfield data
# The file name MUST be LandScapeFileName.x.z.LandScapeExtension (ex: landscape.0.0.png)
# and MUST be squared.
LandScapeFileName=heightmap
LandScapeExtension=png


# Height and Width of the landscape in number of pages
Width=1
Height=1

#
# Size of the Heightfiled in pixels (must be (power of 2) + 1)
PageSize=257
#
# Size of the Heightfield in pixels
#193 is the best spot as its the last power of two size that gives 16bits indexbuffer
TileSize=257

#
# Especialized 2D data loader.
# Currently the only available loaders are 'HeightField', 'HeightFieldTC' and 'SplineField'.
#

# 8bits, grayscale images. (png, jpg, etc) or 16 bits (raw)
#Data2DFormat=HeightField
# 32bits, RGBA images. (png, jpg, etc) RGB is normal information, in alpha we store heightmap
#Data2DFormat=HeightFieldN

#
# The HeightField TC is a compresed format and need to know the value range from where the
# heightfield file was compressed
#MaxValue=300
#MinValue=0
# # 8bits, grayscale images. (png, jpg, etc) or 16 bits (raw)
Data2DFormat=HeightFieldTC
# 32bits, RGBA images. (png, jpg, etc) RGB is normal information, in alpha we store heightmap
#Data2DFormat=HeightFieldNTC

#experimental spline terrain
#ata2DFormat=SplineField


#
# Scale values
# Beware that scaling is pagesize and heighmap definition range indepedant.
ScaleX=90000
ScaleY=15000
ScaleZ=90000

# if Deformation is no use for you, you can gain fps by saying no here.
Deformable=yes
# VRAM saves. need instant base texture and vertex shader support
# "vertex displacment mapping"
VertexCompression=yes

# Use vertex program to morph LODs, if available
VertexProgramMorph=yes
# The proportional distance range at which the LOD morph starts to take effect
# This is as a proportion of the distance between the current LODs effective range,
# and the effective range of the next lower LOD
LODMorphStart=0.2

# The maximum error allowed when determining which LOD to use
MaxPixelError=3

################## LIGHTING OPTIONS.
# For better looking deformed texture (instantbase)
# for shader (needed to get slope)
# could be automatic ?
VertexNormals=no
#
# For lighting
VertexLit=no


############### TEXTURING OPTIONS
#
TextureExtension=png
## scale factor bettween pagesize and textursize
TextureStretchFactor=2
#
#
#
# Especialized texture loader.
#
#(no pregenerated maps needed)
# Real-time (no pregenerated maps needed) splatting => splatting (needs DX9) and splatting5 (need shaders)
# Real-time (no pregenerated maps needed)Coloring => basetexture.
#
#(pregenerated maps needed)
# Deformable splatting => splatting5 (need shaders)
# Deformable Coloring => instantbasetexture.
#
#(pregenerated maps only)
# splatting => splatting2, (needs DX9) splatting3 (opengl)
# Coloring => basetexture2
# Image => Image (generated by any terrain texture generator terragen, T2, etc)
#
#
#
#DX = BaseTexture, BaseTexture2, InstantBaseTexture, Splatting, Splatting2, Splatting4, Splatting6, Splatting7
#GL = BaseTexture, BaseTexture2, InstantBaseTexture, Splatting3
#Both = BaseTexture, BaseTexture2, InstantBaseTexture,
# shaders : Splatting5 SplattingShader InstantBaseTextureShadowed
#

NumTextureFormatSupported=19

TextureFormatSupported0=Image
TextureFormatSupported1=BaseTexture
TextureFormatSupported2=BaseTexture2
TextureFormatSupported3=InstantBaseTexture
TextureFormatSupported4=InstantBaseTextureEdit
TextureFormatSupported5=Splatting
TextureFormatSupported6=Splatting2
TextureFormatSupported7=Splatting2Edit
TextureFormatSupported8=Splatting4
TextureFormatSupported9=Splatting6
TextureFormatSupported10=Splatting7
TextureFormatSupported11=Splatting7Edit
TextureFormatSupported12=BaseTexture
TextureFormatSupported13=BaseTexture2
TextureFormatSupported14=InstantBaseTexture
TextureFormatSupported15=Splatting3
TextureFormatSupported16=Splatting5
TextureFormatSupported17=SplattingShader
TextureFormatSupported18=InstantBaseTextureShadowed

# the one selected
#TextureFormat=Image
#ImageFilename=heightmap
#BigImage=yes

## realtime splatting
#TextureFormat=BaseTexture
## (need to generate maps with mapsplitter)
TextureFormat=InstantBaseTexture
# Same but keep a copy in main memory (allow RT blending/editing)
#TextureFormat=InstantBaseTextureEdit
#TextureFormat=InstantBaseTextureShadowed

# Shader Splatting
# Needs pixel shader
TextureFormat=Splatting5
#TextureFormat=SplattingShader

#need DIRECTX
#TextureFormat=Splatting

## precalc static splatting
## (need to generate maps with mapsplitter)
#TextureFormat=BaseTexture2

#TextureFormat=Splatting2
# Same but keep a copy in main memory (allow RT blending/editing)
#TextureFormat=Splatting2Edit

#TextureFormat=Splatting7
# Same but keep a copy in main memory (allow RT blending/editing)
#TextureFormat=Splatting7Edit

### Experimentals splatting techniques
#TextureFormat=Splatting4

### Experimentals splatting techniques
#need OPENGL
TextureFormat=Splatting3
#need DIRECTX
#TextureFormat=Splatting4

#
# For splatting3 and perhaps a pass less in splatting2 and splatting4
VertexColors=no
# For splatting3
CoverageVertexColor=no
# Forsplatting4
BaseVertexColor=no
#
BaseVertexShadow=no
#
BaseVertexInstantColor=no
#
# Splatting
# We are allowing 4 textures to build the terrain texture
# MaterialHeight to change alpha weights ( using percentages )
# for Real-time textureformat and deformable (instantbasetexture, splatting5)
NumMatHeightSplat=2
MaterialHeight0=0
MaterialHeight1=12


#needs to be in Search Path directory (resources.cfg)
SplatFilename0=dirt.png
SplatFilename1=grass.png



################## PERFORMANCES OPTIONS.
#
#
#
# Visible renderables
# This is the number of visible renderables from the current camera position
# to the border of the visible terrain. (The radius of renderables)
VisibleRenderables=200
#

# LOD : LEVEL OF DETAIL

#
# Distance LOD
# This is the number of renderables in the higher LOD.
#
DistanceLOD=5
#
# if not set, it's precomputed to the max possible at this TileSize.
# Must be (2^MaxRendervel < TileSize)
MaxRenderLevel=5
#
#
# FPS Processing limit
# number of renderables loading in a single frame (if needed)
NumRenderablesLoading=50


#
# WINDOWING AROUND CAMERA
#
# Num of adjacent loaded landscape pages.
MaxAdjacentPages=2
#

# Num of adjacent preloaded landscape pages.
# Must be bigger than MaxAdjacentPages + 1, the textures are loaded in a separate thread.
MaxPreloadedPages=3
#
#

# Pages Load Factor
# Pages will be load/unload when they are about PageSize^2 * ChangeFactor
ChangeFactor=1.5
#
#

# Camera Threshold
# If the last camera position minus current camera position is >= CameraTheshold
# then the scene is trasverse to check LOD.
CameraThreshold=5

#
# Memory Pool Initial Usage Values (pre-allocated renderables and tiles.)
# use debug mode to check your needs.
# At max should be near MaxPreloadedPages*(pagesize/tilesize)*(pagesize/tilesize)
#
MaxNumRenderables=256
IncrementRenderables=256
MaxNumTiles=256
IncrementTiles=256

# Horizon Visibility computing:
# enable it if your map have moutains, cliff... not if it's mainly plane.
# everything hidden will not be send to GPU saving framerates.
HorizonVisibilityComputing=yes

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

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


As I'm sure you could tell, I'm just using a slightly modified version of the template one. But, when I try to run my program I get one of a number of assertion failures, depending on which texture format I define. RIght now the one I'm trying to use Splatting5, and I get this when I try to run my program, which compiles with no errors:

trial2: OgrePagingLandScapeTexture_BaseTexture2.cpp:83: virtual void Ogre::PagingLandScapeTexture_BaseTexture2::_loadMaterial(): Assertion `!mMaterial.isNull()' failed.
Aborted


So I decided that it was probably a textureformat problem, and decided to maybe try one of the ones that wants various texture trials make with MapSplitter, but I keep getting Segmentation Faults. I've tried setting AlphaMaps to yes, RGBMaps to yes, basically every type of map it can export to yes, and the only one that seems to work is normalmap, but that's not really of any use to me. I can get it to generate a heightmap.o.o.png file, but I get a Senmentation Fault on anything else, and there's no relevant information in any type of log anywhere.

If someone could help me out with this problem, I'd be very, very greatful, because I'm really confused and frustrated by this.

tuan kuranes

25-05-2006 09:05:14

Assertion `!mMaterial.isNull()'

Means you don't have required material defined in your resource group.
If you want to make a "Terrains" group, make sure it contains required resource (material, shader, program and textures)

wants various texture trials make with MapSplitter,
Running mapslitter prior to render terrains with plugin is mandatory.

no relevant information in any type of log anywhere
No mapslitter.log ?
I keep getting Segmentation Faults
SDK, CVS ? Did you tried Debug Mode ?
Can you provide heightmap.gen.cfg and describe heightmap format ?

penneydude

26-05-2006 00:13:51

Hey, thanks for the reply. Here's my mapsplitter.log when I set AlphaMaps to yes:

16:48:23: Creating resource group General
16:48:23: Creating resource group Internal
16:48:23: Creating resource group Autodetect
16:48:23: Registering ResourceManager for type Material
16:48:23: Registering ResourceManager for type Mesh
16:48:23: Registering ResourceManager for type Skeleton
16:48:23: MovableObjectFactory for type 'ParticleSystem' registered.
16:48:23: Loading library libOgrePlatform.so
16:48:23: OverlayElementFactory for type Panel registered.
16:48:23: OverlayElementFactory for type BorderPanel registered.
16:48:23: OverlayElementFactory for type TextArea registered.
16:48:23: Registering ResourceManager for type Font
16:48:23: ArchiveFactory for archive type FileSystem registered.
16:48:23: ArchiveFactory for archive type Zip registered.
16:48:23: DevIL version: Developer's Image Library (DevIL) 1.6.7 Nov 16 2005
16:48:23: DevIL image formats: bmp dib cut dcx dds gif hdr ico cur jpg jpe jpeg lif mdl mng jng pcx pic pix png pbm pgm pnm ppm psd pdd psp pxr sgi bw rgb rgba tga vda icb vst tif tiff wal xpm raw
16:48:23: Registering ResourceManager for type HighLevelGpuProgram
16:48:23: Registering ResourceManager for type Compositor
16:48:23: MovableObjectFactory for type 'Entity' registered.
16:48:23: MovableObjectFactory for type 'Light' registered.
16:48:23: MovableObjectFactory for type 'BillboardSet' registered.
16:48:23: MovableObjectFactory for type 'ManualObject' registered.
16:48:23: MovableObjectFactory for type 'BillboardChain' registered.
16:48:23: MovableObjectFactory for type 'RibbonTrail' registered.
16:48:23: Loading library /usr/local/lib/OGRE/RenderSystem_GL.so
16:48:23: OpenGL Rendering Subsystem created.
16:48:23: Loading library /usr/local/lib/OGRE/Plugin_ParticleFX.so
16:48:23: Particle Emitter Type 'Point' registered
16:48:23: Particle Emitter Type 'Box' registered
16:48:23: Particle Emitter Type 'Ellipsoid' registered
16:48:23: Particle Emitter Type 'Cylinder' registered
16:48:23: Particle Emitter Type 'Ring' registered
16:48:23: Particle Emitter Type 'HollowEllipsoid' registered
16:48:23: Particle Affector Type 'LinearForce' registered
16:48:23: Particle Affector Type 'ColourFader' registered
16:48:23: Particle Affector Type 'ColourFader2' registered
16:48:23: Particle Affector Type 'ColourImage' registered
16:48:23: Particle Affector Type 'ColourInterpolator' registered
16:48:23: Particle Affector Type 'Scaler' registered
16:48:23: Particle Affector Type 'Rotator' registered
16:48:24: Particle Affector Type 'DirectionRandomiser' registered
16:48:24: Particle Affector Type 'DeflectorPlane' registered
16:48:24: Loading library /usr/local/lib/OGRE/Plugin_BSPSceneManager.so
16:48:24: Registering ResourceManager for type BspLevel
16:48:24: Loading library /usr/local/lib/OGRE/Plugin_OctreeSceneManager.so
16:48:24: Loading library /usr/local/lib/OGRE/Plugin_CgProgramManager.so
16:48:24: Loading library /usr/local/lib/OGRE/Plugin_PagingLandScape2
16:48:24: *-*-* OGRE Initialising
16:48:24: *-*-* Version 1.3.0 (Eihort)
16:48:24: Added resource location '.' of type 'FileSystem' to resource group 'General'
16:48:24: Creating resource group Terrains
16:48:24: Added resource location '.' of type 'FileSystem' to resource group 'Terrains'


In the console after that it says this, which doesn't show up in the log file:

Width : 257 Height : 257 Bypp : 2heightmap.png
normal Map Calc
Segmentation fault


I'm not really sure what you mean when you say that I need materials in my Terrains group. In resources.cfg, Terrains just points to the folder that the executable is in, I don't have any other folders. I thought it would make a it easier for testing purposes, but I'll change it later. Do I need to make a .material file for the terrain to work? And if so, how exactly would I do that if I want to use splatting?

Oh, and here's my heightmap.gen:

### WARNING
## read WIKI page about Mapsplitter config option.
##
## http://www.ogre3d.org/wiki/index.php/Paging_Scene_Manager_config_files#Map_Splitter_Configuration
##
## All default value ae optional. All boolean (yes, no) values are false as default, but "paged"
# resource group name where source files can comes from
GroupName=Terrains

# Base file name for the landscape heightfield data
# The file name MUST be LandScapeFileName.LandScapeExtension (ex: landscape.png)
LandScapeFileName=heightmap

# that's default value no need to precise,
#change the value in your cfg for non-default value
LandScapeExtension=png
#
#

# for textures. (raw is possible but raw texture isn't supported directly for Ogre so it's experimental)
# jpg or anything else ?
## For heightmap only
# that's default value no need to precise,
#change the value in your cfg for non-default value
LandScapeExportExtension=png
## For Texturing heightmap only (all but pure heightmap data.)
# that's default value no need to precise,
#change the value in your cfg for non-default value
TextureExtension=png
## scale factor bettween pagesize and textursize
# that's default value no need to precise,
#change the value in your cfg for non-default value
TextureStretchFactor=1

#
# If you intend to use it with
# Paginglandscape scenemanager Paged=yes
# or with Terrain scenemanager Paged=no
# that's default value no need to precise,
#change the value in your cfg for non-default value
Paged=yes


#
# Scale values
# that's default value no need to precise,
#change the value in your cfg for non-default value
ScaleX=1
ScaleY=1
ScaleZ=1


# Directory where to store files
# absolute or related to maptool directory
# if OutDirectory=LandScapeFileName will use filename of your input data
OutDirectory=/home/penneydude/Desktop



###########
###########
# Options only useful for paging landscape scene manager paged=yes
#
# Size of the Heightfiled in pixels (must be 2^n + 1)
# that's default value no need to precise,
#change the value in your cfg for non-default value
PageSize=257
# that's default value no need to precise,
#change the value in your cfg for non-default value
TileSize=65



# Especialized 2D data loader.
# Currently the only available loaders are
# 'HeightField', 'HeightFieldTC' and 'SplineField'.
# More to come. (For Terrainscene (paged =yes HeightField is used by default)
#

# that's default value no need to precise,
#change the value in your cfg for non-default value
Data2DFormat=HeightField


# The HeightField TC is a compresed format and need to know the value range from where the
# heightfield file was compresed (if it's paged, and Data2DFormat=HeightFieldTC)
#Data2DFormat=HeightFieldTC
#MaxValue=3000
#MinValue=0

# don't work with mapsplitter for now
#Data2DFormat=SplineField


#############COLOR MAP

# Map that user have generated before, using terragen,
#and want to split or to light (Textureformat=Image)
#ColorMapName=ps_texture_1k.png
# Split your color map
#ColorMapSplit=yes
# same but with modulated with light
# that's default value no need to precise,
#change the value in your cfg for non-default value
#LitColorMapSplit=no


#########HEIGTHMAPS
#
# What to generate
# HERE IS WHERE YOU SPECIFY YOUR NEEDS
#
# usual HeightMap (but splitted)
HeightMap=yes
# If you want your map to be infinitizable
# that's default value no need to precise,
#change the value in your cfg for non-default value
InfiniteMap=no

# If you want smooth your heightmap
# that's default value no need to precise,
#change the value in your cfg for non-default value
HeightMapBlurFactor=0.0f
# Make sure heights use the whole range (0-255 or 0-65535)
# that's default value no need to precise,
#change the value in your cfg for non-default value
Equalize=no
# Creates a MiniMap (width=numpageswidth*numtiles and height=numpagesheight*numtiles)
# (as the name don't tell, it's creates a file.small.png image...)
MiniMap=yes
MiniMapWidth=512
MiniMapHeight=512

#########NORMALS
#
# Normal Map
# that's default value no need to precise,
#change the value in your cfg for non-default value
NormalMap=no
# RGB as XYZ normal and Alpha as 8 bits HeightMap (paging scene manager)
# that's default value no need to precise,
#change the value in your cfg for non-default value
HeightNormalMap=no


#
# Map that can be used on not too much scaled terrain or old hardware
# no enough texture units or too slow multipass (Textureformat=Image)
# that's default value no need to precise,
#change the value in your cfg for non-default value
ColorMapGenerated=no
# same but with modulated with light
# that's default value no need to precise,
#change the value in your cfg for non-default value
LitColorMapGenerated=no

#########SPLATTING

#
# Splatting
# We are allowing 4 textures to build the terrain texture
# MaterialHeight to change alpha weights ( using percentage )
MaterialHeight1=12
MaterialHeight2=50

#needs to be in maptool directory
SplatFilename0=dirt.png
SplatFilename1=grass.png

# Base map for big scale maps, used for long distance instead of splatting
# (Textureformat=Base and splattingX)
# that's default value no need to precise,
#change the value in your cfg for non-default value
BaseMap=no
# same but with modulated with light
# that's default value no need to precise,
#change the value in your cfg for non-default value
LitBaseMap=no
#
#### Maps used for splattings
#
# coverage is RGBA, each channel has info for 1 splat
# (Textureformat=splatting3)
# that's default value no need to precise,
#change the value in your cfg for non-default value
CoverageMap=no
#
# generate 1 alpha map per splatting
# (Textureformat=splatting2) When Ogre has support fo PF_A8
# that's default value no need to precise,
#change the value in your cfg for non-default value
AlphaMaps=yes
# same but with black RGB data until Ogre has support fo PF_A8
AlphaSplatRGBAMaps=no
# same but with light in RGB data
# that's default value no need to precise,
#change the value in your cfg for non-default value
AlphaSplatLightMaps=no
#
# generate 1 RGB map per splatting gray level instead of alpha
# (mainly debug, but can be used to get some splatting in GL version one day)
# that's default value no need to precise,
#change the value in your cfg for non-default value
RGBMaps=no


####################LIGHTING

# Shadows on terrains (lightmap is used, shadowmap is mainly for debugging)
# (Textureformat=splatting4)
# that's default value no need to precise,
#change the value in your cfg for non-default value
LightMap=no
# that's default value no need to precise,
#change the value in your cfg for non-default value
ShadowMap=no

Sunx=0.0f
Suny=0.88f
Sunz=0.47f

Ambient=0.5f
Diffuse=0.5f
Blur=0.0f

######## Real-Time LIGHTING

# Horizon Mapping (real-time lightmapping shader with V2 pixel shader)
# LONG TIME COMPUTATION
# that's default value no need to precise,
#change the value in your cfg for non-default value
HorizonMap=no
# map elevation lookup table independant, so generate once and rename according to your materials.

# that's default value no need to precise,
#change the value in your cfg for non-default value
ElevationMap=no

# trick Real-Time mapping : sun is constricted in Z axis. Fastest Horizon mapping possible with and without shaders.

# that's default value no need to precise,
#change the value in your cfg for non-default value
ZHorizon=no


########VISIBILITY
#
# PVS (potential visibility set)
# VERY LONG TIME COMPUTATION
# Will be used to decide if terrain patches are visible or hidden by some hills
# or mountains (not used for now in plugin's code)
# could be used for AI to know if something is visible from a point to another...
# so perhaps a thing that can lies in scenemanagers...
# that's default value no need to precise,
#change the value in your cfg for non-default value
PVSMap=no


My heightmap is just a standard greyscale PNG, 257x257 pixels in size. It worked fine with the terrain scene manager.

Falagard

26-05-2006 00:35:45

Why don't you try setting it up like the instructions in the wiki describe and then play around with moving stuff once it's working instead?

There's a whole bunch of materials, textures etc. in the media/paginglandscape2 and sub folders that are required.

penneydude

26-05-2006 01:23:36

I have looked through the Media folders over and over again, and I just can't seem to figure out what it is I have to do to get this working. I keep getting different errors every time I try to do something. I just tried running the PagingLandscape2 demo, and it says that it can't find paginalandscape2.cfg anywhere in the resources paths, even though it's obviously right there.

Would someone mind telling me all the things that I need to set up a working PLSM2 app? Because I'm obviously missing somehting, and I don't know what.

Falagard

26-05-2006 01:48:09

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=7

penneydude

26-05-2006 01:59:13

I'm not really sure what I'm supposed to look at in that thread. If you want me to change the thread title to make it more descriptive then I'll happily do it. I've read the wiki through numerous times, and searched the forums using as many different search strings as I could think of that relate to my problem. If you linked me to it to tell me which version of PLSM2 I'm using, it's CVS.

To me, the wiki isn't very helpful. Leaning by example is how I prefer to figure things out, but I haven't found any working examples yet, and I've been looking for a few days.

Falagard

26-05-2006 02:01:06

http://www.ogre3d.org/wiki/index.php/Pa ... stallation

Sure it's not completely user friendly, but if you had read the page you'd know where things are expected to be set up, etc.

The key things are to get the plm2 source from ogre addons, copy it into your ogrenew folder which includes materials, etc. which get thrown in the samples\media\paginglandscape2 folder. Download the datasrc.zip from tuan's site, put it in the proper folder as per the instructions, compile everything (plm2 plugin, demo and mapsplitter), copy mapsplitter into the samples\common\bin\debug or release folder (depending upon what you're compiling) and run it, which should split the files from datasrcs zip file into pages. Then run the demo.

Follow the instructions on the wiki.

Pans

26-05-2006 02:21:12

I'm having some very similar problems getting PLSM2 to work, and am also finding the Wikipedia unhelpful so far.

Basically, I don't understand how to use PLSM2's functionality within a project of my own creation. I create a sceneManager of type ST_EXTERIOR_REAL_FAR. This is about as far as my understand goes, so perhaps one of you can help me out. From here, (1) is the only link needed to access PLSM2 merely having the dll inside of the executable? If so, (2) is geometry generated like the ST_GENERIC scenemanager by using a terrain.cfg file? (3) What is the method to create this CFG file, and are there any accompanying files that need to be created/located as well? (4)What sort of references to other files/directories do I need to make inside of the other CFG files?

I'm sure I'm asking for a few pieces of information that are within the Wiki, and probably repeating a little of what has been said already in this thread, but if somebody could take the time to list off all the answers to these right here, I would really appreciate it, and then I could move on to development more important than getting a single sceneManager working :P

Thanks!

Edit: I found this page in the Wiki: http://www.ogre3d.org/wiki/index.php/Cr ... pplication
I think these are basically all the things I need answered in a nutshell, but it's incomplete

Falagard

26-05-2006 02:30:40

The paging landscape scene manager dll plugin must exist in the same directory as the app and be included in the plugins.cfg file. It is dynamically loaded as a plugin the same as all other Ogre plugins. You don't need to link to the paging landscape lib from within your app unless you're calling specific functions on the plm2 scene manager, and chances are that you're not.

You need to create the scene manager how you create other scene managers. Take a look at the code in the demo that comes with the plm2 source.

You call setWorldGeometry(filename); where filename is a cfg file similar to the included paginglandscape2.cfg file that is included with the plm2 source. This file lists some stuff that the scene manager needs to know, including a default terrain to load. Each different terrain has its own terrain cfg file - this file is different than the paginglandscape.cfg file. See the terrains in samples\media\paginglandscape2\terrains for examples.

You can load a specific terrain in your code if you wish by calling
sceneManager->setOption("InsertMap", mapName);
sceneManager->setOption("CurrentMap", mapName);

The paging scene manager relies on certain material scripts, etc. in order to run. They are included in samples\media\paginglandscape2\materials

The resources.cfg should also include paths to those various media folders, as shown in the resources.cfg that is included with the plm2 source. Everything's there people, it shouldn't be that hard. I haven't tried to get plm2 running from scratch from a couple weeks but it isn't as hard as everyone is making it out to be. Follow the directions.

tuan kuranes

26-05-2006 10:32:13

@penneydude
I'm not really sure what you mean when you say that I need materials in my Terrains group. In resources.cfg, Terrains just points to the folder that the executable is in
Terrains should contains all that plsm2 group does contains.

I don't have any other folders.
No media folder ?

I thought it would make a it easier for testing purposes, but I'll change it later.
keep plsm2 and make sure plsm2 is listed in resources.cfg.

Follow exaclty wiki instructions before making custom changes. make them one by one and when one does make it break and you don't understand why, ask.

Mapsplitter problem may be the same : wrong resource group not containing the folder that has that heightmap.png in it.


Do I need to make a .material file for the terrain to work?
you need to make the material used by your texturemode accessible to the plugin, that's the purpose of resource group plsm2.

@Pans:
3) templates config files are in paginglandscape2 folder.
4) Ogre use resource group to specify resources location. you specify that in resources.cfg and then in cfg file you state which resource to use.

the wiki isn't very helpful... Wikipedia unhelpful so far...but it's incomplete
Wiki is a collaborative effort, that can work if poeple reads it, points exaclty where understanding is hard, so that we can answer and edit WIKI accordingly.

penneydude

26-05-2006 20:25:18

Alright, well I followed your advice, and finally got my PLSM2 app working with the Alpes map. I decided to move to the Grand Canyon map, just to see how it looked, and it gave me the null material error again, meaning that I don't have the right .material file for the grand canyon map. Which .material file does the grand canyon map use?

I think its using the Image texture format, so a more broad question would be what kind of .material file does the Image texture format take?

tuan kuranes

30-05-2006 09:12:23

It uses "PagingLandScapeTemplate.material" and some shaders too.

Best is to open the texture mode CPP file you're using and read source code about what it tries to load.