Search Unity

BUG? DrawMeshNow only draws when the mouse moves

Discussion in 'General Graphics' started by cmann, May 16, 2019.

  1. cmann

    cmann

    Joined:
    Aug 1, 2015
    Posts:
    31
    There's a question here, but with no replies.
    I chose to start a thread because I was having trouble formatting the text and uploading an image, and honestly the answers site seems not so great to me.

    So I've encountered the same problem as the question I linked (I'm using it to draw things to a RenderTexture).
    At first DrawMesh was producing strange results, only drawing to part of the texture, then randomly started working properly. I thought maybe it was just a bug in the editor, corrupted memory or something so I restarted unity and forgot about it.

    A few days later it stopped working again, with similar behaviour to the question, only rendering when the mouse was moving.
    Another weird thing was that it was also drawing to some diagonal region of the texture.
    The picture I've attached below shows the region. Inside of the the white area the mesh is drawn all the time but in the incorrect position, outside of it, the mesh is only drawn when the mouse moves.

    a.jpg

    It's a bit messy, but for testing I'm drawing the green/purple quads every Update.

    Using a CommandBuffer and Graphics.ExecuteCommandBuffer might work, though when I first tried it seemed like it had the same problem briefly, but then worked after that, so I'm not sure how safe that is to use either.