Dev:2.8/Source/Viewport/ExternalEngines

提供: wiki
移動先: 案内検索

External Engines

There are a few changes that will be required to accommodate Cycles (and other render engines) into the draw manager.

  • Depsgraph
  • "Render to View" and "Render to Image"
  • Sets
  • Depth Buffer
  • Python API
  • GLSL Compatibility

Depsgraph

Instead of getting the list of objects to render from scene.bases or even the new scene_layer.object_bases we will get them from depsgraph.

In the case of F12 rendering, where multiple layers are available, we will call the engine multiple times, once per layer. Each call in this case will have its own depsgraph created on the fly passed through.

"Render to View" and "Render to Image"

Since we are no longer supporting the old "draw modes" (wire, solid, textured, ...) an engine like Cycles will always be in the former "Rendered" mode.

That means the engine can make the best of the situation and implement a separate faster drawing loop for when drawing to view. Apart from that the only difference between the two methods is their outputs.

The draw manager still needs changes to allow for image rendering (e.g., for Clay and Eevee F12), as well as view rendering (e.g., for Cycles) - see Depth Buffer below.

Sets

Sets (as known as background scenes) are part of the depsgraph, and passed to the engine as any other object. Those objects have a special flag value though, which can be inquired by the engine if required (the value is ob->base_flag & BASE_SET, but it's not exposed in the RNA yet).

Depth Buffer

Draw manager itself will have to generate the depth buffer when using the "render_to_view" method of the engine. This way we can mix the object mode engine and Cycles for example, for selection outlines.

Python API

We should be able to support a 100% Python define engine (e.g., blend4web). This needs a high-level design, still pending.

GLSL Compatibility

We will allow users to define their own materials with Eevee. However we also want GLSL fallback shaders for external engine materials. This design started as the PyNode GLSL API idea. However this needs considerable more thinking in order to support all aspects of those engines (e.g., SSS, transparency, glass shader, reflection).