Jump to content
  • Advertisement
Sign in to follow this  

Identifying a depth mesh on mesh jaggy

This topic is 2766 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

Hi there,

I initially thought this was an artifact of my projected textures but between 1024-8192 there is no difference in jaggy quality so I ruled that out. The distance between the two static meshes being drawn and the eye has a direct correlation with the extent to which the two meshes have a sawtooth at their joining point which is much more pronounced than the edges on meshes that are not touching. It is almost like a depth issue but all other When you get closer its nice and smooth and the further away the more pronounced the jag. I cannot figure out why the depth between the eye and these two meshes join causes a staircase effect that varies in detail. If it was to do with the screen space blur or the light shadow map detail it would not change size based on eye position and if it was to do with the screen sized calculations it would in some way be blurred.


I would post shader code but its very long, I figure a picture and description would be easier as a means of identifying the issue.

I am aware that any sane person would use a shadow cage to do lossless depth shading for something acting like the sun but I do not have time to implement that and get my physics engine and car online.

Any suggestions to a cause?

Enlightened One

Share this post

Link to post
Share on other sites
These are the D3DDevice creation parameters:

[font="Consolas"][font="Consolas"]d3dpp.BackBufferFormat = d3ddm.Format; (XRGB)
[/font][/font][font="Consolas"][font="Consolas"]d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferCount = 1;
d3dpp.Windowed = boolWindowed;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;

All depth of precision uses [font="Consolas"][font="Consolas"]D3DFMT_D16.
[font="Consolas"][font="Consolas"][font="Consolas"][font="Consolas"]Light z textures get this creation setup
[font="Consolas"][font="Consolas"][font="Consolas"][font="Consolas"][/font][/font][/font][/font]hr = pd3dDevice->CreateTexture(SHADOWQUALITYRESOLUTION, SHADOWQUALITYRESOLUTION, 1, D3DUSAGE_RENDERTARGET,
All ping pong surfaces get this

//So this is where the ping point lights accumulate
[font="Consolas"][font="Consolas"]hr = pd3dDevice->CreateTexture(intScreenWidth, intScreenHeight, 1, D3DUSAGE_RENDERTARGET,
D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &pd3dTexPingPong1MapRT, 0);[/font][/font]

//This is the same for all depth surfaces
D3DFMT_D16, D3DMULTISAMPLE_NONE, 0, TRUE, &pd3dSurfShadowDepthRT, 0);

I tried raising this value to D3DFMT_32 but a call failed so I am guessing its too deep. I know the artifact is there when the three lights are combined in their batch together as I can draw that out easily.


Oh yes and the maximum view distance the far plane is

[font="Consolas"][color="#0000ff"][font="Consolas"][color="#0000ff"][font="Consolas"][color="#0000ff"]const[/font][/font][/font][font="Consolas"][font="Consolas"] [/font][/font][font="Consolas"][color="#0000ff"][font="Consolas"][color="#0000ff"][font="Consolas"][color="#0000ff"]float[/font][/font][/font][font="Consolas"][font="Consolas"] MAXVIEWDISTANCE = 5000.0f;

the near plane is 1.0


Share this post

Link to post
Share on other sites
I read what you said and my mind switched from fault in rendering textures to idiotic rendering strategy. After googling scene depth range I wound up here http://msdn.microsoft.com/en-us/library/aa915211.aspx and after making the near plane 10.0 the issue was resolved completely!

Thank you I would never have turned around and reviewed my camera class without that cue :)


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!