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:
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:
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.
### 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.