GPencil: Compositing different sized scenes with grease pencil crushes Blender #77885

Closed
opened 2020-06-15 15:43:45 +02:00 by takaaki takeda · 13 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: 211b6c29f7
Worked: (newest version of Blender that worked as expected)

Short description of error
Compositing different sized scenes with grease pencil crushes blender.

For exmple, mixing two render layers in composite node, from Scene.A and Scene.B,
with different resolutions (640x360 and 960x540) crushes blender if active scene is Scene.A, smaller one.
If Scene.B is active, Grease pencil is composed strangely, as an image below.

DifferentSizeImage.png

Exact steps for others to reproduce the error
Open blender and make a new scene in addition to the default one.
(Rename Scene.A and Scene.B for simplicity)

Change the resolution of the scene.
(640x360 and 960x540, for example)

Set basic objects like camera and light for new secene.
Make grease pencil object and draw some strokes for both scene.

Open Compositor and enable composition node tree.
Make render layer from both scenes and mix them as an image below.
CompositDifferentSize.png
(Note that setting for for both scenes are needed.).

If active scene is Scene.A (smaller one), rendering crushes blender.
If active scene is Scene.B, grease pencil looks strangely.
The image looks as if that the size is evaluated wrongly.

I attacht simple .blend file with above setup.
DiffSizeSimple.blend
render in Scane.A crushes blender (at least on my PC).

If grease pencil objects are removed, non-grease pencil object images are composed correctly

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `211b6c29f7` Worked: (newest version of Blender that worked as expected) **Short description of error** Compositing different sized scenes with grease pencil crushes blender. For exmple, mixing two render layers in composite node, from Scene.A and Scene.B, with different resolutions (640x360 and 960x540) crushes blender if active scene is Scene.A, smaller one. If Scene.B is active, Grease pencil is composed strangely, as an image below. ![DifferentSizeImage.png](https://archive.blender.org/developer/F8621115/DifferentSizeImage.png) **Exact steps for others to reproduce the error** Open blender and make a new scene in addition to the default one. (Rename Scene.A and Scene.B for simplicity) Change the resolution of the scene. (640x360 and 960x540, for example) Set basic objects like camera and light for new secene. Make grease pencil object and draw some strokes for both scene. Open Compositor and enable composition node tree. Make render layer from both scenes and mix them as an image below. ![CompositDifferentSize.png](https://archive.blender.org/developer/F8621129/CompositDifferentSize.png) (Note that setting for for both scenes are needed.). If active scene is Scene.A (smaller one), rendering crushes blender. If active scene is Scene.B, grease pencil looks strangely. The image looks as if that the size is evaluated wrongly. I attacht simple .blend file with above setup. [DiffSizeSimple.blend](https://archive.blender.org/developer/F8621164/DiffSizeSimple.blend) render in Scane.A crushes blender (at least on my PC). If grease pencil objects are removed, non-grease pencil object images are composed correctly
Author

Added subscriber: @popqjp

Added subscriber: @popqjp
Antonio Vazquez changed title from Comositing different sized scenes with grease pencil crushes Blender to Compositing different sized scenes with grease pencil crushes Blender 2020-06-15 15:56:45 +02:00

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

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

Added subscribers: @fclem, @antoniov

Added subscribers: @fclem, @antoniov

@fclem could you please take a look at this issue? you know better than me this area of the code.

@fclem could you please take a look at this issue? you know better than me this area of the code.
Antonio Vazquez changed title from Compositing different sized scenes with grease pencil crushes Blender to GPencil: Compositing different sized scenes with grease pencil crushes Blender 2020-06-15 15:58:22 +02:00

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

@lichtwerk Not sure if it's really a GPencil issue or it's a problem with compositing.

@lichtwerk Not sure if it's really a GPencil issue or it's a problem with compositing.

Added subscriber: @VincentBlankfield

Added subscriber: @VincentBlankfield

This looks similar to ce09b93955 to me. In this case the solution would be:

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 10ef8d9c4c8..1b76b8c873c 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1701,7 +1701,7 @@ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph
   drw_context_state_init();

   DST.viewport = GPU_viewport_create();
-  const int size[2] = {(r->size * r->xsch) / 100, (r->size * r->ysch) / 100};
+  const int size[2] = { engine->resolution_x, engine->resolution_y };
   GPU_viewport_size_set(DST.viewport, size);

   drw_viewport_var_init();

But perhaps refactoring the duplicated code would be even better. The code in DRW_render_gpencil is almost identical to DRW_render_to_image with minor differences, and it's not immediately clear whether these differences are intentional or not.

This looks similar to ce09b93955 to me. In this case the solution would be: ``` diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 10ef8d9c4c8..1b76b8c873c 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1701,7 +1701,7 @@ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph drw_context_state_init(); DST.viewport = GPU_viewport_create(); - const int size[2] = {(r->size * r->xsch) / 100, (r->size * r->ysch) / 100}; + const int size[2] = { engine->resolution_x, engine->resolution_y }; GPU_viewport_size_set(DST.viewport, size); drw_viewport_var_init(); ``` But perhaps refactoring the duplicated code would be even better. The code in `DRW_render_gpencil` is almost identical to `DRW_render_to_image` with minor differences, and it's not immediately clear whether these differences are intentional or not.

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

@fclem @Jeroen-Bakker Could you take a look to the proposed fix? I don't know enough about this area of draw manager to decide.

@fclem @Jeroen-Bakker Could you take a look to the proposed fix? I don't know enough about this area of draw manager to decide.

This issue was referenced by 200de72d26

This issue was referenced by 200de72d26127685bb6e20ec01dc69a0201653e4

This issue was referenced by 8fbfc150a0

This issue was referenced by 8fbfc150a097731c9a7a66a1c61a6d5a66973f14

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2020-08-06 19:19:57 +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
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
5 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#77885
No description provided.