Material preview in viewport using OpenGL [SOLVED]

On 29/09/2016 at 06:39, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   16 
Platform:   Windows  ;   
Language(s) :     C++  ;


Is it possible to get the viewport's Open GL context to be able to render material previews directly in viewport?

At the moment I am sending my material preview scenes to my custom network renderer and after waiting for the result I display it line after line.
It would be much faster and easier if I could render this simple scene directly in viewport but I couldn't find this specific thing in the documentation.

Thank you in advance!

On 30/09/2016 at 08:27, xxxxxxxx wrote:

Hi Rico, thanks for writing us.

With reference to your request to properly support you, I need some additional details about your intended workflow and what you're trying to achieve.
From your request it's not 100% clear, when talking about "material preview", if you mean creating a material thumbnail for the Material Manager or if you intend to create a the material in viewport as it would be seen once rendered by the offline engine or, in the end, if you just want to show a material preview scene in viewport during an auto-refining rendering process.
In the meanwhile, I invite you to take a look at the gl_material shader example available here which covers some aspects regarding showing OpenGL material in viewport and might be helpful to shed light on the topic pointed but please be aware this is a pretty undocumented part of the API and the support will probably rather limited.
Best, Riccardo

On 02/10/2016 at 23:26, xxxxxxxx wrote:

Thank you for your response Riccardo!

I will take a look at your example and let you know wether it contains the information I was looking for.

All the best, Rico