Skip to content

Conversation

@kornellapu
Copy link

Description

Added Basic Shader Tutirial to Flame documentation.
Added one note to CONTRIBUTING.md, which explains how to resolve non UTF-8 characters in path.

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 Discussion

Adding tutorial to the documentation as discussed here.

There are changes in the tutorial compared to what was previously discussed:

  • minor grammatical corrections
  • minor rephrasings,
  • structural changes
    • separated into steps
    • moved and redacted paragraphs in the introduction
    • changed tags to markdown image links

@wolfenrain wolfenrain requested review from a team, erickzanardo and spydon January 20, 2026 08:08
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.

I can see that you have put a lot of work into this! Which is very appreciated, there is quite a few things that need to be fixed for it to get merged though.

The main things that need to be fixed are:

  1. Write and explain the things in an order that doesn't give errors, it should be a tutorial not a debug log.
  2. Inline code needs to only have one back tick before and after the code, only code blocks should have three.
  3. Code needs to be formatted and analyzed according to the flame_lint rules.
  4. Basic steps for how to set up flame and flutter should not be included in this tutorial, but it can link to the barebones one (and if anything is missing in that one it should be added there instead).
  5. There shouldn't be any cspell ignores, add the words to the correct dictionaries.
  6. Notes should be short.

@override
void onHoverEnter() {
super.onHoverEnter();
Copy link
Member

Choose a reason for hiding this comment

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

The indention depth is wrong everywhere I think, it should be 2 spaces for dart and it's 4

void onHoverEnter() {
super.onHoverEnter();
final OutlinePostProcess outlinePostProcess = postProcess as OutlinePostProcess;
Copy link
Member

Choose a reason for hiding this comment

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

This would trigger the analyzer, I would recommend running all the code in the examples through flame_lint and make sure there are no warnings


```{note}
The loop of a GLSL shader accepts only a compile time constant.
So as far as I know we can not use the outline width, because that is a
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean with the outline distance here? You should be able to pass uniforms.

Copy link
Author

@kornellapu kornellapu Jan 20, 2026

Choose a reason for hiding this comment

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

If I try to use the uniforms in shaders as a for loop bound it gives a runtime error:

SkSL Error:
error: 34: loop index initializer must be a constant expression
        for (int y = _78; y <= bound; y++)
             ^^^^^^^^^^^
error: 31: loop index initializer must be a constant expression
    for (int x = _67; x <= bound; x++)
         ^^^^^^^^^^^
2 errors

I checked around the internet for a solution but I did not found any (yet).
I am open to suggestions, because this is clearly a wrong design / pattern in multiple ways.

Attached an image of the setup, with modified code and console and with the result:
kép

Copy link
Member

Choose a reason for hiding this comment

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

@renancaraujo any input here?


Now run the application.
Open the console (```Ctrl + J```).
Execute ```flutter run```, then choose your platform.
Copy link
Member

Choose a reason for hiding this comment

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

Same here, this should not be needed, just write that they should run it.

@kornellapu kornellapu changed the title docs: Added basic shader tutorial, added one note to contribution docs: Added basic shader tutorial Jan 21, 2026
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