Page MenuHome

[WIP] Use DrawManager for Image/UV Editor
Needs ReviewPublic

Authored by Jeroen Bakker (jbakker) on Jul 7 2020, 1:08 PM.
This revision needs review, but there are no reviewers specified.

Details

Summary

Continuation of the work in D6093: [WIP] DrawManager: Image/UV editor Drawing but due to the many changes it was better to start over.

What works

  • drawing Image in UV editor
  • drawing of image in Image Editor (all modes)
  • drawing of uv shadow
  • drawing of background
  • drawing of uv (see wireframe drawing for work that still needs to be done)

TODO/Known Issues

  • Image drawing
    • UDIM Drawing
    • Functional change: disable repeat option for UDIM textures
  • Wireframe drawing
    • Draw style outline
    • Smooth wireframe drawing
    • Thick wireframe drawing
    • In stead of storing a color buffer use line styles to compress the data. Normally we only need 2 different line styles (UV and UV Shadow). the freed components can then be used to add the offset to the center of the pixel, the angle of the line and the width of the line.
    • Support shadow line together with normal line style
  • Overlays
    • UV stretching overlay
    • Display edges after modifiers are applied
    • drawing of image unavailable grid. Need to check the use case for the current grid thing.
  • Issues
    • Painting Annotation does not refresh drawing
    • Background isn't clear and can leave render artifacts (render, zoom render result)
    • Stereo images
      • composite rendering of render result
      • one eye drawing of render result
      • composite rendering of image
    • UDIM edge bleeding (UV clamping)

Future

  • use smaller GPU textures when zoomed in (need multiple GPU textures when repeat is enabled)
  • Migrate mask drawing to draw manager.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D8234_1 (branched from master)
Build Status
Buildable 9420
Build 9420: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Jeroen Bakker (jbakker) requested review of this revision.Jul 7 2020, 1:08 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • basic uv face and vertex drawing

Migrated original vertex fragment shader

  • Initial background shader (disabled for now)
  • Added rendering of background + checkerboard
  • UV Shadow overlay
  • Added copyright headers
  • Moved UVShadow color to common lib
  • Initial background shader (disabled for now)
  • Added rendering of background + checkerboard
  • UV Shadow overlay
  • Added copyright headers
  • Moved UVShadow color to common lib
  • Added channel selection
  • Fixed memory leak (depth texture)
  • WIP: Use instanceAttr for drawing multiple textures
  • Initial background shader (disabled for now)
  • Added rendering of background + checkerboard
  • UV Shadow overlay
  • Added copyright headers
  • Moved UVShadow color to common lib
  • Added channel selection
  • Fixed memory leak (depth texture)
  • WIP: Use instanceAttr for drawing multiple textures
  • Fixed assert rebaseing latest master (TEXTARGET_2D)
  • Using instances to draw repeating images
  • Added global check for drawing annotations
  • Initial background shader (disabled for now)
  • Added rendering of background + checkerboard
  • UV Shadow overlay
  • Added copyright headers
  • Moved UVShadow color to common lib
  • Added channel selection
  • Fixed memory leak (depth texture)
  • WIP: Use instanceAttr for drawing multiple textures
  • Fixed assert rebaseing latest master (TEXTARGET_2D)
  • Using instances to draw repeating images
  • Added global check for drawing annotations
  • Wireframe drawing
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Mon, Jul 27, 4:20 PM
source/blender/draw/engines/editors/editors_engine.c
39

Remove this section, it isn't needed anymore and was copied from previous patch for reference

source/blender/draw/engines/editors/editors_image.c
232

This needs to be brought back. Hadn't had the opportunity to test this

source/blender/draw/engines/editors/editors_private.h
33

remove

source/blender/draw/engines/overlay2d/overlay2d_uv_stretching.c
24

This is still a TODO for this patch

source/blender/draw/engines/overlay2d/shaders/uv_verts_vert.glsl
16

Still need to resolve this TODO

source/blender/draw/intern/draw_common.h
144

These changes can be reverted as UVShadow is send as a uniform. but on second thought we could use multiple line styles. and then we can still keep this color in the global uniform.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Mon, Jul 27, 4:34 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Fix background rendering (wrong texture attached)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Tue, Jul 28, 5:32 PM
  • Removed overlay texture from wireframe drawing.
  • Refactored wireframeBuffer
  • Refactored wireframeBuffer
  • Added DRWShaderLib for overlay2d engine
  • Added DRWShaderLib for editors engine
  • Outline LineStyle drawing
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Wed, Jul 29, 2:53 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Cleanup: Removed old comments
  • Line Style Outline did not react to UV Opacity
  • Fix selection drawing
  • Use globals lib to fetch colors in uv shaders
  • Fix select edge when face is selected.
source/blender/draw/intern/draw_common.h
144

new wireframe drawing still uses globals for colors, so it is still needed

  • Added DRWShaderLib for overlay2d engine
  • Added DRWShaderLib for editors engine
  • Outline LineStyle drawing
  • Cleanup: Removed old comments
  • Line Style Outline did not react to UV Opacity
  • Fix selection drawing
  • Use globals lib to fetch colors in uv shaders
  • Fix select edge when face is selected.
  • Rebased with latest master (GPU texture API change)
  • UV Stretching (Angle)
  • UV Stretching: Area
source/blender/draw/engines/overlay2d/overlay2d_uv_stretching.c
178

This doesn't work as the values are only available after the batch creation is finished. The data becomes available after the cache_finish.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Wed, Aug 5, 3:22 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • UV Stretching: Only enable when in edit mode
  • UV Stretching: Correct Area calculations
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Wed, Aug 5, 4:17 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Wed, Aug 5, 4:34 PM
  • Rebased with latest master (GPU texture API change)
  • UV Stretching (Angle)
  • UV Stretching: Area
  • UV Stretching: Only enable when in edit mode
  • UV Stretching: Correct Area calculations
  • Image Editor: Initial stereo drawing
  • ImageEditor: Support for drawing shadow line style together regular linestyle
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Sat, Aug 8, 2:32 PM
  • Fixed merge latest master
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Sat, Aug 8, 4:21 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • UDIM drawing