Skip to main content
Participant
March 9, 2019
Question

OpenGL 3D primitives

  • March 9, 2019
  • 1 reply
  • 462 views

Hello, I'm trying to create a sample plugin for working with textured 3d primitive. I was able to create simple console applications using OpenGL (freeglut) library but i don't understand how to use SDK display functions in this case. Errors "No object file" are generated when i'm trying to paste some functions to "Render" and build solution.

Sphere example:

https://www.youtube.com/watch?time_continue=689&v=wuZT7qUtVf0

https://drive.google.com/file/d/0B3cZGRU99IhLSjBLTDc3U3cxNnM/view

AE CC+, x64, Windows, MVS, used Skeleton solution

How can i render 3D primitive using OpenGL (freeglut) library? Or can you advise other solutions / tutorials / examples?

Thanks!

This topic has been closed for replies.

1 reply

March 22, 2019

The After Effects plugin SDK still does not support OpenGL directly, at least not in the way you probably expected it to do.

The way AE plugins work is you get handed one or more pixel buffers by AE, containing the contents of the source layers. You are then expected to do something with these pixels and write them to the output buffer that is then used by AE to display the output as the processed output layer - no OpenGL or anything involved at this stage.

But if you want to use OpenGL, you have to create your own OpenGL context, then convert the source pixel buffers into textures, bind them to your context, then do the actual rendering/processing in OpenGL, then somehow get access the raw output from the OpenGL render surface and convert it back into a pixel buffer that you can hand to AE. This is usually done by either rendering the OpenGL output to a texture target and then read the pixels of that back into a regular memory buffer, or by accessing the backbuffer directly, Doing all of this you have to be extremely careful as After Effects has its own OpenGL context for UI acceleration and you need to make sure you are always rendering in your own context exclusively. This is rather advanced stuff and although there is the infamous GLator sample included with the SDK that does some of this, it is still quite flawed.