I'm drawing some meshes, and I've got a Direct3D.Line array
representing wireframe of my objects.
My problem is I don't know how to setup z-buffer to work properly with
lines :(
If I turn z-buffer on some of edge-placed lines are 'floating'.
If I turn z-buffer off I see a mess on screen (too many lines).
Is there any way to decrease all z-buffer values by some small value?
Or should I change projection matrix or sth...
Are you trying to draw the lines over the top of a render of the object?
Can you send a couple of picture (or links to a web site) so we can
understand what you are getting and what you expect to see.
--
Zman (mailto:zm...@thezbuffer.com)
http://www.thezbuffer.com
News and Resources for Managed DirectX
"Oane Mizguel" <oanem...@gmail.com> wrote in message
news:1124749183.8...@g44g2000cwa.googlegroups.com...
what I want, is to have zbuffer on and get clear edges
(sorry if I write something with mistakes, english isn't my native
language)
So you are drawing the back faces of your objects and then overlaying the
wireframe edges on the boxes.
The effect you are seeing is called ZFighting and occurs when the Z values
for the pixel that is already rendered is very very close to the one you are
trying to render. If they are equal the pixel doesn't draw, if its slightly
bigger (or smaller I can never remember if z goes into or out of the screen)
Several way to fix it.
1. Use ZBias - this means give priorities to the lines and so they will draw
if the values are equal. I gather not all cards support this though.
2. Change the projection matrices as in Tom Forsyths FAQ entry
http://tomsdxfaq.blogspot.com/2002_07_01_tomsdxfaq_archive.html#79344425
--
Zman (mailto:zm...@thezbuffer.com)
http://www.thezbuffer.com
News and Resources for Managed DirectX
"Oane Mizguel" <oanem...@gmail.com> wrote in message
news:1124789877.5...@f14g2000cwb.googlegroups.com...
--
Zman (mailto:zm...@thezbuffer.com)
http://www.thezbuffer.com
News and Resources for Managed DirectX
"Oane Mizguel" <oanem...@gmail.com> wrote in message
news:1125319775.4...@f14g2000cwb.googlegroups.com...
It could be a long while ;]
I have big project and that my first one in C# and .NET, so I have a
real mess in source code.
btw:
you are kind of supporting person on this group or just you like to
help people? u write here a lot I see ;)
And its always good to help folks.
--
Zman (mailto:zm...@thezbuffer.com)
http://www.thezbuffer.com
News and Resources for Managed DirectX
"Oane Mizguel" <oanem...@gmail.com> wrote in message
news:1125339142.1...@g14g2000cwa.googlegroups.com...
And working looks like this: http://thinker.virtual.pl/rys/good_wf.png
I know this isn't ideal, but it looks much more better than previous
one (http://thinker.virtual.pl/rys/bad_wf2.png)
Tell me if you will use it somewhere :)