Page MenuHome

Fix T96414: Stencil mapping is incorrect for UDIMs
ClosedPublic

Authored by Jesse Yurkovich (deadpin) on Apr 17 2022, 11:44 AM.

Details

Summary

When texture painting, brush textures and brush texture masks were not
transformed to account for UDIMs tiles.

This simply transforms the stencil mapping rect according to the tile
being painted/sampled.


This would be a candidate for 2.83 and 2.93 if accepted.

Diff Detail

Repository
rB Blender
Branch
udim-fixT96414-stencil (branched from master)
Build Status
Buildable 21660
Build 21660: arc lint + arc unit

Event Timeline

Jesse Yurkovich (deadpin) requested review of this revision.Apr 17 2022, 11:44 AM
Jesse Yurkovich (deadpin) created this revision.

Yes, in particular, smaller brush sizes are affected a lot more than larger and it seems very "view / zoom" dependent. Zooming in and making each tile larger will sample much better from the brush. I can reproduce similar artifacts on master even with non-tiled images:

Top image: Zoomed out, small brush size
Middle image: Zoomed in a bit, large brush size
Bottom image: Zoomed in a bit, small brush size

Yes, in particular, smaller brush sizes are affected a lot more than larger and it seems very "view / zoom" dependent. Zooming in and making each tile larger will sample much better from the brush. I can reproduce similar artifacts on master even with non-tiled images:

Top image: Zoomed out, small brush size
Middle image: Zoomed in a bit, large brush size
Bottom image: Zoomed in a bit, small brush size

Will have to check on master still (had the impression this was a lot more noticeable on "higher" UDIMs...)
Maybe @Lukas Stockner (lukasstockner97) wants to check this one here, too?

Maybe the rounding to integers in brush_painter_2d_tex_mapping causes problem, it's not immediately obvious to me why that's done.

  • Use floats instead or rounding to ints

Oh, good idea. That does help greatly for me at least. The distortion was minimal on my 4k display before using floats and slightly improved after. For 1080p though I'm seeing much better results after using them.

@Philipp Oeser (lichtwerk) mind giving this a try again and see if it helps your case?

This revision is now accepted and ready to land.May 10 2022, 7:45 PM

Oh, good idea. That does help greatly for me at least. The distortion was minimal on my 4k display before using floats and slightly improved after. For 1080p though I'm seeing much better results after using them.

@Philipp Oeser (lichtwerk) mind giving this a try again and see if it helps your case?

Sorry this slipped through.
Yep, can confirm the artifacts are also gone for me now, thx!