-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: make ring outline determine thickness as a proportion of radius #178
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,12 @@ in vec2 vFromCenter; | |
out vec4 fragColor; | ||
|
||
void main() { | ||
float thickness = max(fPixelLength, min(0.1, fPixelLength * uOutline * uPixelRatio)); | ||
float antialias = min(thickness, fPixelLength * 1.5); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you removed the antialias now, that will make the rendering jaggy, should this not be added back with the new thickness checked? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would we implement it in the new context of using a proportion instead of a particular pixel length? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we not compute the thickness value with the ratio? could we not pass that along withthe 0.5 offset? |
||
float radius = 1.0 - thickness; | ||
float ring = opOnion(sdCircle(vFromCenter, radius), thickness); | ||
float modeDistance = uRenderMode == MODE_HIGH_PASS_1 ? -antialias : -antialias * 0.5; | ||
float distance = uRenderMode == MODE_HIGH_PASS_2 ? 0.0 : modeDistance; | ||
float thickness = uOutline / 2.0; | ||
float innerRadius = 1.0 - thickness; | ||
float ring = opOnion(sdCircle(vFromCenter, innerRadius), thickness); | ||
float antialias = fPixelLength * 1.5; | ||
|
||
if (ring > distance) { | ||
if (ring > 0.0) { | ||
discard; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the ring shader, I assume this applies to the circle node as well? What about the other shapes? How does the thickness work for those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change only affects the ring type node. I have not made any changes to other shapes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but the question is should we, i assume right now the other shapes are doing what they did before, so pixel locked the outline width. All shapes/nodes should behave the same otherwise it will be very confusing to keep track of the differences.