Inconsistencies between 3D Viewport and Viewport Render Image using the GPU Shader Module #77958

Open
opened 2020-06-17 16:54:09 +02:00 by Sebastian · 8 comments

System Information
Operating system: Ubuntu 18.04, Windows 10
Graphics card: GeForce GTX Titan X, GeForce GTX 1080 Ti

Blender Version
Broken:
2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: 211b6c29f7
2.90.0 Alpha, branch: master, commit date: 2020-06-16 18:15, hash: c7b03fe9c0
Worked: Never

Short description of error
Rendering the 3D Viewport with 3D Viewport/View/View Render Image (i.e. OpenGL rendering) does not render elements drawn with the GPU Shader module .

The problem is illustrated in the following example, which shows the 3D Viewport (left) and the rendered result of View/View Render Image (right).
The points drawn with the GPU shader module are neglected during OpenGL rendering.
combined_points.jpg

Exact steps for others to reproduce the error
Excecute the [3D Lines with Single Color ]] example of the [ https:*docs.blender.org/api/current/gpu.html | GPU shader module documentation .
Then, render the results withView/View Render Image as shown in the image below.
viewport_render_image.jpg

The lines visible in the 3D Viewport (left) are missing in the rendered result (right).
combined_lines.jpg

**System Information** Operating system: Ubuntu 18.04, Windows 10 Graphics card: GeForce GTX Titan X, GeForce GTX 1080 Ti **Blender Version** Broken: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `211b6c29f7` 2.90.0 Alpha, branch: master, commit date: 2020-06-16 18:15, hash: `c7b03fe9c0` Worked: Never **Short description of error** Rendering the `3D Viewport` with `3D Viewport/View/View Render Image` (i.e. OpenGL rendering) does not render elements drawn with the [GPU Shader module ](https://docs.blender.org/api/current/gpu.html). The problem is illustrated in the following example, which shows the `3D Viewport` (left) and the rendered result of `View/View Render Image` (right). The points drawn with the GPU shader module are neglected during OpenGL rendering. ![combined_points.jpg](https://archive.blender.org/developer/F8627982/combined_points.jpg) **Exact steps for others to reproduce the error** Excecute the [3D Lines with Single Color ]] example of the [[ https:*docs.blender.org/api/current/gpu.html | GPU shader module documentation ](https:*docs.blender.org/api/current/gpu.html#d-lines-with-single-color). Then, render the results with`View/View Render Image` as shown in the image below. ![viewport_render_image.jpg](https://archive.blender.org/developer/F8628029/viewport_render_image.jpg) The lines visible in the 3D Viewport (left) are missing in the rendered result (right). ![combined_lines.jpg](https://archive.blender.org/developer/F8627977/combined_lines.jpg)
Author

Added subscriber: @sbcv

Added subscriber: @sbcv

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Added subscribers: @ideasman42, @fclem

Added subscribers: @ideasman42, @fclem

This is because the callbacks needs a context which is NULL when using the viewport render (DST.draw_ctx.evil_C). And the viewport render cannot have a full context available that is needed to render all possible callbacks.

@ideasman42 Correct me if I'm wrong.

This is because the callbacks needs a context which is NULL when using the viewport render (`DST.draw_ctx.evil_C`). And the viewport render cannot have a full context available that is needed to render all possible callbacks. @ideasman42 Correct me if I'm wrong.
Author

In case this is not going to be fixed, is there currently any possibility to perform a joint rendering of elements of the GPU module and the 3D Viewport (with correct occlusion), which can be written to disk?

I tried the following approaches without success:
1.) GPU Offscreen rendering + OpenGL rendering:
Could not read the depth buffer of the OpenGL rendering => no correct occlusions
2.) GPU Offscreen rendering + Rendering the 3D View into a Texture
Could not read the depth buffer of the 3D View rendering => no correct occlusions
3.) Renderengine
The Renderengine did not draw cameras etc.

Am I missing something here, or is it just not possible?
Side note: Making a screenshot of the 3D view is not an option, since I want to use Blender's animation capabilities to render the scenes from multiple view points.

In case this is not going to be fixed, is there currently any possibility to perform a joint rendering of elements of the GPU module and the 3D Viewport (with correct occlusion), which can be written to disk? I tried the following approaches without success: 1.) GPU Offscreen rendering + OpenGL rendering: Could not read the depth buffer of the OpenGL rendering => no correct occlusions 2.) GPU Offscreen rendering + [Rendering the 3D View into a Texture](https://docs.blender.org/api/current/gpu.html#rendering-the-3d-view-into-a-texture) Could not read the depth buffer of the 3D View rendering => no correct occlusions 3.) [Renderengine ](https://docs.blender.org/api/current/bpy.types.RenderEngine.html) The Renderengine did not draw cameras etc. Am I missing something here, or is it just not possible? Side note: Making a screenshot of the 3D view is not an option, since I want to use Blender's animation capabilities to render the scenes from multiple view points.

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art

Added subscriber: @2046411367

Added subscriber: @2046411367
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:14:51 +01: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#77958
No description provided.