1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 GPU pixel perfect collision with shader?

Discussion in 'Programming' started by Miradur, Feb 16, 2019.

  1. Miradur

    Miradur Member

    Joined:
    Jan 16, 2018
    Posts:
    126
    Hello, I found an interesting article here, but unfortunately my talent is not enough for programming,
    nor for good English.

    http://fileadmin.cs.lth.se/graphics/theses/projects/gpucd/report.pdf

    If I understand that correctly, you could use shader for a pixel-perfect collision or also for a destructible area.
    Only a black/white mask is queried, so you could test an entire room for collision with the player, by a negative
    mask (black) of the game elements. In destructible terrain, I simply draw with black on a white background and
    only the white part is rendered.

    Is this already available for GameMaker or is it not possible at all? Because I didn't find anything to do with it.


    Miradur
     
  2. dannyjenn

    dannyjenn Member

    Joined:
    Jul 29, 2017
    Posts:
    566
    I didn't read it over, but I think I understand what you're talking about. I guess the purpose of using a shader would be to increase the performance (shaders use the GPU rather than the CPU, and I'd think they'd be pretty fast for this sort of thing). I am actually not sure if anyone has ever done this in GameMaker. Sounds like an interesting idea though.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice