Sign in to follow this  

holes in terrain

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey Im kinda new to directX and Im working on this simple terrain engine. I have some of it working, but when I try to render a terrain and move around in the world, holes appear in the terrain (and dissapear if I move again). I have a picture of it at www.kruskal.net/outcast/artifacts.bmp anyone know a way to fix this?

Share this post


Link to post
Share on other sites
Are you sure they are wholes. Looks like a ZBuffering problem to me. Like in the values are close to each other and might create artifacts like that. What are your near and far planes set at and are you clearing your depth buffer? Near and far planes should be set to 1.0f and 1000.0f respectively. Also have Direct3D handle your Depth/Stencil buffers such as creating a AutoDepthStencil buffer when you create your device.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
my near and far planes are 1 to 1000, but what do those have to do with the zbuffer? these things flash by as I move, they arent slow. I made sure to turn the z buffer on, but this does seem like a zbuffer problem..

Share this post


Link to post
Share on other sites
You sometimes get artifacts or weird anomolies from depth buffer issues. Are these artifacts only in the distance or do they appear near you? Give us a little more information. Your terrain seems to be rendering well except for those artifacts which brings me to the conclusion it might be a driver issue or something else.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Try running with the reference device, it will be ridiculously slow but as it's output should be 100% correct, you'll be able to tell if it's a driver issue.
It might be worth downloading the latest drivers if you haven't already.

Share this post


Link to post
Share on other sites

From the screenshot I can see that it is a horizontal line, with no relation to the triangles of the terrain. Is terrain rendering the only thing you do ?

Triangle indexing with bad indices may cause polygons to pop randomly.

Share this post


Link to post
Share on other sites
it I also noticed that those black lines dont seem to be on any triangle boundaries. All my program does is render the terrain and I know there are no bad indices, Ive checked that very carefully already. Ill try the reference device. Here is a much clearer picture of the artifacts which makes me think it is a zbuffer problem.
www.kruskal.net/outcast/artifacts2.bmp

Share this post


Link to post
Share on other sites

By looking at your last screenshot one could say that it is a z-buffer problem. Do you have your culling set correctly (ie. that you don't render back facing triangles) ?

Z-buffering artefacts usually "live" when the camera angle/position is changing.

Could you take a wireframe shot of the problem ? It might at least reveal if the problem is with Z-buffering.

Share this post


Link to post
Share on other sites
Hmm .. I think I've seen that before .. are you using Tri strips or Quads.

It's because of the way the triangles line up on the ridges of mountains, quads will start missing, triangles will just make it look jaggy.

Have you tried using both sorts of rendering?

Share this post


Link to post
Share on other sites
idk if this helps, not sure what u mean by format..

DeviceType D3DDEVTYPE_HAL
AdapterOrdinal 0
Caps 131072
Caps2 131072
Caps3 0
PresentationIntervals 2147483649
CursorCaps 0
DevCaps 702032
PrimitiveMiscCaps 114
RasterCaps 407
ZCmpCaps 255
SrcBlendCaps 6975
DestBlendCaps 6975
AlphaCmpCaps 255
ShadeCaps 541192
TextureCaps 16391
TextureFilterCaps 50529024
CubeTextureFilterCaps 0
VolumeTextureFilterCaps 0
TextureAddressCaps 5
VolumeTextureAddressCaps 0
LineCaps 31
MaxTextureWidth 1024
MaxTextureHeight 1024
MaxVolumeExtent 0
MaxTextureRepeat 0
MaxTextureAspectRatio 0
MaxAnisotropy 1
MaxVertexW 0.000000
GuardBandLeft 0.000000
GuardBandTop 0.000000
GuardBandRight 0.000000
GuardBandBottom 0.000000
ExtentsAdjust 0.000000
StencilCaps 0
FVFCaps 1048578
TextureOpCaps 14431
MaxTextureBlendStages 2
MaxSimultaneousTextures 2
VertexProcessingCaps 0
MaxActiveLights 0
MaxUserClipPlanes 0
MaxVertexBlendMatrices 0
MaxVertexBlendMatrixIndex 0
MaxPointSize 64.0000
MaxPrimitiveCount 65535
MaxVertexIndex 65535
MaxStreams 1
MaxStreamStride 256
VertexShaderVersion 0
MaxVertexShaderConst 0
PixelShaderVersion 0
PixelShader1xMaxValue 0.000000
DevCaps2 0
MaxNpatchTessellationLevel 0.000000
Reserved5 0
MasterAdapterOrdinal 0
AdapterOrdinalInGroup 0
NumberOfAdaptersInGroup 1
DeclTypes 0
NumSimultaneousRTs 1
StretchRectFilterCaps 0
+ VS20Caps {...}
+ PS20Caps {...}
VertexTextureFilterCaps 0
MaxVShaderInstructionsExecuted 0
MaxPShaderInstructionsExecuted 0
MaxVertexShader30InstructionSlots 0
MaxPixelShader30InstructionSlots 0
format D3DFMT_X8R8G8B8

Share this post


Link to post
Share on other sites

This topic is 4338 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this