Home > other >  DirectX12 or how to do in any graphics API is not affected by the distance the lines
DirectX12 or how to do in any graphics API is not affected by the distance the lines

Time:09-17



Figure is unreal engine editor in the rendering of the line, is very perfect
This line is characterized by no matter how far you can see it will not change no matter how far the thickness, but also can be other mesh

How can consult in rendering graphics apis do apply colours to a drawing gives such a line? (change map model for Line not Line, because only is it a kind of style, I want to get a look not)

In my cognitive all mesh is a triangle, but the line is a little special, if mesh is used to implement a line far can't see, really very curious about exactly how to do it is not affected by distance

I can think of method:
1. Build a quadrilateral, then through calculating the more far more wide, so that you can just like no matter how far the thickness all the same, but this method is so stupid and consumption of resources, there must be a better way of
2. Draw on the direct screen (that is, the matrix switch to the orthogonal matrix and then converted to screen coordinates the position of the two points and then draw and then in the reduction of matrix) but this mapped out no matter what all can't be other objects, always in the front of the
3. Their control color output in the rasterizer this step (but these graphics apis I didn't find out how to control the step)

O master answer, really is a problem that confused me for a long time

CodePudding user response:

You haven't understand 3 d API work
In the vertex shader stages, 3 d coordinates into NDC coordinates, and the NDC coordinates x, y (such as 0.5, 0.5) on the screen size (such as 800, 800), is to screen coordinates (400, 400),
Actually, 3 d is only a mathematical game,

CodePudding user response:

Fillmode set wireframes line
Dx9 in RenderState set
Its in RasterizerState
Dx12 haven't been used, should be like 11, support hlsl5 anyway, not just in the effect framework set
UE if you want this effect, show only the square face, does not display the triangles, still have other method, such as with the map element, or do with GS

CodePudding user response:

refer to the second floor ten response: the fox
fillmode set wireframes line
Dx9 in RenderState set
Its in RasterizerState
Dx12 haven't been used, should be like 11, support hlsl5 anyway, not just in the effect framework set
UE if you want this effect, show only the square face, does not display the triangles, still have other method, such as with the map element, or the use of GS in


No, no, no, said the focus is not on ue this box type thread, I'm just too lazy to draw a line to capture, pulled out a box directly, if there a way to draw a line no matter what the shape is simple,
Problem is to change the blending mode to wireframe painted lines can only be is the kind of style, can change the thickness, for example, or I think outer glow so I wonder how can I achieve a line drawing of the shader, the question then went back to the first floor said (how can no matter how far you can see the)

CodePudding user response:

reference qq_24979719 reply: 3/f
Quote: refer to the second floor ten response: the fox

Fillmode set wireframes line
Dx9 in RenderState set
Its in RasterizerState
Dx12 haven't been used, should be like 11, support hlsl5 anyway, not just in the effect framework set
UE if you want this effect, show only the square face, does not display the triangles, still have other method, such as with the map element, or the use of GS in


No, no, no, said the focus is not on ue this box type thread, I'm just too lazy to draw a line to capture, pulled out a box directly, if there a way to draw a line no matter what the shape is simple,
Problem is to change the blending mode to wireframe painted lines can only be is the kind of style, can change the thickness, for example, or I think outer glow so I wonder how can I achieve a line drawing of the shader, the question then went back to the first floor said (how can no matter how far you can see the)


Why can't see far you cut a figure to me, don't understand what you mean

CodePudding user response:



On the left is to change the blending mode to render lines, on the right is my own implementation, but obviously more far more fine until can't see, and on the right is I want to achieve the effect of, no matter how far the thickness all look the same, how far is it to watch

CodePudding user response:

reference 4 floor ten response: the fox
Quote: reference qq_24979719 reply: 3/f

Quote: refer to the second floor ten response: the fox

Fillmode set wireframes line
Dx9 in RenderState set
Its in RasterizerState
Dx12 haven't been used, should be like 11, support hlsl5 anyway, not just in the effect framework set
UE if you want this effect, show only the square face, does not display the triangles, still have other method, such as with the map element, or the use of GS in


No, no, no, said the focus is not on ue this box type thread, I'm just too lazy to draw a line to capture, pulled out a box directly, if there a way to draw a line no matter what the shape is simple,
Problem is to change the blending mode to wireframe painted lines can only be is the kind of style, can change the thickness, for example, or I think outer glow so I wonder how can I achieve a line drawing of the shader, the question then went back to the first floor said (how can no matter how far you can see the)


Why can't see far you cut a figure to me, don't understand what do you mean




On the left is to change the blending mode to render lines, on the right is my own implementation, but obviously more far more fine until can't see, and on the right is I want to achieve the effect of, no matter how far the thickness all look the same, how far is it to watch

CodePudding user response:

How can appear this kind of effect, is the grid instead of line?

CodePudding user response:

The
reference 7 floor ten response: the fox
how can appear this kind of effect, is the grid instead of line?

Wireframe model draw line is such, look how far the thickness

CodePudding user response:

refer to the eighth floor qq_24979719 response:
Quote: refer to 7th floor ten response: the fox

How can appear this kind of effect, is the grid instead of line?

Wireframe model draw line is such, look how far the thickness as

You realize that I say, is rectangle instead of you, or with any other method?
Dx9 can set the size of the dot chart yuan, relatively simple
After version, you can refer to the dx9 red book examples of contours, with degradation of quadrilateral do
Be familiar with the geometry shader is easier
  • Related