Image Engine redesign. #92525

Closed
opened 2021-10-27 10:17:05 +02:00 by Jeroen Bakker · 11 comments
Member

The GPU Viewport module have discussed some limitations of the image engine (the code that draws the image editor, node editor backdrop,..)

  • Images are scaled down when they don't fit in a gpu texture. GPUs have different max resolutions.
  • GPU textures are all cached inside the Image struct. This leads to complicated code as there are many variations that needs to be tracked.

Approach

  • Every visible image/node editor would keep track of the images they need.
  • The image editor would keep track of a small number (4-8) of screen sized textures.
  • When panning the textures are drawn with an translation. When an image isn't visible (moved to a side of the screen) the image would be reused as it is needed at the other side of the screen.
  • The GPU textures should be reused when zooming inside a certain range. When outside the range the GPU textures would be recreated. There might be a slight delay when this happens.

Repeated Images

Images can be set repeated. In this solution the image will be drawn repeated inside the screen sized textures.

Tiled Images

Tiled images are rendered in screen space inside the screen sized textures.

Image Channel

When switching the image channel can update the screen sized textures (Eg showing the depth) As switching the image channel is done via a user interaction the update/upload of the data might not be noticable by the user.

Stereo drawing

An idea is to have stereo drawing becoming a responsibility of draw engines. In case of the image editor we creating the left/right image at the same time as they use the same panning, zoom level and image channel.

Partial update

When painting textures are partially updated. This mechanism needs an overhaul as there are now multiple areas that needs to implement partial updating. Storing the area for partial updates cannot be the Image anymore. Perhaps an idea to look at the message bus and if we can use it.
#92613 (GPUTexture partial update) describes a proposal for partial updating.

  • #80113 (Support Huge Image Sizes in image/uv editor)
The GPU Viewport module have discussed some limitations of the image engine (the code that draws the image editor, node editor backdrop,..) * Images are scaled down when they don't fit in a gpu texture. GPUs have different max resolutions. * GPU textures are all cached inside the Image struct. This leads to complicated code as there are many variations that needs to be tracked. ## Approach * Every visible image/node editor would keep track of the images they need. * The image editor would keep track of a small number (4-8) of screen sized textures. * When panning the textures are drawn with an translation. When an image isn't visible (moved to a side of the screen) the image would be reused as it is needed at the other side of the screen. * The GPU textures should be reused when zooming inside a certain range. When outside the range the GPU textures would be recreated. There might be a slight delay when this happens. ### Repeated Images Images can be set repeated. In this solution the image will be drawn repeated inside the screen sized textures. ### Tiled Images Tiled images are rendered in screen space inside the screen sized textures. ### Image Channel When switching the image channel can update the screen sized textures (Eg showing the depth) As switching the image channel is done via a user interaction the update/upload of the data might not be noticable by the user. ### Stereo drawing An idea is to have stereo drawing becoming a responsibility of draw engines. In case of the image editor we creating the left/right image at the same time as they use the same panning, zoom level and image channel. ### Partial update When painting textures are partially updated. This mechanism needs an overhaul as there are now multiple areas that needs to implement partial updating. Storing the area for partial updates cannot be the Image anymore. Perhaps an idea to look at the message bus and if we can use it. #92613 (GPUTexture partial update) describes a proposal for partial updating. ## Related tasks * #80113 (Support Huge Image Sizes in image/uv editor)
Jeroen Bakker self-assigned this 2021-10-27 10:17:05 +02:00
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

Added subscriber: @EAW

Added subscriber: @EAW

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific

Added subscriber: @Florian-10

Added subscriber: @Florian-10

Are the insulation of the render result and the "image editor" a thing? This would be making sense

Are the insulation of the render result and the "image editor" a thing? This would be making sense

Added subscriber: @JacobMerrill-1

Added subscriber: @JacobMerrill-1

is this like a Sparse virtual textures system?

can all of the UI in theory use this?

is this like a Sparse virtual textures system? can all of the UI in theory use this?

This issue was referenced by bdd74e1e93

This issue was referenced by bdd74e1e9338b18e4f80458f284d0c6a4d100f30
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author
Member

Closed by bdd74e1e93

Closed by bdd74e1e93
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#92525
No description provided.