2D outlines

This topic contains 6 replies, has 4 voices, and was last updated by  Hezkore 1 year, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #11685

    Hezkore
    Participant

    Is there a simple way to get some sort of outline on 2D images and simple canvas polygons (DrawPoly)?
    I haven’t been able to check out the shader for 2D stuff, but would that perhaps be an option?

    Something like this:

    #11703

    Hezkore
    Participant

    I rendered the entire world to a canvas linked to an image, then I drew that image a bunch of times to the ‘final’ canvas.
    So everything I render to that one canvas will get an outline.
    It almost looks like it should… edges aren’t as sharp as I’d like, but oh well.
    The real problem is performance!
    I’m down to about 80 FPS, and there’s a whole game missing right now.
    So I don’t think this way of doing it is fast enough heh.

    Looking into fullscreen shader instead.

    Oh and I’m aware that Canvas has an outline mode, but it’s sadly pretty ugly and doesn’t work with actual images.

    #11704

    Jesse
    Participant

    gcmartijn made a png 2 poly module. It’s in the modules section. I have not tried so I don’t know if it’s any good.
    maybe it helps???

    #11706

    Ethernaut
    Participant

    80 fps seems slow, you should be able to draw thousands of copies before hitting that frame rate. How many copies are you drawing?

    Rendering to an image canvas can be slow without the “Dynamic” texture flag. Are you using it?

    #11708

    Diffrenzy
    Keymaster

    I’m thinking you could maybe modify this to generate outlines, by drawing the image in black.

    http://monkeycoder.co.nz/forums/topic/poor-mans-antialias/

    #11714

    Hezkore
    Participant

    Getting some good results using a fullscreen shader.
    Proper sharp edges too!

    But I’ll look into the other suggestions 🙂

    #11786

    Hezkore
    Participant

    Got some help with the fullscreen shader and it’s working pretty well.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.