Namespaces

Variants
Actions

OpenGL Preview Window

From Cycling '74 Wiki
Revision as of 21:05, 12 September 2013 by Rob@robtherich.org (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Creating an OpenGL scene preview window is very easy to do with Max 6. You simply need to create two shared contexts (jit.window and jit.pwindow) and capture the contents of your scene to a texture with the jit.gl.node object. You can then display this captured texture on the preview window, and the main window using jit.gl.videoplane.

below is a patch illustrating these steps. make sure you set @shared 1 on your jit.pwindow and jit.window, to enable texture sharing between these two contexts.

-- Pasted Max Patch, click to expand. --

gl-preview1.png

UI objects

Using the UI objects with our scene preview, instead of the main window, requires some more work. Basically, we must know ahead of time what the size of our main window will be, and tell our gl.node to render a texture at those dimensions (instead of the default dimensions of the main window). This will allow us to add our gl.node to the preview context instead of the main context, but still output a texture at the proper resolution.

-- Pasted Max Patch, click to expand. --

gl-preview2.png