Jump to content

Adding a noise overlay to scene (modifying textures programatically?)


WhiteDragonLight
 Share

Recommended Posts


Hello everyone, this is my first post on these forums.

I'm working on a top-down retro RPG thingy and there's a scene where I need to gradually add "noise" to both the tileset and sprite textures as the player walks.
I've tried adding a graphics object and then plotting with fillPoint() like so:
 

let graphics = this.add.graphics();
  
this.events.on('playerMove', () => {

    for (let i = 0; i < 50; i++) {
        let point = this.getRandomCoords();
        graphics.fillPoint(point.x, point.y, 3);
    }
});



This kinda works but it's far from ideal and it just breaks at one point giving the following warning:
WebGL warning: bufferSubData: Offset+size passes the end of the buffer.

So I'm looking for alternatives to achieve a similar effect. I was wondering if it was possible to modify tileset and sprite textures programatically for instance (that would be ideal) or just any other way to generate the same effect.
Basically, I want to add random white dots on screen until you can no longer tell what's going on.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...