I am getting a bit frustrated with my lack of progress in the past few days. I have been trying to render the Freestyle result within a renderbuffer (using a frame buffer object) but I keep getting buffer access problems. As these next images show, despite writing into the proper render buffer and reading from this same buffer, I seem to be accessing the back buffer:
I follow the standard frame buffer object usage procedures and the frame buffer status check does not reveal anything wrong. I first tried playing with different buffer storages, changing the buffer internal format. I also tried different reading/drawing buffer sources. I also implemented both render to renderbuffer and render to texture, but that didn’t change anything. I also tried instanciating a new GHOST window and using its context to render the image and then copying it back on the render layer. Unfortunately, I haven’t been able to have my created window invisible, for offscreen rendering. The method crashes when I set the destination for the Image Editor destination. I have to admit, I tried every possible combination…
For testing purposes, I wrote a GLUT-based program rendering to a texture and I got that working. When I transpose the same code in my rendering function in Blender, I don’t get the same results. I suspect that I am getting issues with GHOST. Unfortunately, I haven’t studied GHOST’s code in detail. I am lacking a thorough understanding of how the different pieces work together.
Like we mentioned in last week’s meeting, using renderbuffers is only a temporary measure to have render layers working. Freestyle will become OpenGL-free in the near future and I am wondering if I should continue in that direction. Removing SWIG and lib3ds seems like a more pressing issue. I’ll see with Jean-Luc what we should do about it. In the mean time, starting from tomorrow, I am working on getting rid of the SWIG dependency.