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

Gray fix2 #1572

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Gray fix2 #1572

wants to merge 6 commits into from

Conversation

Mezage
Copy link

@Mezage Mezage commented Jun 10, 2021

Still trying to understand how fragments work, advice would be nice.
Attempt at patching issue #1284

@Mezage Mezage marked this pull request as ready for review June 10, 2021 06:57
@stephengold stephengold linked an issue Oct 24, 2021 that may be closed by this pull request
@Sailsman63
Copy link
Contributor

Before settling on an implementation, it might be nice to define what kind of results we want from a greyscale transformation, which would be more useful in a shader. See https://en.wikipedia.org/wiki/HSL_and_HSV#Disadvantages for a quick comparison of some of the various ways of transforming RGB into "Lightness/Brightness" of some kind.

Even if the decision is to stick with the basic Arithmetic Mean, as implemented here (technically Intensity from the HSI color space) I question whether the gating check is worth it:

  • You're adding two comparisons and a branch instruction per pixel, with a fairly high likelihood of having to do the sum and division anyway. I'd expect it to mostly be slower than just doing the math. (Though, someone would have to benchmark on a variety of hardware to be sure.)
  • While the speed difference is likely to be minimal either way, you're adding cognitive overhead to the code.

@scenemax3d
Copy link
Contributor

Hi @Mezage ,
Are you still interested in this PR?
If so, can you provide the following information:

  1. Does it break any current feature / interface
  2. How well it’s tested from 0 - 10
  3. Does it needs any new documentation
  4. Release notes

Thank you

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.

ShaderNodes: ColorToGrey has a wrong implementation
3 participants