[WIP] GPencil: World Space Onion Skinning #102952

Open
opened 2022-12-05 16:01:30 +01:00 by Falk David · 4 comments
Member

What is world space onion skinning?

Currently in grease pencil, when enabling onion skinning, all the ghost frames are rendered using the current transformation (object, layer parents, etc.) in the scene at that frame.
With world space onion skinning, the ghost frames would be transformed using the transformations at their scene time, so where they would actually show up on screen.

Local Space World Space
gp-onion-skinning-local-space.png gp-onion-skinning-world-space.png

Why is world space onion skinning needed?

World space onion skinning allows the artist to better understand their animation. As seen in the images above, if the object is animated, world space helps visualize the actual animation better.

How can we implement world space onion skinning for grease pencil?

  • Introduce an “Onion Skinning Space” option that can be “Local Space” or “World Space”. Stored per grease pencil object data. (It might be better to store the onion skinning space in the overlay settings rather than on the object data.)
  • Cache the transformation per frame. Store it in the runtime data of the frames in the original data block.
  • The strokes should no longer be transformed on the CPU when copying to eval. They will be transformed on the GPU by the grease pencil render engine using the cached transformation matrix for ghost frames.
  • The grease pencil render engine passes this matrix as a uniform to the shaders, which will no longer use the model matrix.
  • All the operators that visually interact with strokes can no longer rely on the eval data being in the final space and need to account for it.
  • An operator is used to populate the cache in the original frames. It uses a temporary minimal depsgraph to iterate over the relevant frames in the scene and calculates the world space transformation matrix and stores the cached transformation in all the grease pencil frames.

What are the current limitations of this design?

  • The cache is stored on orig data block, meaning that it can only be valid for one object. Therefore, it is shared between all instances and we can't display per-instances world space onion skinning.
  • We only cache a single transformation matrix, meaning armature deformations for example cannot be displayed for world space onion skinning.
  • We do not have an automated update system to invalidate and compute the cache. It is unclear who is responsible for invalidating and recalculating the cache.
  • Multi-frame editing only works in local space.
## What is world space onion skinning? Currently in grease pencil, when enabling onion skinning, all the ghost frames are rendered using the current transformation (object, layer parents, etc.) in the scene at that frame. With world space onion skinning, the ghost frames would be transformed using the transformations at their scene time, so where they would actually show up on screen. | Local Space | World Space | | -- | -- | | ![gp-onion-skinning-local-space.png](https://archive.blender.org/developer/F13997379/gp-onion-skinning-local-space.png) | ![gp-onion-skinning-world-space.png](https://archive.blender.org/developer/F13997388/gp-onion-skinning-world-space.png) | ## Why is world space onion skinning needed? World space onion skinning allows the artist to better understand their animation. As seen in the images above, if the object is animated, world space helps visualize the actual animation better. ## How can we implement world space onion skinning for grease pencil? - Introduce an “Onion Skinning Space” option that can be “Local Space” or “World Space”. Stored per grease pencil object data. (It might be better to store the onion skinning space in the overlay settings rather than on the object data.) - Cache the transformation per frame. Store it in the runtime data of the frames in the original data block. - The strokes should no longer be transformed on the CPU when copying to eval. They will be transformed on the GPU by the grease pencil render engine using the cached transformation matrix for ghost frames. - The grease pencil render engine passes this matrix as a uniform to the shaders, which will no longer use the model matrix. - All the operators that visually interact with strokes can no longer rely on the eval data being in the final space and need to account for it. - An operator is used to populate the cache in the original frames. It uses a temporary minimal depsgraph to iterate over the relevant frames in the scene and calculates the world space transformation matrix and stores the cached transformation in all the grease pencil frames. ## What are the current limitations of this design? - The cache is stored on orig data block, meaning that it can only be valid for one object. Therefore, it is shared between all instances and we can't display per-instances world space onion skinning. - We only cache a single transformation matrix, meaning armature deformations for example cannot be displayed for world space onion skinning. - We do not have an automated update system to invalidate and compute the cache. It is unclear who is responsible for invalidating and recalculating the cache. - Multi-frame editing only works in local space.
Author
Member

Added subscriber: @filedescriptor

Added subscriber: @filedescriptor

Added subscriber: @antoniov

Added subscriber: @antoniov

@filedescriptor About "The strokes should no longer be transformed on the CPU when copying to eval."... this is only for Onion strokes or for any stroke? and multiframe?

@filedescriptor About "The strokes should no longer be transformed on the CPU when copying to eval."... this is only for Onion strokes or for any stroke? and multiframe?
Author
Member

@antoniov Yes any stroke. All the strokes are in "local space". When multi-frame is enabled, the frames are also just shown in local space. Maybe I can add that to the list of limitations.

@antoniov Yes any stroke. All the strokes are in "local space". When multi-frame is enabled, the frames are also just shown in local space. Maybe I can add that to the list of limitations.
Philipp Oeser removed the
Interest
Grease Pencil
label 2023-02-09 15:19:07 +01:00
Iliya Katueshenock removed the
Status
Needs Triage
label 2023-08-24 17:33:52 +02:00
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
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
2 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#102952
No description provided.