One of the main goals of new Viewport is to allow close integration of external engines in Blender.
I see two separate issues:
- allow to define render logic (calculating and passing required data to GLSL shader)
- allow to define shader Node System.
This patch contains the implementation of python binding for shader nodes. So it is designed to solve the second issue.
The main idea of this patch is to expose existing gpu C-API to Python. It will allow to write GLSL nodes by addon creators.
Note that expanded gpu API is not enough for full implementation of external engine capabilities (e.g. , SSS, transparency, glass shader, reflection). More information you can find here: https://wiki.blender.org/index.php/Dev:2.8/Source/Viewport/ExternalEngines#Python_API
The current state of the patch: https://wiki.blender.org/index.php/Shader_Pynodes_for_Blender_2.8
The patch includes temporary render engine called "PyGLSL". API is not complete and not confirmed yet, so implementation of "PyGLSL" is a good point for review start.
Sample file:
Green nodes are already rewritten with python.