Wire Quill's brush UV clamp through the UI shader and clamp editor sprite sub-rect previews - #364
Closed
Acissathar wants to merge 1 commit into
Closed
Wire Quill's brush UV clamp through the UI shader and clamp editor sprite sub-rect previews#364Acissathar wants to merge 1 commit into
Acissathar wants to merge 1 commit into
Conversation
…rite sub-rect previews
Contributor
|
Oh, wait sorry i merged the other one didnt consider its changes leak into everything taht uses quill. Sorry, i jumped the gun, Could you look into instead padding Brush Texture when assigning it inside the canvas when AA is enabled to simply align taking into account AA, rather then a clamp? |
Contributor
Author
|
Not actually needed - can just use this chunk before rendering the texture brush and it solves the issue entirely: bool prevAA = canvas.AntiAlias; |
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.
Uses Anthology / Quill PR: ProwlEngine/Anthology#13
As mentioned this is out of my wheelhouse, so largely handled by Claude. Tested locally and it does fix the issue though.
Problem
Sprite sub-rect draws through Paper/Quill bleed the neighbouring atlas cell along their edges:
RectFilled's AA fringe extends half a physical pixel past the nominal rect, and the canvas shadersamples the brush texture by fragment position with coverage applied after the sample, so fringe
fragments read UVs outside the sprite's window. See the companion Anthology PR for the full
mechanism and the new
SetBrushTextureClampAPI (with its load-bearing half-texel inset).Fix
Consume the new Quill brush UV clamp:
Prowl.Runtime/Assets/Defaults/UI.shader— add thetextureClampuniform and clamp the brush UVbefore the sample (port of the
Canvas.slangchange).Prowl.Runtime/GUI/PaperRenderer.cs— uploaddrawCall.TextureClamp.Prowl.Editor/.../SpriteAssetEditor.csandProwl.Editor/.../UIImageEditor.cs— the two editorpreviews that draw sprite sub-rects opt in with
canvas.SetBrushTextureClamp(u0, v0, u1, v1)after setting the brush texture/transform.
Notes:
Prowl.Paperpackage containingBrush.TextureClamp/SetBrushTextureClamp/DrawCall.TextureClamp(version bump) before this builds against the feed.UIImagecomponent is unaffected by design — it maps sprite UVs through mesh vertexUVs, not Quill brush sampling.
blits) are left unclamped on purpose: their
[0,1]windows only artifact on Repeat samplers.