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

feat: Fragment shaders pipelines and Camera based post processing #3404

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

renancaraujo
Copy link
Member

Description

Replace this text.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@renancaraujo renancaraujo marked this pull request as draft December 14, 2024 20:06
@@ -0,0 +1,21 @@
name: crystal_ball
description: "A game to showcase the shader pipeline API in Flutter."
Copy link
Member

Choose a reason for hiding this comment

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

Flame?

Comment on lines 7 to 8


Copy link
Member

Choose a reason for hiding this comment

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

remove

}
}

class SamplingCanvas<S extends SPipelineStep> implements Canvas {
Copy link
Member

Choose a reason for hiding this comment

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

could consider some sort of "context" api - but we can have this version as is as a first one

Comment on lines 29 to 42
final int samplingPasses;




late final _layer = _SPipelineStepLayer(
renderTree: super.renderTree,
canvasFactory: _canvasFactory,
samplingPasses: samplingPasses,
postProcess: postProcess,
);



Copy link
Member

Choose a reason for hiding this comment

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

formatting

uniform float[18] glowGamas;


//uniform sampler2D tTexture;
Copy link
Member

Choose a reason for hiding this comment

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

not used?

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Overall looks very nice! 🤩

const (double, double) kCameraSize = (900, 1600);

void main() async {
runApp(const GamePage());
Copy link
Member

Choose a reason for hiding this comment

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

We should add this example to the examples page too :)

void postProcess(List<ui.Image> samples, Size size, Canvas canvas);
}

class PostProcessorComponent extends PositionComponent {
Copy link
Member

Choose a reason for hiding this comment

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

Some dartdocs of this public API would be good

}
}

class SamplingCanvas<S extends PostProcessor> implements Canvas {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe T instead, since it isn't yet used?

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