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

For discussion: remove withParametersWebGL #8731

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Mar 31, 2024

Needs

Change List

  • Remove withParametersWebGL and setParametersWebGL from core
  • Type props.parameters and Pass.getLayerParameters

@Pessimistress Pessimistress changed the title Remove withParametersWebGL For discussion: remove withParametersWebGL Mar 31, 2024
@Pessimistress Pessimistress force-pushed the x/picking-fix branch 2 times, most recently from 17c9844 to a9eaaca Compare April 2, 2024 10:54
Base automatically changed from x/picking-fix to master April 2, 2024 16:34
@@ -288,7 +298,10 @@ export default class LayersPass extends Pass {
layerIndex: number,
viewport: Viewport
): LayerParameters {
return layer.props.parameters;
const {getPolygonOffset} = layer.props;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have deprecated getPolygonOffset in v9. It is strange that it is called and accessor in the docs, but is in fact a roundabout way of setting GPU parameters.

Is there any reason to keep the function? I think it would be clearer to pass depthBias(SlopeScale) in props.parameters. In addition if depthBias is passed in props.parameters it will be overwritten even if getPolygonOffset isn't specified.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I certainly agree that it should not be called an "accessor" if that is really the case, as accessors operate on data rows and this function operates on a layer.

We can still deprecate a function at any time. But I believe the functionality of being able to adjust depth bias based on layer index is needed to address Z fighting so we can't just drop it, we need to have a replacement for this function.

...layer.context.deck?.props.parameters,
...layer.props.parameters,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an idea: would it be useful if props.parameters could also accept a function to allow the application to control the final parameters? By passing in the Pass the Layer could have more control:

new Layer({
  ...,
  parameters: (pass: Pass, parameters: Parameters): Parameters {...}

})

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.

3 participants