Jump to content

Lightmap Masking Custom Filter Issue


Roomy
 Share

Recommended Posts

Hey, so, I have a relatively simple problem:

I want to cut the solid parts of a lightmap out of a darkness layer, usually one solid color. This can't be done without alpha compositing unless you use custom filters, so I decided to give it a crack. I got a version working in 3.0.0 PIXI (based off of an old lightmap filter), but when transitioning to 5.2.2, I'm experiencing all kinds of problems, namely that the lightmap, despite logging/extracting/etc. as the expected picture, seems to be treated as pure white by the filter.

You can find my demonstration here: https://codepen.io/roomyrooms/pen/mdOQggP?editors=0010

As you can see, setting the alpha of the darkness layer to the lightmap's alpha per-frag makes it invisible, completely. It doesn't seem to be interpreting the lightmap at all. Any help? Apologies, I'm a newbie to shaders/webgl/pixi/everything! 

For those curious, here's a working version in 3.0.8: https://codepen.io/roomyrooms/pen/NWbmKLj?editors=0010

Edited by Roomy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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