Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : [2.0xx] How to set multiple render targets for a fragment shader?

$
0
0
Thanks for your response andres. I gave this a shot. However when I try to use the FrameBuffer class, I'm running into visibility issues for it's methods, fields and constructors. Is there a way around this or am I handling this in the wrong way perhaps?

PGraphicsCustom.java
  1. import processing.opengl.PGraphics3D;
  2. import processing.opengl.FrameBuffer;
  3. import processing.opengl.Texture;
  4.  
  5. public class PGraphicsCustom extends PGraphics3D {
  6.  
  7.   public PGraphicsCustom() {
  8.     super();
  9.   }
  10.  
  11.   public void initOffscreen() {
  12.     super.initOffscreen();
  13.    
  14.     // Error message: "The method release() from the type FrameBuffer is not visible"
  15.     // offscreenFramebuffer.release();
  16.    
  17.     // Error message: "The constructor FrameBuffer(...) is not visible"
  18.     // offscreenFramebuffer = new FrameBuffer(parent, texture.glWidth, texture.glHeight,
  19.        1, 2, 0, 0, false, false);
  20.    
  21.     Texture[] multiTex = new Texture[2];
  22.    
  23.     // Error message: "The field FrameBuffer.numColorBuffers is not visible"
  24.     // offscreenFramebuffer.numColorBuffers = 2;
  25.    
  26.     // Error message: "Wrong number of textures to set the color buffers."
  27.     // offscreenFramebuffer.setColorBuffers(multiTex);
  28.   }
  29. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles