Color management via RenderEngine.bind_display_space_shader in 2.80

In 2.79 you could use Blender’s built in color management for viewport rendering via something like (in the RenderEngine)

if self.support_display_space_shader(context.scene):
            self.bind_display_space_shader(context.scene)

        # draw some OpenGL stuff

        if self.support_display_space_shader(context.scene):
            self.unbind_display_space_shader()

This appears to not have any effect in Blender 2.80. Is this expected? Or a bug? Or some other preferred way?

Bumping this thread @brecht any input?

We need to update the documentation for this. The issue is that we switched to OpenGL core profile, which means there are no more builtin position and texture coordinate attributes and no immediate mode.

You can look at the Cycles code for an example.
https://developer.blender.org/diffusion/B/browse/master/intern/cycles/device/device.cpp$240

The shader expects 2 attributes pos and texCoord, each of type float[2] with same values as the old position and texture coordinates.

I guess that makes sense about the shader. However what does this mean for a rendering addon calling from python? We have to set up a similar shader in our BGL code? rather than use that simple call to bind the old shader? Not a horrible issue, just want to be clear on the way forward.

Also if documentation was made clear on this that would be great.

1 Like

I’ve updated the docs now, docs.blender.org will be auto updated soon:
https://developer.blender.org/rB337eb8c1de4c57c34520b467d79779153335eecb

CC @lvxejay

1 Like

Thanks for this update, much appreciated!

Perfect! Thanks. (adding up to 20 chars)

Thanks for this @brecht!