GLGraphicsOffScreen and seperate alpha for stereoscopic 3D (GlGraphics)
in
Contributed Library Questions
•
3 years ago
Hi All,
A question from relative newb: I'm trying to achieve the following:
draw left and right eye onto seperate textures using GLGraphicsOffScreen, than display them one on top of another using line interlaced masking (for my stereoscopic screen), and I think I'm stuck.
I don't feel fully ready to get into low-level GL calls yet, and GLGraphics seems like a good choice, I cant figure out however if it's possible to affect alpha only. Ideally I would draw my interlace pattern once and just 'freeze' alpha channel somehow, so following drawing methods ('line' and 'rect' mostly) would not affect the pattern.
The idea is that if later on I swich to a different displaying technique having both eyes in two offscreen buffers is not a bad starting point for further work but for now would just want to see what I'm doing on my 3D screen (which displays left and right eye in a row interlaced fashion)
I'm trying some dirty workarounds at the moment :
So the question is: is there anything I can use (term FBO sits in my head but I don't want to sound silly trying to put it into a sentence) that would keep my alpha and use it for masking the display of the second texture?
I'd rather leave my drawing to the library but if I need to learn manual GL now - that's what I'll have to do.
Am I even barking at the right tree?
Thanks a lot for any tips
A question from relative newb: I'm trying to achieve the following:
draw left and right eye onto seperate textures using GLGraphicsOffScreen, than display them one on top of another using line interlaced masking (for my stereoscopic screen), and I think I'm stuck.
I don't feel fully ready to get into low-level GL calls yet, and GLGraphics seems like a good choice, I cant figure out however if it's possible to affect alpha only. Ideally I would draw my interlace pattern once and just 'freeze' alpha channel somehow, so following drawing methods ('line' and 'rect' mostly) would not affect the pattern.
The idea is that if later on I swich to a different displaying technique having both eyes in two offscreen buffers is not a bad starting point for further work but for now would just want to see what I'm doing on my 3D screen (which displays left and right eye in a row interlaced fashion)
I'm trying some dirty workarounds at the moment :
- alphaImg=loadImage("alpha.jpg");
- texture1=loadImage("random_image.jpg");
- texture1.mask(alphaImg);
- texture1.loadPixels();
- texture2.putBuffer(texture1.pixels);
- texture2=glg1.getTexture();
- glg1.beginDraw();
- glg1.ellipse(random(0, glg1.width), random(0, glg1.height), random(10, 50), random(10, 50));
- glg1.endDraw();
So the question is: is there anything I can use (term FBO sits in my head but I don't want to sound silly trying to put it into a sentence) that would keep my alpha and use it for masking the display of the second texture?
I'd rather leave my drawing to the library but if I need to learn manual GL now - that's what I'll have to do.
Am I even barking at the right tree?
Thanks a lot for any tips
1