No active OpenGL context on RenderEngine.render #78921

Closed
opened 2020-07-14 17:28:50 +02:00 by Miguel Pozo · 9 comments
Member

Could we get OpenGL working for F12 rendering on external render engines?

We're currently working on an OpenGL based render engine add-on. https://github.com/BlenderNPR/BEER

Viewport rendering works fine because when Blender calls the RenderEngine.view_draw function the OpenGL offscreen draw context is active, but there's no active context when RenderEngine.render (F12 render) is called.

I've tried to modify external_engine.c, taking eevee_engine.c as reference, to get OpenGL working on the render callback. But I got kind of lost.

@brecht @fclem @mano-wii

Could we get OpenGL working for F12 rendering on external render engines? We're currently working on an OpenGL based render engine add-on. https://github.com/BlenderNPR/BEER Viewport rendering works fine because when Blender calls the RenderEngine.view_draw function the OpenGL offscreen draw context is active, but there's no active context when RenderEngine.render (F12 render) is called. I've tried to modify external_engine.c, taking eevee_engine.c as reference, to get OpenGL working on the render callback. But I got kind of lost. @brecht @fclem @mano-wii
Author
Member

Added subscriber: @pragma37

Added subscriber: @pragma37
Brecht Van Lommel was assigned by Miguel Pozo 2020-07-14 17:36:12 +02:00
Author
Member

Added subscribers: @fclem, @mano-wii, @brecht

Added subscribers: @fclem, @mano-wii, @brecht
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

(Possibly) Related: #77958, #54638 & D6585

(Possibly) Related: #77958, #54638 & [D6585](https://archive.blender.org/developer/D6585)
Brecht Van Lommel removed their assignment 2020-07-14 22:31:42 +02:00

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

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

Feel free to submit a patch (even if it doesn't work at all and you have questions on how to proceed). But you can't create tasks here that you want other developers to work on.

https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

Feel free to submit a patch (even if it doesn't work at all and you have questions on how to proceed). But you can't create tasks here that you want other developers to work on. https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests
Author
Member

@EAW Thank you! #77958 is kind of similar.

@brecht I'm not asking any other developer to work on this. I'm literally just asking if this is an option.

Seems like it should be a somewhat trivial change so if it doensn't work already maybe there's a reason for it. (The offscreen context could be in use in another thread, for example)

I quoted the Render API and the GPU developers (https://wiki.blender.org/wiki/Modules) because I expected you could give me at least some basic information or point me in the right direction.

@EAW Thank you! #77958 is kind of similar. @brecht I'm not asking any other developer to work on this. I'm literally just asking if this is an option. Seems like it should be a somewhat trivial change so if it doensn't work already maybe there's a reason for it. (The offscreen context could be in use in another thread, for example) I quoted the Render API and the GPU developers (https://wiki.blender.org/wiki/Modules) because I expected you could give me at least some basic information or point me in the right direction.

For discussion there is https://devtalk.blender.org. A task assigned to a developer means the developer is expected to do the task.

This should be an option, with a flag on the render engine to indicate if an OpenGL context is needed by the renderer. We don't want to create an OpenGL context for renderers that don't need it.

DRW_render_to_image has the code for Eevee, initializing/deinitializing the OpenGL context at the start/end of the function. This code could be moved from the draw module to the render module, and Eevee and Workbench would then set the flag to request an OpenGL context.

For discussion there is https://devtalk.blender.org. A task assigned to a developer means the developer is expected to do the task. This should be an option, with a flag on the render engine to indicate if an OpenGL context is needed by the renderer. We don't want to create an OpenGL context for renderers that don't need it. `DRW_render_to_image` has the code for Eevee, initializing/deinitializing the OpenGL context at the start/end of the function. This code could be moved from the draw module to the render module, and Eevee and Workbench would then set the flag to request an OpenGL context.
Author
Member

In #78921#979150, @brecht wrote:
A task assigned to a developer means the developer is expected to do the task.

Noted, sorry for that.

I've submited a patch. D8305

> In #78921#979150, @brecht wrote: >A task assigned to a developer means the developer is expected to do the task. Noted, sorry for that. I've submited a patch. [D8305](https://archive.blender.org/developer/D8305)
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
3 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#78921
No description provided.