Eevee Offscreen rendering #61768

Closed
opened 2019-02-21 00:41:38 +01:00 by Jonas Dichelle · 40 comments
Contributor

System Information
Operating system: Windows 10
Graphics card: 2 x GTX 1070

Blender Version
Broken:
2.80, 1af810b4ff, blender2.8, 2019-02-20, as found on the splash screen

Short description of error

I'm trying to render the 3D View as a Texture in 2.8.
Everything seems a bit glitchy
When I'm in solid mode, it looks alright, but the background is black and the colors are a bit different.
image.png
In Wireframe mode the objects just appear black.
image.png
And when set to Eevee it only renders the outlines and overlays.
image.png

Here's a blend with the code:
code.blend

I hope this bug gets fixed.
Thanks in advance,
Jonas

**System Information** Operating system: Windows 10 Graphics card: 2 x GTX 1070 **Blender Version** Broken: 2.80, 1af810b4ff17, blender2.8, 2019-02-20, as found on the splash screen **Short description of error** I'm trying to render the 3D View as a Texture in 2.8. Everything seems a bit glitchy When I'm in solid mode, it looks alright, but the background is black and the colors are a bit different. ![image.png](https://archive.blender.org/developer/F6674285/image.png) In Wireframe mode the objects just appear black. ![image.png](https://archive.blender.org/developer/F6674295/image.png) And when set to Eevee it only renders the outlines and overlays. ![image.png](https://archive.blender.org/developer/F6674309/image.png) Here's a blend with the code: [code.blend](https://archive.blender.org/developer/F6674321/code.blend) I hope this bug gets fixed. Thanks in advance, Jonas
Author
Contributor

Added subscriber: @JonasDichelle

Added subscriber: @JonasDichelle

Added subscriber: @ZedDB

Added subscriber: @ZedDB

I do not have the drawing glitches. Only the color difference. I guess that the color difference is because of no color management. If you set the color managment display device to None it nearly matches the colors. So I'm guessing this is the reason for it.

Do you still get glitches if you download this dll and copying it so its located in the same directory as 'blender.exe' and run Blender normally?

I do not have the drawing glitches. Only the color difference. I guess that the color difference is because of no color management. If you set the color managment display device to `None` it nearly matches the colors. So I'm guessing this is the reason for it. Do you still get glitches if you download [this dll ](https://download.blender.org/opengl/software-emulation/windows64/opengl32.dll) and copying it so its located in the same directory as 'blender.exe' and run Blender normally?
Author
Contributor

Thank you, now it actually renders Eevee.
But now its very very slow and laggy. The background is also still black and the blender instance crashes after a while.
This happens even without the offscreen render
2019-02-21_18-22-58.mp4

Thank you, now it actually renders Eevee. But now its very very slow and laggy. The background is also still black and the blender instance crashes after a while. This happens even without the offscreen render [2019-02-21_18-22-58.mp4](https://archive.blender.org/developer/F6680214/2019-02-21_18-22-58.mp4)

That .dll forces blender to use software rendering. So the issue is with your GPU drivers it seems.
Are you running in SLI? If so, does it help if you turn off SLI? (Remove the .dll before testing again of course).

That .dll forces blender to use software rendering. So the issue is with your GPU drivers it seems. Are you running in SLI? If so, does it help if you turn off SLI? (Remove the .dll before testing again of course).
Author
Contributor

I dont have SLI enabled but it could be an issue with my GPUs.
Could there be something else besides SLI that causes this issue?

I dont have SLI enabled but it could be an issue with my GPUs. Could there be something else besides SLI that causes this issue?
Clément Foucault was assigned by Sebastian Parborg 2019-02-21 18:42:15 +01:00

Added subscriber: @fclem

Added subscriber: @fclem

@fclem any ideas?

@fclem any ideas?
Author
Contributor

Thanks :)

Thanks :)

Added subscriber: @MartinFrohlich

Added subscriber: @MartinFrohlich

Hi

I have been observing this behavior on two other window 10 machines with either one GTX 1080 Ti and a dual RTX 2080 Ti (no SLI). The way to reproduce:

https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture and execute it from the default project. set the viewport render method to ‘lookdev’ or ‘rendered’. It looks as if the buffer is not cleared for the next frame and only the overlays are drawn over the previous frame.

With my MacBook Pro (with AMD Radeon R9 M370X 2048 MB) it works as advertised and it seems even faster and responsive than on Windows with the much more powerfull GFX cards.

Blender version: blender-2.80 / 0ba143a1d6 / win64

Hi I have been observing this behavior on two other window 10 machines with either one GTX 1080 Ti and a dual RTX 2080 Ti (no SLI). The way to reproduce: https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture and execute it from the default project. set the viewport render method to ‘lookdev’ or ‘rendered’. It looks as if the buffer is not cleared for the next frame and only the overlays are drawn over the previous frame. With my MacBook Pro (with AMD Radeon R9 M370X 2048 MB) it works as advertised and it seems even faster and responsive than on Windows with the much more powerfull GFX cards. Blender version: blender-2.80 / 0ba143a1d675 / win64

Added subscriber: @BlandSauce

Added subscriber: @BlandSauce

The latest blender beta 06c4139a68 has an api change and the script from https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture throws now an error: Line 19 context.depsgraph : 'Context' object has no attribute:'depsgraph'.

The latest blender beta 06c4139a6833 has an api change and the script from https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture throws now an error: Line 19 context.depsgraph : 'Context' object has no attribute:'depsgraph'.

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker

The color management issue seems to have been fixed by @Jeroen-Bakker .

@JonasDichelle do you still have the glitches?

The color management issue seems to have been fixed by @Jeroen-Bakker . @JonasDichelle do you still have the glitches?
Author
Contributor

I no longer have the color management issues (Thank you! :) ) but the Eevee and Wireframe issues unfortunately are still happening. :( @fclem

I no longer have the color management issues (Thank you! :) ) but the Eevee and Wireframe issues unfortunately are still happening. :( @fclem

Ok, I got the script from https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture fixed:

replace

  projection_matrix = scene.camera.calc_matrix_camera(
      context.depsgraph, x=WIDTH, y=HEIGHT)

with

  projection_matrix = object.calc_matrix_camera(
      context.evaluated_depsgraph_get(), x=dWIDTH, y=dHEIGHT)

also the Docs for https://docs.blender.org/api/blender2.8/bpy.context.html need to be updated.

And I observe the same issue as @JonasDichelle in regards to eevee and wireframe..

Ok, I got the script from https://docs.blender.org/api/blender2.8/gpu.html#rendering-the-3d-view-into-a-texture fixed: replace ``` projection_matrix = scene.camera.calc_matrix_camera( context.depsgraph, x=WIDTH, y=HEIGHT) ``` with ``` projection_matrix = object.calc_matrix_camera( context.evaluated_depsgraph_get(), x=dWIDTH, y=dHEIGHT) ``` also the Docs for https://docs.blender.org/api/blender2.8/bpy.context.html need to be updated. And I observe the same issue as @JonasDichelle in regards to eevee and wireframe..
Member

Hi just checking and the issue that is left (to my knowing) is that eevee background is black. There is also the case that the World Space Cavity pattern in workbench uses only a single pattern, but this is also the case for final rendering.... The TAA samples are fine

image.png

Hi just checking and the issue that is left (to my knowing) is that eevee background is black. There is also the case that the World Space Cavity pattern in workbench uses only a single pattern, but this is also the case for final rendering.... The TAA samples are fine ![image.png](https://archive.blender.org/developer/F7088010/image.png)
Member

The change for the cavity shader is D5021: Workbench: World Space Cavity

The change for the cavity shader is [D5021: Workbench: World Space Cavity](https://archive.blender.org/developer/D5021)
Clément Foucault was unassigned by Jeroen Bakker 2019-06-05 19:26:13 +02:00
Jeroen Bakker self-assigned this 2019-06-05 19:26:13 +02:00
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Sorry to disagree, but the issue is not resolved. I just tested the latest blender 2.80 (june 6th) with windows 10 and a NVidia GTX 1080 Ti and I still have the effect Jonas described. ( when set to Eevee it only renders the outlines and overlays.)

Sorry to disagree, but the issue is not resolved. I just tested the latest blender 2.80 (june 6th) with windows 10 and a NVidia GTX 1080 Ti and I still have the effect Jonas described. ( when set to Eevee it only renders the outlines and overlays.)

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

The latest build does not include the fix yet, tomorrow's build will.

The latest build does not include the fix yet, tomorrow's build will.

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

As far as I can tell this issue is not resolved. Still the same effect with Windows 10 and blender build 749d53.. from the 7th june.

Tested with

Windows 10 pro
Version 1709

GeFroce GTX 1080 Ti
Driver 391.25

As far as I can tell this issue is not resolved. Still the same effect with Windows 10 and blender build 749d53.. from the 7th june. Tested with Windows 10 pro Version 1709 GeFroce GTX 1080 Ti Driver 391.25
Member

Then we are not able to reproduce

image.png

Please provide us with more information how we can reproduce the issue, so we can help. Let's start with your system info Can you upload the system info from Blender help menu? Also make sure you test with the latest graphical drivers.

Then we are not able to reproduce ![image.png](https://archive.blender.org/developer/F7094376/image.png) Please provide us with more information how we can reproduce the issue, so we can help. Let's start with your system info Can you upload the system info from Blender help menu? Also make sure you test with the latest graphical drivers.

here are my system infos: system-info.txt

here are my system infos: [system-info.txt](https://archive.blender.org/developer/F7094431/system-info.txt)

and here my issue:

blenderIssue.PNG

and here my issue: ![blenderIssue.PNG](https://archive.blender.org/developer/F7094442/blenderIssue.PNG)
Member

Have you tried with the latest drivers? It is interested to know on which configurations this issue happens and which one not.

Have you tried with the latest drivers? It is interested to know on which configurations this issue happens and which one not.

After I uploaded my system-info, I installed the latest nvidia drivers (430.86) for my hardware, and I still see the same effect.

After I uploaded my system-info, I installed the latest nvidia drivers (430.86) for my hardware, and I still see the same effect.
Jeroen Bakker was unassigned by Clément Foucault 2019-06-09 11:27:10 +02:00
Clément Foucault self-assigned this 2019-06-09 11:27:10 +02:00

I can repro on nvidia+linux.

I can repro on nvidia+linux.

Added subscriber: @anteaterho

Added subscriber: @anteaterho

Hi, I have same problem as martin(rendering/LookDev with offscreen rendering is not working).

I checked this problem with different machine and it had same problem.

Those machines only one condition was same.

They are has nvidia GTX graphic cards(1080ti, 980ti, 1060m).

Is this a problem only on the nvidia gtx graphics card?

Hi, I have same problem as martin(rendering/LookDev with offscreen rendering is not working). I checked this problem with different machine and it had same problem. Those machines only one condition was same. They are has nvidia GTX graphic cards(1080ti, 980ti, 1060m). Is this a problem only on the nvidia gtx graphics card?

Ok I finally found the issue. The issue is caused by the GPUOffscreen not being created in the same GL context as the one in which it is used for drawing. Framebuffers are not shared between contexts. So appart from creating it in the right context (which, if i'm not mistaken, is not possible with the current API) we can only do a subsystem under the hood with one framebuffer per context and use the right one depending on active context. This is the only flexible way of doing it that won't complicate the pyGPU API usage.

Ok I finally found the issue. The issue is caused by the GPUOffscreen not being created in the same GL context as the one in which it is used for drawing. Framebuffers are not shared between contexts. So appart from creating it in the right context (which, if i'm not mistaken, is not possible with the current API) we can only do a subsystem under the hood with one framebuffer per context and use the right one depending on active context. This is the only flexible way of doing it that won't complicate the pyGPU API usage.

Nice. I am looking forward to your fix. Though its my ignorance of the problem you are facing and knowing your expertise that lets me trust your judgment.

Aware this is not the place to do support, I do have a request for the documentation (https://docs.blender.org/api/blender2.8/gpu.htm):

With the script we are testing this issue we need to toggle to the camera view if we want to render all the nice postprocessing goodies of EEVEE to texture. I assume it has something to do with the

offscreen.draw_view3d(

function, where the script passes the current context info to the function. I just couldn't figure out how to define my own context to render-to-texture independently of the viewport settings.

my request would be to add another example that shows how to do this.

Nice. I am looking forward to your fix. Though its my ignorance of the problem you are facing and knowing your expertise that lets me trust your judgment. Aware this is not the place to do support, I do have a request for the documentation (https://docs.blender.org/api/blender2.8/gpu.htm): With the script we are testing this issue we need to toggle to the camera view if we want to render all the nice postprocessing goodies of EEVEE to texture. I assume it has something to do with the ``` offscreen.draw_view3d( ``` function, where the script passes the current context info to the function. I just couldn't figure out how to define my own context to render-to-texture independently of the viewport settings. my request would be to add another example that shows how to do this.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by 5e626e7664

This issue was referenced by 5e626e76645905e71182a9379f0bf86ae3010203

I can confirm the fix on a RTX 2080 Ti and a GTX 1080 Ti.

Very much appreciated.

I can confirm the fix on a RTX 2080 Ti and a GTX 1080 Ti. Very much appreciated.
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
9 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#61768
No description provided.