How to set line width in DX

Started by
15 comments, last by Mari_p 18 years, 3 months ago
Quote:Original post by ThiEF_Jr
OK, i ve been testing, Z-test is working. :)

humm... up to where I know, the drawing methods from ID3DXLine interface don't compare depth (z-buffer method). They follow the sequence of rendering calls. For example, consider you have a line behind a mesh: If you render the line first, the mesh will be drawn over the line. If you render the mesh first, the line will be drawn over the mesh.
Advertisement
Quote:Original post by Mari_p
humm... up to where I know, the drawing methods from ID3DXLine interface don't compare depth (z-buffer method). They follow the sequence of rendering calls. For example, consider you have a line behind a mesh: If you render the line first, the mesh will be drawn over the line. If you render the mesh first, the line will be drawn over the mesh.


I already test, Z-Test is working if you use ID3DXLine::DrawTransform() function, not work for ID3DXLine::Draw().


...

Clipping is not work if I use ID3DXLine for draw line, In DrawPrimitive with D3DPT_LINESTRIP or D3DPT_LINELIST cliping is work but how to set line width ? [headshake]


I want to render charector in toon-shade like DragonQuest VIII. i must use thick line for draw silhouette. I dont like silhouette drawing like XIII, extude mesh from normal and render. Does any one help me how to draw thick line in DirectX with cliping [crying]

...
Quote:Original post by ThiEF_Jr
I want to render charector in toon-shade like DragonQuest VIII. i must use thick line for draw silhouette. I dont like silhouette drawing like XIII, extude mesh from normal and render. Does any one help me how to draw thick line in DirectX with cliping [crying]


If that's what you're looking to do, then what you really need to look into are real time cartoon shaders. That is to say, toon rendering like that is not generally done by drawing lines like you are trying to do, but is accomplished through some tricky shader programming. Google around for more information, there's a lot out there about real-time toon shading.
Quote:Original post by Shinkage
If that's what you're looking to do, then what you really need to look into are real time cartoon shaders. That is to say, toon rendering like that is not generally done by drawing lines like you are trying to do, but is accomplished through some tricky shader programming. Google around for more information, there's a lot out there about real-time toon shading.


Do u mean Silhouette Detection Imageprocessing by pixel shader? It can create cool silhouette render like DQ8 but require hi-end GPU. 1 year ago, I ve wrote line base Cel-Shade in OpenGL by reference article at nehe, it's cool and can run in low-end GPU. I want to convert my code to DX but... cliping no work. [cry]

If u have better solution tell me plzzz. [sad]

thx for all reply, and sorry for my bad english.
Quote:Original post by ThiEF_Jr
I already test, Z-Test is working if you use ID3DXLine::DrawTransform() function, not work for ID3DXLine::Draw().

Very strange... depth-buffer test never worked for me with the ID3DXLine::DrawTransform() method. I'm sure the z-buffer was enabled.

Look this image:

image

The z-buffer is enabled:
pDevice->SetRenderState(D3DRS_ZENABLE,TRUE);

The lines meet at the center of the cube.
[oh] Depth-buffer test is working for me. Have u enable Z-Write yet ?

> pDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE);

...
Quote:Original post by ThiEF_Jr
[oh] Depth-buffer test is working for me. Have u enable Z-Write yet ?

> pDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE);


Yes. Depth-buffer doesn't work for me using ID3DXLine... [bawling]

I remember to have seen some comments about bugs in the ID3DXLine in older SDK versions... (I'm using DX SDK 9.0).

Look this:

http://www.ureader.com/message/173960.aspx

... it seems your problem.

This topic is closed to new replies.

Advertisement