Search Unity

How can I use geometry instancing?

Discussion in 'Shaders' started by pandaillusion, Oct 27, 2019.

  1. pandaillusion

    pandaillusion

    Joined:
    Nov 30, 2018
    Posts:
    2
    I write gemetry code head like this for output 120 polygon over.
    I think it is possible to output maxvertexcount over number polygon with geometry instancing.


    [maxvertexcount(120)]
    [instance(32)]
    void geom(triangle d2g vg[3], inout TriangleStream<g2f> outStream,uint gsid : SV_GSInstanceID)


    But it not work, it output 120 only polygon.
    What should I do for using geometry instancing?

    If possible,please give me sample code.
     
  2. pandaillusion

    pandaillusion

    Joined:
    Nov 30, 2018
    Posts:
    2
    It actually working.
    geometory instancing increace to call geometry shader times,not maxvertexcount.