|
|
|
07-18-2010, 11:47 PM
|
#1
|
Human being with feelings
Join Date: May 2010
Location: Tx.
Posts: 32
|
Direct3D or OpenGL in a plugin?
I've looked around a little without finding a lot, but I figured you guys could give me a quick answer on the feasibility of this. I'd like to make a VST or a Reaper plugin that displays 3d graphics. D3D or OGL is fine since I'm familiar with both.
Is this doable at all? Windows only is fine (at least to start).
TIA!
|
|
|
07-19-2010, 11:28 AM
|
#2
|
Human being with feelings
Join Date: May 2010
Location: Tx.
Posts: 32
|
So, from what I've seen, JS's gfx_ lib doesn't look like it can do it nor can VSTGUI. Any other possibilities?
|
|
|
07-19-2010, 11:50 AM
|
#3
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,750
|
It's definitely possible (I did a proof of concept plugin for this years ago). It's not trivial though. You might want to look at lice_glbitmap for some guidance, though that code is not much more than a proof of concept itself.
I can't even really remember what this plugin was intended to do
Last edited by schwa; 07-19-2010 at 02:04 PM.
|
|
|
07-19-2010, 12:58 PM
|
#4
|
Human being with feelings
Join Date: May 2010
Location: Tx.
Posts: 32
|
Quote:
Originally Posted by schwa
It's definitely possible (I did a proof of concept plugin for this years ago). It's not trivial though. You might want to look at lice_glbitmap for some guidance, though that code is not much more than a proof of concept itself.
|
Cool. So it is a reaper plugin (I figured that would be the most likely route).
OK, I couldn't find "lice_glbitmap" specifically (found LICE__GetDC and LICE_CreateBitmap functions... looking for a type?), but it looks like this is roughly process:
- Get a handle (or pointer) to the drawing context of the plugin (or a bitmap created by it).
- Use windows API to do the d3d/ogl rendering and pass it the pointer to the context (or bitmap)
It's been a while since I've coded d3d, so the exacts maybe different, but is that basically the way you did it?
Quote:
I can't even really remember what this plugin was intended to do
|
Very nice! It pretty much looks like what I wanted to do. Draw a 3d surface ("terrain") of the entire song's spectrum so you can see what's going on at a glance. Also, having a plane (like a ceiling) that you can lower to certain peaks, for a reference, to compare to others (for example to compare chorus 1 to chorus 2).
|
|
|
07-19-2010, 01:07 PM
|
#5
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,750
|
That was a generic VST plugin, there wasn't anything Reaper-specific. It did more or less what you say, create an openGL context and bind it to the plugin's HWND.
lice_glbitmap.cpp is a file included with LICE, that handles mixing standard LICE and GDI drawing (and mouse capture, etc) with openGL, by managing an offscreen drawing context and copying data back and forth. It would only be interesting if you didn't want to do everything inside openGL.
|
|
|
07-19-2010, 02:06 PM
|
#6
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,750
|
White Tie found a copy of the actual working plugin ... here it is:
https://stash.reaper.fm/oldsb/957592/RubberSoul.dll
Left and right drag to move stuff around. I think this was the first VST I ever did, as well as the first thing I ever worked with White Tie on. Like I said it was just a proof of concept, it doesn't do anything but the display. Also it's probably horribly inefficient. But it does prove the concept!
|
|
|
07-19-2010, 03:16 PM
|
#7
|
Human being with feelings
Join Date: May 2010
Location: Tx.
Posts: 32
|
Quote:
Originally Posted by schwa
That was a generic VST plugin, there wasn't anything Reaper-specific. It did more or less what you say, create an openGL context and bind it to the plugin's HWND.
|
ok, even better
Quote:
lice_glbitmap.cpp is a file included with LICE, that handles mixing standard LICE and GDI drawing (and mouse capture, etc) with openGL
|
great, I'll check it out
Quote:
Originally Posted by schwa
White Tie found a copy of the actual working plugin ... here it is:
https://stash.reaper.fm/oldsb/957592/RubberSoul.dll
Left and right drag to move stuff around. I think this was the first VST I ever did, as well as the first thing I ever worked with White Tie on. Like I said it was just a proof of concept, it doesn't do anything but the display. Also it's probably horribly inefficient. But it does prove the concept!
|
scroll wheel zooms hopefully some optimizations, like vertex arrays and triangle lists, will boost it.
Good work, pretty cool!
|
|
|
07-22-2010, 10:44 PM
|
#8
|
Human being with feelings
Join Date: Jul 2010
Posts: 66
|
It sounds like you already have a good answer. But I might as well point out the Juce explicitly supports OpenGL, if you want to use Juce.
From their site: "OpenGL support makes it easy to have openGL running inside a Juce component".
But, as people have pointed out, associating gl with an HWND it not exactly black magic ;-)
|
|
|
07-22-2010, 10:59 PM
|
#9
|
Human being with feelings
Join Date: May 2010
Location: Tx.
Posts: 32
|
cool, thanks bruce. It looks like Juce would be helpful for ports (assuming I ever get to that stage).
hopefully I'll get some time soon to get on this project... damned 24 hr days
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:37 PM.
|