ryak2002
12-10-2006 07:14:17
I just spent 4 hours trying unsucessfully to debug an "assertion failed" error on trying to load a terrain. The only error message is:
It says the error occurs at ogrepaginglandscapetexture.cpp line 371
Visual Studio says material is being set to null by the following:,
but i have no idea why the Material Manager wouldn't have my texture, as its in a standard ogre folder (materials).
I suspect i've screwed up the terrain file as the format is *extremely* confusing. I'm trying to get 1 page from an existing height map and terrain image which i ran through the mapsplitter.
I'm setting my world geometry to PLSMterrain.cfg.
PLSMterrain.cfg:
mountains.cfg:
assert failed.
message:assert (!material.isNull() && String(mMaterialBaseName + " Must exists in the" + opt->groupName + "group").c_str ());
It says the error occurs at ogrepaginglandscapetexture.cpp line 371
Visual Studio says material is being set to null by the following:,
MaterialPtr material = MaterialManager::getSingleton().getByName (mMaterialBaseName);
but i have no idea why the Material Manager wouldn't have my texture, as its in a standard ogre folder (materials).
I suspect i've screwed up the terrain file as the format is *extremely* confusing. I'm trying to get 1 page from an existing height map and terrain image which i ran through the mapsplitter.
I'm setting my world geometry to PLSMterrain.cfg.
PLSMterrain.cfg:
DefaultMap=Mountains
# declare all maps
Mountains=C:\OgreSDK\media\mountains
# resource group name where to find map definition
GroupName=General
# Try forbidden textureformat combinations
TextureFormatDebug=no
mountains.cfg:
### WARNING
## read Wiki page
##
# resource group name
GroupName=General
#resource either one or other (could also already part of resource "GroupName", so it's optionnal.)
FileSystem=C:\OgreSDK\media\materials\textures
#Zip=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=terrain
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=513
#
# Size of the Heightfield in pixels
#193 is the best spot as its the last power of two size that gives 16bits indexbuffer
TileSize=513
#
# 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=100
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
#Data2DFormat=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
#
## scale factor bettween pagesize and textursize
TextureStretchFactor=1
#
#
#
# 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 => Base.
#
#(pregenerated maps needed)
# Deformable splatting => splatting5 (need shaders)
# Deformable Coloring => instantBase.
#
#(pregenerated maps only)
# splatting => splatting2, (needs DX9) splatting3 (opengl)
# Coloring => Base2
# Image => Image (generated by any terrain texture generator terragen, T2, etc)
#
#
#
#DX = Base, Base2, InstantBase, Splatting, Splatting2, Splatting4, Splatting6, Splatting7
#GL = Base, Base2, InstantBase, Splatting3
#Both = Base, Base2, InstantBase,
# shaders : Splatting5 SplattingShader InstantBaseShadowed
#
NumTextureFormatSupported=19
TextureFormatSupported0=ImagePaging
TextureFormatSupported1=Base
TextureFormatSupported2=Base2
TextureFormatSupported3=InstantBase
TextureFormatSupported4=Splatting
TextureFormatSupported5=Splatting2
TextureFormatSupported6=Splatting4
TextureFormatSupported7=Splatting6
TextureFormatSupported8=Splatting7
TextureFormatSupported9=Base
TextureFormatSupported10=Base2
TextureFormatSupported11=InstantBase
TextureFormatSupported12=Splatting3
TextureFormatSupported13=Splatting5
TextureFormatSupported14=SplattingShader
TextureFormatSupported18=InstantBaseShadowed
# the one selected
TextureFormat=Image
ImageFilename=terrain
TextureExtension=jpg
#BigImage=yes
## realtime splatting
#TextureFormat=Base
## (need to generate maps with mapsplitter)
#TextureFormat=InstantBase
# Same but keep a copy in main memory (allow RT blending/editing)
#TextureFormat=InstantBaseEdit
#TextureFormat=InstantBaseShadowed
# Shader Splatting
# Needs pixel shader
#TextureFormat=Splatting5
#TextureFormat=SplattingShader
#need DIRECTX
#TextureFormat=Splatting
## precalc static splatting
## (need to generate maps with mapsplitter)
#TextureFormat=Base2
#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 (instantBase, splatting5)
NumMatHeightSplat=4
MaterialHeight0=0
MaterialHeight1=12
MaterialHeight2=60
MaterialHeight3=75
#needs to be in Search Path directory (resources.cfg)
SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.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