|
|
@ -97,6 +97,7 @@ public class FrameBuffer extends NativeObject { |
|
|
|
int id = -1; |
|
|
|
int id = -1; |
|
|
|
int slot = SLOT_UNDEF; |
|
|
|
int slot = SLOT_UNDEF; |
|
|
|
int face = -1; |
|
|
|
int face = -1; |
|
|
|
|
|
|
|
int layer = -1; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return The image format of the render buffer. |
|
|
|
* @return The image format of the render buffer. |
|
|
@ -160,6 +161,10 @@ public class FrameBuffer extends NativeObject { |
|
|
|
return "BufferTarget[format=" + format + "]"; |
|
|
|
return "BufferTarget[format=" + format + "]"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getLayer() { |
|
|
|
|
|
|
|
return this.layer; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -332,9 +337,9 @@ public class FrameBuffer extends NativeObject { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tex The color texture array to set. |
|
|
|
* @param tex The color texture array to set. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setColorTexture(TextureArray tex){ |
|
|
|
public void setColorTexture(TextureArray tex, int layer){ |
|
|
|
clearColorTargets(); |
|
|
|
clearColorTargets(); |
|
|
|
addColorTexture(tex); |
|
|
|
addColorTexture(tex, layer); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -391,7 +396,7 @@ public class FrameBuffer extends NativeObject { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tex The texture array to add. |
|
|
|
* @param tex The texture array to add. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addColorTexture(TextureArray tex) { |
|
|
|
public void addColorTexture(TextureArray tex, int layer) { |
|
|
|
if (id != -1) |
|
|
|
if (id != -1) |
|
|
|
throw new UnsupportedOperationException("FrameBuffer already initialized."); |
|
|
|
throw new UnsupportedOperationException("FrameBuffer already initialized."); |
|
|
|
|
|
|
|
|
|
|
@ -402,6 +407,7 @@ public class FrameBuffer extends NativeObject { |
|
|
|
colorBuf.slot = colorBufs.size(); |
|
|
|
colorBuf.slot = colorBufs.size(); |
|
|
|
colorBuf.tex = tex; |
|
|
|
colorBuf.tex = tex; |
|
|
|
colorBuf.format = img.getFormat(); |
|
|
|
colorBuf.format = img.getFormat(); |
|
|
|
|
|
|
|
colorBuf.layer = layer; |
|
|
|
|
|
|
|
|
|
|
|
colorBufs.add(colorBuf); |
|
|
|
colorBufs.add(colorBuf); |
|
|
|
} |
|
|
|
} |
|
|
@ -449,7 +455,20 @@ public class FrameBuffer extends NativeObject { |
|
|
|
depthBuf.tex = tex; |
|
|
|
depthBuf.tex = tex; |
|
|
|
depthBuf.format = img.getFormat(); |
|
|
|
depthBuf.format = img.getFormat(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void setDepthTexture(TextureArray tex, int layer){ |
|
|
|
|
|
|
|
if (id != -1) |
|
|
|
|
|
|
|
throw new UnsupportedOperationException("FrameBuffer already initialized."); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image img = tex.getImage(); |
|
|
|
|
|
|
|
checkSetTexture(tex, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
depthBuf = new RenderBuffer(); |
|
|
|
|
|
|
|
depthBuf.slot = img.getFormat().isDepthStencilFormat() ? SLOT_DEPTH_STENCIL : SLOT_DEPTH; |
|
|
|
|
|
|
|
depthBuf.tex = tex; |
|
|
|
|
|
|
|
depthBuf.format = img.getFormat(); |
|
|
|
|
|
|
|
depthBuf.layer = layer; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return The number of color buffers attached to this texture. |
|
|
|
* @return The number of color buffers attached to this texture. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|