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

Updated documentation for shaders. #6497

Merged
merged 15 commits into from Oct 30, 2023
Merged

Conversation

deveshidwivedi
Copy link
Contributor

@deveshidwivedi deveshidwivedi commented Oct 26, 2023

Resolves #4714

Changes:

Updated the createShader with vertex shader. To recommend users make use of this shader to avoid inconsistency in their code as shaders can change the positioning of shapes drawn with them.
Also updated related docs in loadShader and shader.

PR Checklist

@welcome
Copy link

welcome bot commented Oct 26, 2023

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Looking good so far! I left some minor comments, and then after that I think this will be good to go!

src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
deveshidwivedi and others added 5 commits October 26, 2023 17:02
Co-authored-by: Dave Pagurek <dave@davepagurek.com>
Co-authored-by: Dave Pagurek <dave@davepagurek.com>
Co-authored-by: Dave Pagurek <dave@davepagurek.com>
Co-authored-by: Dave Pagurek <dave@davepagurek.com>
@deveshidwivedi
Copy link
Contributor Author

I have made these changes, please take a look.

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

One more change I think! Before, the createShader example was relying on the vertex shader to do the positioning, and was basically ignoring the position from p5, so the example uses quad(-1, -1, 1, -1, 1, 1, -1, 1);. Now, it actually ends up drawing a very tiny quad.

Maybe we can replace the quad() call with plane(width, height) to make a full-canvas shader? If you run grunt yui:dev after making the changes, it opens a local version of the docs so you can test how it looks.

@deveshidwivedi
Copy link
Contributor Author

deveshidwivedi commented Oct 27, 2023

Sure! Is it this example that you're talking about? (under createShader).

@davepagurek
Copy link
Contributor

Right, that's the one!

@deveshidwivedi
Copy link
Contributor Author

does this look fine?

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

I tried running the example by running grunt yui:dev and going to the createShader documentation in the local docs server, and it looks like it's hitting some errors. I left some comments where I think they can be fixed!

src/webgl/material.js Outdated Show resolved Hide resolved
src/webgl/material.js Show resolved Hide resolved
src/webgl/material.js Outdated Show resolved Hide resolved
@deveshidwivedi
Copy link
Contributor Author

hi, please have a look and let me know if other changes are required!

@davepagurek
Copy link
Contributor

It looks good in a browser now, thanks!

The last thing is to get the automated tests to pass. Right now it looks like they're failing because some lines have trailing spaces at the end:
image

It looks like after removing those we should be ok!

@deveshidwivedi
Copy link
Contributor Author

Removed the trailing spaces!

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@davepagurek davepagurek merged commit 5f7869d into processing:main Oct 30, 2023
2 checks passed
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.

resetShader() doesn't reset to default stroke / fill shaders
2 participants