[SOLVED] Colors showing up instead of grass, rock..

davesh

21-11-2006 18:20:12

I'm using the CVS version of PLSM2.

I'm able to load my map, but I cant seem to get the grass, rock, and snow showing. A bunch of colors show up instead.

What I see is as follows:



The configuration file that I'm using is as follows:




GroupName=PLSM2

LandScapeFileName=my_landscape
FileSystem=LandScapeFileName

Width=4
Height=2


Data2DFormat=HeightField

ScaleX=9000
ScaleY=9000
ScaleZ=9000


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=InstantBase
TextureStretchFactor=2
VertexNormals=no

NumMatHeightSplat=4

MaterialHeight0=0
MaterialHeight1=1500
MaterialHeight2=2050
MaterialHeight3=9000
#MaterialHeight4=9000

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=-396.0f
BaseCameraViewpoint.y=31000.0f
BaseCameraViewpoint.z=2640.0f

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


I am using the splatting script and texture files that came in the materials folder that with the PLSM2 distribution.

What am I doing wrong?

davesh

22-11-2006 15:57:16

Ok.... I figured out why its in color... The base image file that came out of the map splitter is in color (not greyscale).

This is one of the base image files:


This is my .gen.cfg file


GroupName=PLSM2

LandScapeFileName=MyTerrain
LandScapeExtension=png
RawWidth=1559
RawHeight=1008

## 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=yes
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

MaterialHeight1=0
MaterialHeight2=7
MaterialHeight3=15

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




I've only just learned how to run the mapsplitter. What option should I put into the .gen.cfg file in order to have mapsplitter create a greyscale heightmap that will allow my "grass, sand, rock, and snow splatting" to work?

davesh

22-11-2006 16:21:42

Ok. I am starting to figure this stuff out. I thought that the splatting would happen dynamically within my application. I've been using the following option within the application:


TextureFormat=InstantBase


According to the template.default.cfg file that comes with the PLSM2 InstantBase relies on precalculated base maps (pre-calculated using the mapsplitter). The reason that I was getting colors that I did not expect is that I was using the following parameters in my .gen.cfg file

MaterialHeight1=0
MaterialHeight2=7
MaterialHeight3=15


Once I changed these to

MaterialHeight1=0
MaterialHeight2=50
MaterialHeight3=100


then I got an image that made more sense. Interestingly mapsplitter will arbitrarily "fill in the gaps with a rainbow of colors" as opposed to simply using the highest MaterialHeight specified (e.g. MaterialHeight3 in the above).

I'm comfortable now with what I'm seeing though I do have one more question. As I tried to debug this I tried the following option (in my application):

TextureFormat=Base


According to the template.default.cfg this should have resulted in "realtime splatting". In other words I would have thought that the PLSM2 plugin would have done the splatting in real-time (as opposed to relying on a precalculated base image). Why didnt this work? What option should I use if I want realtime splatting of the "grass, sand, rock, snow"?

tuan kuranes

29-11-2006 15:05:54

TextureFormat=Base
According to the template.default.cfg this should have resulted in "realtime splatting". In other words I would have thought that the PLSM2 plugin would have done the splatting in real-time (as opposed to relying on a precalculated base image).

Should have work, but creating Base image realtime.
(check if you allowed that material in your terrain config file material list )

Why didnt this work? What option should I use if I want realtime splatting of the "grass, sand, rock, snow"?
TextureFormat=Splatting

davesh

30-11-2006 01:20:42


Should have work, but creating Base image realtime.
(check if you allowed that material in your terrain config file material list )

Not sure what you mean... How must I "allow that material in my terrain config file material list"? If you simply mean that I have to have the appropriate grass material listed in a material resource file... I will check this. What should the grass, sand, rock, and snow materials be called?


TextureFormat=Splatting


So will both TextureFormat=Splatting and TextureFormat=InstantBase provide for the real-time splatting?

tuan kuranes

30-11-2006 08:59:48

in the terrain config file you have to list texturemode supported by your terrain (mainly to know if you mapsplitted necessary texture for those texturemode, ie : splattingshader needs coverages files.)

So will both TextureFormat=Splatting and TextureFormat=InstantBase provide for the real-time splatting?
"Base" texturemode are not splatting, just color for heights.
"Splatting" is splatting...

davesh

01-12-2006 00:50:25

Thats clear. Thanks.