Added shapes, uv_grid, uv_rotate, fresnel, and fresnel_glow functions#12
Merged
paddy-exe merged 1 commit intopaddy-exe:mainfrom Mar 10, 2023
Merged
Added shapes, uv_grid, uv_rotate, fresnel, and fresnel_glow functions#12paddy-exe merged 1 commit intopaddy-exe:mainfrom
paddy-exe merged 1 commit intopaddy-exe:mainfrom
Conversation
paddy-exe
requested changes
Mar 10, 2023
paddy-exe
requested changes
Mar 10, 2023
| float angle = atan(uv.x, uv.y); | ||
| float radius = 6.28318530718 / float(sides); | ||
| float dist = cos(floor(0.5 + angle / radius) * radius - angle) * length(uv); | ||
| float poly = step(width, dist); |
Owner
There was a problem hiding this comment.
You can also just leave the poly as a float output same as the other shape functions since they are just SDFs
Contributor
Author
There was a problem hiding this comment.
So, change to
float polygon
and return
return step(width, dist);
Is that what you're saying?
Owner
There was a problem hiding this comment.
no, instead just return the poly or other named shape variables before you put them in a vec4 after that
Added shapes as well Added pi times 2 incase PI is not accessible Added uv_grid Changed circle shader function to something more performant Changed arguments to be more consistent like other shape functions Added uv_rotate Moved grid to shapes Modified shape functions to return floats and moved grid to uv as uv_grid_tiler given it cannot return a float and more
paddy-exe
approved these changes
Mar 10, 2023
| float angle = atan(uv.x, uv.y); | ||
| float radius = 6.28318530718 / float(sides); | ||
| float dist = cos(floor(0.5 + angle / radius) * radius - angle) * length(uv); | ||
| float poly = step(width, dist); |
Owner
There was a problem hiding this comment.
no, instead just return the poly or other named shape variables before you put them in a vec4 after that
Owner
|
Merged! Thanks for this PR :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shapes
polygoncirclesquaresquare_strokesquare_roundedswirllineUV
uv_grid_tileruv_rotateUtility
fresnelfresnel_glow