Skip to main content

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one. Quick example:

[maxvertexcount(12)]
void GS_Main(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
    for(int i = 0; i < 3; i++)
    {
        // generate a quad with p[i]

        triStream.RestartStrip();
    }
}

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one. Quick example:

[maxvertexcount(12)]
void GS_Main(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
    for(int i = 0; i < 3; i++)
    {
        //generate a quad

        triStream.RestartStrip();
    }
}

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one. Quick example:

[maxvertexcount(12)]
void GS_Main(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
    for(int i = 0; i < 3; i++)
    {
        // generate a quad with p[i]

        triStream.RestartStrip();
    }
}
added 120 characters in body
Source Link
Icy Defiance
  • 1.3k
  • 1
  • 11
  • 23

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one. Quick example:

This doesn't explain why your second screenshot put the quads in a totally different location, but I don't think that problem is related.

[maxvertexcount(12)]
void GS_Main(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
    for(int i = 0; i < 3; i++)
    {
        //generate a quad

        triStream.RestartStrip();
    }
}

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one.

This doesn't explain why your second screenshot put the quads in a totally different location, but I don't think that problem is related.

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one. Quick example:

[maxvertexcount(12)]
void GS_Main(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
    for(int i = 0; i < 3; i++)
    {
        //generate a quad

        triStream.RestartStrip();
    }
}
added 80 characters in body
Source Link
Icy Defiance
  • 1.3k
  • 1
  • 11
  • 23

From the OpenGL wikiOpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on windowsWindows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one.

This doesn't explain why your second screenshot put the quads in a totally different location, but I don't think that problem is related.

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one.

This doesn't explain why your second screenshot put the quads in a totally different location, but I don't think that problem is related.

From the OpenGL wiki:

The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program.

Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest.

Assuming Unity draws with triangles, you need to change the first parameter to receive that, set maxvertexcount to 12, and generate three quads instead of one.

This doesn't explain why your second screenshot put the quads in a totally different location, but I don't think that problem is related.

Source Link
Icy Defiance
  • 1.3k
  • 1
  • 11
  • 23
Loading