Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by yloquen

  1. Why do you iterate over row and col to get an index, why not iterate directly over cells? Otherwise I think that a shader is the most performant way to do it. Here's an example.
  2. Ok, thanks for the help. I found the mistake I was making. I wasn't clamping the value of "c" so it could be more than 1 and the result of that was that the correct colors look like shadow next to the bright values resulting from the areas with initial value larger than 1. Here's what I was after. You can comment this: c = clamp(c, 0.0, 1.0); to see the difference.
  3. Yes, this looks the way I want it to, for white, only I can't seem to make it work this way for different colours. I tried : fc *= vec4(.2, .6, .1, 1.0); This gives black borders. fc *= vec4(.1, .5, .1, 0.5); No black borders, but the colors are a lot brighter. Btw, I understand it's not a pixi issue, I get exactly the same on Shadertoy. If I might summarize my question it would be : Why fragColor = vec4(1.0, 1.0, 1.0, 0.0) outputs white? I think that's the crux of the issue.
  4. I want the colour to be the same everywhere, the problem is that if I do : gl_FragColor = vec4(1.0, 1.0, 1.0, a); I expect to have transparency where the texture is black, but I don't.
  5. I've updated the playground example with my exact shader. The undesired effect that happens is the black border on the edges - I think it's not PMA issue, because I changed the texture to have alpha 1.0 for all pixels and I use the other channels. Looks more like a blending issue and I tried playing with the blend mode of the sprite, but that does not seem to affect it.
  6. Ok, thanks. I can almost get what I want with PMA. It's just the blending on the edges that's a bit off. I'm using a texture as a mask for the filter. Btw, I get the same thing when experimenting on Shadertoy, so I'm guessing it's the way WebGL works.
  7. I made a playground example to illustrate my issue. When setting the output values of the fragment, the alpha seems to be ignored when I use a constant value instead of the sampled one. If you uncomment the last line of the shader you will see my issue - how can I avoid showing the colour where alpha is zero ?
  • Create New...