Black objects in OpenGL viewport
On 26/08/2017 at 02:38, xxxxxxxx wrote:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
one of functions of plugin I'm working on is automatic management of multiple materials and selections on polygonal objects.
The problem is when I add second material to object through plugin (with proper selection tags in the same step) and it is not the closest object to viewport camera position it is rendered completely black including all objects behind it in OpenGL perspective viewport.
This is how it should look like, screenshot with OpenGL off, Cube has multiple materials, objects were converted to polygonal meshes before attaching materials:
Same with OpenGL on:
And when I rotated camera around (cylinders are now in front of Cube) :
Rendering is broken only if materials contain textures.
Here is a link to test scene including textures, just open it and you'll see: http://assemblerbot.info/tmp/forums/opengl_problem.zip
I've been chasing this bug for few days but cannot find problem in my code. Since I found several reports of this particular bug on internet (usually in cinema R14) I'd like to ask what might cause it? I checked polygons, selection, uvmap and materials on my side and they looks good. Also it works without problems in OpenGL OFF mode.
On 28/08/2017 at 06:33, xxxxxxxx wrote:
certainly a strange issue. We tried on all systems available in SDK Team and we were not able to reproduce the issue. The scene looks just fine like in your first screenshot. With and without Enhanced OpenGL and also with several combinations of OpenGL features switched on and off.
Maybe you have hit some kind of incompatibility or bug with your graphics driver? Which GPU do you use? And what's the version of the driver? With this information I could maybe ask our support, if they are aware of issues in this combination.
On 28/08/2017 at 13:01, xxxxxxxx wrote:
I sometimes notice OpenGL doesn't initially load in textures for some reason. Manually pressing the Reload All Textures command in C4D always solves it for me and they then all appear. Perhaps you could try running that command on your scene to see if they re-appear or not.
Although it looks like you just rotated your scene and the objects at the back then turned black? If thats the case then its definitely not a texture loading issue at all. Possibly a driver issue.
On 31/08/2017 at 04:40, xxxxxxxx wrote:
I did some tests:
- on my home computer with core i7-920 and nVidia GTX 1050 Ti with newest drives on window 7 it works without problems.
- on work computer with core i7-3770 and build-in Intel HD 4000 even with newest drivers on windows 8 the bug is still there