Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha to coverage #53

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Alpha to coverage #53

wants to merge 3 commits into from

Conversation

vorg
Copy link
Member

@vorg vorg commented Oct 10, 2018

@dmnsgn Created this pull request so we can track progress.

Comments so far:

Scope

Is this about antialiasing or A2C? Or is A2C form of antialiasing?

Asset sources

We need to provide sources for the used textures and if unknown or license doesn't allow redistribution we should make our own

  • provide asset sources

A2C vs Alpha Test

It's unnecessary as it actually stops A2C gradient half way and looks wrong. Although this tweet suggest otherwise and mattdesl has dynamically adjusted cutout value of 0.4 https://twitter.com/mattdesl/status/900009193649975296?lang=en

Maybe alpha test / cutoff is for performance reasons?

  • disable alpha test when doing A2C?

screenshot 2018-10-10 at 22 32 46

AlphaToCoverage vs Sample Coverage

AlphaToCoverage is just a toggle and not related (?) to gl.sampleCoverage which takes 0..1 value but it has to be also enabled separately with gl.enable(gl.SAMPLE_COVERAGE). Not sure what is it doing or how is it supposed to be used as it clamps max alpha and therefore causes image to "fade out" via dithering.

  • remove sample coverage from the example?

screenshot 2018-10-10 at 22 52 44

Better assets

Brush asset should be completely white and only have alpha channel
screenshot 2018-10-10 at 22 37 50

  • replace brush texture

API

Any suggestions for the interface? E.g. regl/API.md#sample-coverage

 sample: {
    enable: true,
    alpha: false,
    coverage: {
      value: 1,
      invert: false
    }
  }

Given that sampleCoverage is different from alphaToCoverage i suggest

ctx.pipeline({
  alphaToCoverage: true
})
  • suggest an API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants