Sign in to follow this  
EnlightenedOne

Identifying a depth mesh on mesh jaggy

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.

[attachment=1486:identify.jpg]

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"][size="2"][font="Consolas"][size="2"]d3dpp.BackBufferFormat = d3ddm.Format; (XRGB)
[/size][/font][/size][/font][font="Consolas"][size="2"][font="Consolas"][size="2"]d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferCount = 1;
d3dpp.Windowed = boolWindowed;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;

All depth of precision uses [font="Consolas"][size="2"][font="Consolas"][size="2"]D3DFMT_D16.
[/size][/font][/size][/font]
[font="Consolas"][size="2"][font="Consolas"][size="2"][font="Consolas"][size="2"][font="Consolas"][size="2"]Light z textures get this creation setup
[font="Consolas"][size="2"][font="Consolas"][size="2"][font="Consolas"][size="2"][font="Consolas"][size="2"][/size][/font][/size][/font][/size][/font][/size][/font]hr = pd3dDevice->CreateTexture(SHADOWQUALITYRESOLUTION, SHADOWQUALITYRESOLUTION, 1, D3DUSAGE_RENDERTARGET,
D3DFMT_R32F, D3DPOOL_DEFAULT, &pd3dTexShadowMapRT[i], NULL);
[/size][/font][/size][/font]
All ping pong surfaces get this

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

//This is the same for all depth surfaces
hr = pd3dDevice->CreateDepthStencilSurface(SHADOWQUALITYRESOLUTION, SHADOWQUALITYRESOLUTION,
D3DFMT_D16, D3DMULTISAMPLE_NONE, 0, TRUE, &pd3dSurfShadowDepthRT[i], 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.

[attachment=1492:jaggies.jpg]

Oh yes and the maximum view distance the far plane is

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

the near plane is 1.0

[/size][/font][/size][/font][/size][/font][/size][/font][/size][/font][/size][/font]

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 [url="http://msdn.microsoft.com/en-us/library/aa915211.aspx"]http://msdn.microsoft.com/en-us/library/aa915211.aspx[/url] 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 :)

EnlightenedOne

Share this post


Link to post
Share on other sites

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