Review waveform/vector scope drawing code #117017

Open
opened 2024-01-11 10:29:33 +01:00 by Jeroen Bakker · 4 comments
Member

#116974 (and other patches) changes the look of the vector scope/waveform drawing. We should make sure that the drawing isn't becoming a bottleneck when the side-panel is open. If it can become a bottleneck we should consider caching the vbos or even replace the float arrays with vbos.

Might also consider moving logic into a shader, so we don't need to transport the colors from cpu to gpu all the time.

@aras_p mentioned:

FWIW I tried to look into sharing the scopes code between Image and Sequencer a few weeks ago, and gave up. The image scopes have their own special UI widget type to draw themselves, which makes it really cumbersome to take out the image scopes data out of DNA (which arguably should never have been part of DNA to begin with!). I'd be all for unifying the look (and the code, if possible) between them, but due to how the image scopes drawing is structured right now, it's not exactly trivial :/

#116974 (and other patches) changes the look of the vector scope/waveform drawing. We should make sure that the drawing isn't becoming a bottleneck when the side-panel is open. If it can become a bottleneck we should consider caching the vbos or even replace the float arrays with vbos. Might also consider moving logic into a shader, so we don't need to transport the colors from cpu to gpu all the time. @aras_p mentioned: > FWIW I tried to look into sharing the scopes code between Image and Sequencer a few weeks ago, and gave up. The image scopes have their own special UI widget type to draw themselves, which makes it really cumbersome to take out the image scopes data out of DNA (which arguably should never have been part of DNA to begin with!). I'd be all for unifying the look (and the code, if possible) between them, but due to how the image scopes drawing is structured right now, it's not exactly trivial :/
Jeroen Bakker added the
Module
User Interface
Type
To Do
labels 2024-01-11 10:29:33 +01:00
Jeroen Bakker added this to the EEVEE & Viewport project 2024-01-11 10:29:35 +01:00
Contributor

Unifying the scopes would definitely be great. Replacing the float arrays with VBOs could significantly increase their speed. I think creating shaders for each of the scopes is the way to go. The current method of drawing the scopes in the VSE preview window seems a bit odd to me. Also, all of this is based on legacy code that's 14 years old, in the case of the image viewer.

For future developments, I was thinking it might be really cool to have scopes in the 3D viewport. So you could, for example, adjust lighting while evaluating the color using scopes in real time.
But for that it would be great to have a solid refactored unified code base.

Unifying the scopes would definitely be great. Replacing the float arrays with VBOs could significantly increase their speed. I think creating shaders for each of the scopes is the way to go. The current method of drawing the scopes in the VSE preview window seems a bit odd to me. Also, all of this is based on legacy code that's 14 years old, in the case of the image viewer. For future developments, I was thinking it might be really cool to have scopes in the 3D viewport. So you could, for example, adjust lighting while evaluating the color using scopes in real time. But for that it would be great to have a solid refactored unified code base.
Contributor

@aras_p are you planning on doing any more work on the scopes?
Because I would like to try experimenting with simplifying and optimizing the image editor scopes, and see if we can maybe go from there.
@Jeroen-Bakker do you think that would be a good idea?

@aras_p are you planning on doing any more work on the scopes? Because I would like to try experimenting with simplifying and optimizing the image editor scopes, and see if we can maybe go from there. @Jeroen-Bakker do you think that would be a good idea?

@JonasDichelle not right now, but I'd be following what you do for sure!

That said, (again a much larger topic), there's been some thought about computing scopes in a compute shader on the GPU, which would likely be quite a bit faster. But in context of e.g. compositor, it's waiting for some building blocks to land first (right now even GPU compositor does all the work on the GPU, then the image is read back to CPU, which sends it again to GPU for display). See https://devtalk.blender.org/t/real-time-compositor-feedback-and-discussion/25018/513

@JonasDichelle not right now, but I'd be following what you do for sure! That said, (again a much larger topic), there's been some thought about computing scopes in a compute shader on the GPU, which would likely be quite a bit faster. But in context of e.g. compositor, it's waiting for some building blocks to land first (right now even GPU compositor does all the work on the GPU, then the image is read back to CPU, which sends it again to GPU for display). See https://devtalk.blender.org/t/real-time-compositor-feedback-and-discussion/25018/513

As having a histogram working on an image not fully covering the screen, the transparent areas will cause spikes left and right and will push the r/g/b curves down. Is this the correct behavior? Or are the alpha channel values overshooting and result in the r,g,b, curves are drawn too low?
https://projects.blender.org/attachments/9d428e53-f717-4397-9446-77b63a83e686

As having a histogram working on an image not fully covering the screen, the transparent areas will cause spikes left and right and will push the r/g/b curves down. Is this the correct behavior? Or are the alpha channel values overshooting and result in the r,g,b, curves are drawn too low? https://projects.blender.org/attachments/9d428e53-f717-4397-9446-77b63a83e686
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 Assignees
4 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#117017
No description provided.