You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the brightnessContrast shader module to manipulate the output color using gl_FragColor = brightnessContrast_filterColor(gl_FragColor);.
My values are these const opts = {brightness: 0.5, contrast: -0.5}
Here are the problematic cases (color is not touched, I can see that brightness and contrast are 0.0, even though I try to set them differently):
// Does not workmodel.setUniforms(opts).draw();
// Does not workmodel.updateModuleSettings(opts).draw();
But either of these work fine (respecting my target brightness and contrast):
// Does workmodel.draw({moduleSettings: opts});
// Does workmodel.draw({uniforms: opts});
I'm using the module to add the helper functions to my shaders (but I'm not using shader modules or shader hooks for anything else, if that matters).
The same problem occurs with tiltShift and probably all other shader modules, so it's not unique to brightnessContrast.
console.log(model.getModuleUniforms()); shows 0 for brightness and contrast (although I'm not sure how one is meant to use getModuleUniforms).
Related to #1460 and #1412, because there's not enough (or not good enough?) documentation to figure out wether I'm doing it incorrectly or if this is broken.
The text was updated successfully, but these errors were encountered:
Is your test code small enough that you could create a code pen that reproduces the issue?
I'm relatively new to JS and have never used codepen.
I even tried setting up a codepen sample for it but didn't know how to import luma.gl correctly.
There are no samples which show how to import it from a HTML script tag or how to import it from codepen settings.
The official samples only show how to use webpack.
I also don't want to create a codepen account (just for reporting that bug).
I'm already providing a minimal reproduction case in the issue description:
model.draw() calls model.setModuleSettings({}) (default moduleSettings = {} parameter) which resets the uniforms. The issue is that the module's getUniforms returns the default values if no relevant inputs are found.
Here's a minimal reproduction case: (removed)
It's based on https://luma.gl/docs/getting-started/hello-triangle and uses luma.gl 8.4.5 at the time of writing.
I'm using the brightnessContrast shader module to manipulate the output color using
gl_FragColor = brightnessContrast_filterColor(gl_FragColor);
.My values are these
const opts = {brightness: 0.5, contrast: -0.5}
Here are the problematic cases (color is not touched, I can see that brightness and contrast are 0.0, even though I try to set them differently):
But either of these work fine (respecting my target brightness and contrast):
I'm using the module to add the helper functions to my shaders (but I'm not using shader modules or shader hooks for anything else, if that matters).
tiltShift
and probably all other shader modules, so it's not unique tobrightnessContrast
.console.log(model.getModuleUniforms());
shows 0 forbrightness
andcontrast
(although I'm not sure how one is meant to usegetModuleUniforms
).Related to #1460 and #1412, because there's not enough (or not good enough?) documentation to figure out wether I'm doing it incorrectly or if this is broken.
The text was updated successfully, but these errors were encountered: