Game Development Community

An artifact on terrain rendering

by So Yamaoka · in Torque Game Engine · 08/17/2005 (5:11 pm) · 11 replies

Hi all,

I made a flat terrain using a completely black texture. The terrain shape is fine. It is totally flat as expected. But, an undesirable black line appears on the terrain. The line seems to appear along the diagonal of a terrain block. Here's a screenshot (looking down from the height z=~25.0):

vis.eng.uci.edu/~syamaoka/tmp/Picture1.png

the detailTexture is this 256x256 black texture.

vis.eng.uci.edu/~syamaoka/tmp/flatBlack.png

Does anybody have any idea about this artifact?

TGE v1.3 for OS X.

thanks,
So

#1
08/18/2005 (12:26 pm)
Does the line remain constant as you move the camera up and down?
#3
08/18/2005 (6:18 pm)
Do you see any changes if the light source is changed?
are there any objects, visible/invisable?
no mipmapping or other processin?

is the line showing up on the perimeter of the mission area?
#4
08/18/2005 (10:17 pm)
Okay, something happened when ambient color of the sun was changed.

ambient color = 1.0, 1.0, 1.0, 1.0
vis.eng.uci.edu/~syamaoka/tmp/Picture9.png

0.5, 0.5, 0.5, 1.0
vis.eng.uci.edu/~syamaoka/tmp/Picture10.png

0.0, 0.0, 0.0, 1.0
vis.eng.uci.edu/~syamaoka/tmp/Picture11.png

I do not perform anything fancy in this scene. I did not hack the terrain codes. The objects in the mission file are:

ScriptObject(MissionInfo)
MissionArea(MissionArea)
Sky(Sky)
Sun()
TerrainBlock(Terrain)
SimGroup(PlayerDropPoints)
- SpawnSphere()

The line seems to be on the diagonal of a terrain block, if I understand the mini-map correctly.
#5
08/18/2005 (10:37 pm)
That definitely looks like a bug. I'll have to take a look at it at some point.
#6
08/18/2005 (10:42 pm)
So,

I don't use a Mac and haven't noticed the problem with Windows. (Not saying that it doesn't happen)

Does the problem show up with bmp or jpg's? (wondering if alpha is messing it up)
#7
08/19/2005 (10:20 am)
David,
The problem still shows up with bmp and jpg's. I added some hills on the terrain then relit but the black line is still there.

vis.eng.uci.edu/~syamaoka/tmp/Picture12.png

I'll try the app running in different environments in terms of both software (with a default sample mission, assets etc.) and hardware (on other Macs/Wins) and will report the result if something happens. Thank you guys, I'd appreciate your prompt responses.

So
#8
08/19/2005 (10:25 am)
So, this may be a really stupid question - but did you relight the scene after you flattened the terrain? The line looks like a shadowmap to me. =\
#9
08/19/2005 (12:37 pm)
Kirby, Yes I did.


Here's a good news! I've got rid of the problem. Basically, I recreated a flat terrain from the starter.fps.

- launch the oritinal starter.fps.
- create a flat terrain from a black bitmap.
- remove all textures from the terrain texture editor.
- apply white256x256 png (or jpg) texture as a base texture.
- adjust height.
- save the mission.

I might have done something wrong while creating an original flat terrain since that was sort of trial and error process.

Anyways, thank you guys for helping me out.

---
While fixing this problem I came up with some stupid questions.

1. does the terrain base texture have to be 256x256?
2. Is the terrain base texture required?

I just realized that my old, screwy flattened .ter data has no textures except a detailTexture. I noticed a couple of things while experimenting various textures. This might not be directly related to the black line problem, since base textures did not help me to get rid of the black line problem, but I'd put them up.

The experimental textures are:

Black {32x32, 128x128, 256x256} {jpg, png}
Gray {32x32, 128x128, 256x256} {jpg, png}
White {32x32, 128x128, 256x256} {jpg, png}

all made by photoshop cs2 except some gray ones made by gimp v2.0~.

Textures other than 256x256 got strange rainbow effect in the scene. I've come across an article discussing this rainbow effect and, if I remember correctly, s/he has fixed this problem by adding some hills in the rerrain. It partially fixed the rainbow effect but not quite. I still see the effect in other mission area. 256x256 textures did not introduce the rainbow effect.


Thanks,
So
#10
08/19/2005 (3:32 pm)
Source textures are 256x256 because the optimized blender code the terrain uses to generate its textures is hard coded to operate at that size. Other sizes will get corrupted. TSE won't have this problem.
#11
08/21/2005 (3:48 pm)
Thanks! -s