Kaelan

Members
  • Content Count

    1
  • Joined

  • Last visited

Everything posted by Kaelan

  1. I'm trying to implement a visual effect similar to old 2D games - when a player character walks behind an object, they're displayed translucent rather than being entirely occluded. Something like this: I've never tried to do this before, but from looking at it, it seems like the way to go is: render scene object depth (z) values to a texture, have a filter attached to player sprites that reads the current pixel's depth value in the texture, and adjust the final alpha accordingly. How would I go about doing this with PIXI - the first part in particular, rendering the scene depth to a texture? From what I've been able to find, the appropriate way of doing this in WebGL seems to be using the WEBGL_depth_texture extension. I'm on PIXI v.4, and the only references to that which I can find are from the ContextSystem in v5. Is there a built-in way to enable the extension in v4? And if it's not available built-in, is it something I can modify code myself to enable? I'm building pixi.js directly into my project, so I can make changes to source if it's necessary - just not entirely sure what/where I need to change.