texture seams trouble

Yellow

23-09-2006 12:19:25

When I use one of the shaders for the terrain textures, I get seams in the textures.

This is a screenshot using the PLSplattingShaderUnlit material.

http://yellow.g0dsoft.com/screenshots/Dwarf-pw.jpg

I tried using the CVS version, but that doesnt seem to solve the problem. The alpha and coverage textures seem to look fine when viewed outside the app.

It looks like another splatting texture is shining through the correct one.

Here are the cfg / gen files I used:

dwarf_terrain.cfg.gen

GroupName=PLSM2

LandScapeFileName=dwarf_terrain
LandScapeExtension=raw
LandScapeExportExtension=raw
Data2DFormat=HeightFieldRaw

RawWidth=1024
RawHeight=1024

TextureStretchFactor=1.0

OutDirectory=../Data/media/maps/LandScapeFileName

Equalize=no

HeightMap=yes
PageSize=257
TileSize=65

BaseMap=yes
CoverageMap=yes
AlphaMaps=yes
HeightNormalMap=no

LightMap=no
Sunx=0.50f
Suny=0.90f
Sunz=0.60f
Ambient=0.3f
Diffuse=0.5f
Blur=0f


NumMatHeightSplat=4
MaterialHeight1=20f
MaterialHeight2=40f
MaterialHeight3=100f


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



dwarf_terrain.cfg

GroupName=PLSM2

LandScapeFileName=dwarf_terrain
LandScapeExtension=raw
FileSystem=../Data/media/maps/LandScapeFileName

Width=4
Height=4

PageSize=257
TileSize=65

Data2DFormat=HeightField


ScaleX=5000
ScaleY=2000
ScaleZ=5000

Deformable=no
VertexCompression=yes
VertexProgramMorph=no
VertexLit=yes
VertexNormals=yes

NumTextureFormatSupported=5

TextureFormatSupported0=Base
TextureFormatSupported1=Splatting2
TextureFormatSupported2=DwarfSplattingShaderLit
TextureFormatSupported3=PLSplattingShaderUnlit
TextureFormatSupported4=PLSplattingShaderLit

#TextureFormat=Splatting2
#TextureFormat=DwarfSplattingShaderLit
TextureFormat=PLSplattingShaderUnlit
#TextureFormat=Base

TextureStretchFactor=1.0

NumMatHeightSplat=4
MaterialHeight1=20f
MaterialHeight2=40f
MaterialHeight3=100f

SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename3=Splatting_gravel1.png
SplatFilename3=splatting_snow.png



#####################################################
#
# optimizations
#

# At what distance material switches to the lod material
MaterialDistanceLod= 1024
#12288
#4096

# This is the number of renderables in the higher LOD.
DistanceLOD=5


# dont render geometry hidden by other geometry
HorizonVisibilityComputing=yes

VisibleRenderables=2048
MaxRenderLevel=100
MaxPixelError=8


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

tuan kuranes

23-09-2006 12:54:54

does that appears in other texture mode or just this one ?
does it appears in texture mode that doesn't use shaders ?

If it's shader related, that might come from vertex compression, see if you can disable it and still have results.
If still buggy, look and try to play with scale value used in the texcoord buffer creation. (try tweaking from pagesize -1 to pagesize, etc... in ogrepaginglandscapetexturecoordinatesbuffer.cpp (more or less the name))

Yellow

23-09-2006 15:05:51

Using the Base (Texture) mode there are no seams, so I assumed it is shader related. Turning off vertex compression didnt fix it, no changes at all.

Do you mean OgrePagingLandScapeTextureCoordinatesManager.cpp line 111 ?

const Real Aux1 = 1.0 / (mOptions->PageSize - 1);

this seems to shift the texture slightly, now the textures dont tile correctly across pages. Still a seam is noticeable.

tuan kuranes

23-09-2006 15:41:42

turn vertex compression off, use a shader that doesn't use vertex compressions, and play with that value.

PatrickB3

23-09-2006 18:06:46

Also where did the coverage maps come from? You have to use MapSplitter to split the latge coverage map. If you created them yourself then they will not work.

Jerky

24-09-2006 06:24:50

Mapsplitter was used to create all the maps. We only started editing things to try and pinpoint the issue. Yellow is asleep now and our deadline is rapidly approaching. It was finally my endless tinkering that discovered that the problem was from the shader. We are releasing our map editor tomorrow with only base texture on because this bug wasnt fixed in time. We will try your suggestions as soon as we can, not sure if it will make the deadline.

Thanks guys.

P.S. Thanks for the PM help to Tuan, it is appreciated.

Dale_ee

26-09-2006 18:26:36

1. Any news on this bug?
I tried to do:
VertexCompression=no
but it didn't help.

2. Is there any simple way to blend resulting splatting texture with colormap?

Dale_ee

13-11-2006 14:25:25

So, how the problem was solved? What's up with the shader?

Jerky

14-11-2006 22:13:17

Because of other more important things taking precedence, we have not found the fix to this issue yet. For our Alpha release, we decided just to use BaseTexture. We haven't gotten back to this issue yet, so maybe Tuan has an idea.

tuan kuranes

29-11-2006 15:31:55

Did latest version still has the problem ?