Revision 12f9e4bb
Added by Leszek Koltunski almost 6 years ago
src/main/java/org/distorted/library/main/DistortedFramebuffer.java | ||
---|---|---|
28 | 28 |
* User is able to create offscreen FBOs and both a) render to them b) use their COLOR0 attachment as |
29 | 29 |
* an input texture. Attaching Depths and/or Stencils is also possible. |
30 | 30 |
*/ |
31 |
public class DistortedFramebuffer extends DistortedOutputSurface implements DistortedInputSurface
|
|
31 |
public class DistortedFramebuffer extends DistortedOutputSurface |
|
32 | 32 |
{ |
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
250 | 250 |
super(width,height,NOT_CREATED_YET,1,numcolors,depthStencil,NOT_CREATED_YET,TYPE_USER); |
251 | 251 |
} |
252 | 252 |
|
253 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
254 |
/** |
|
255 |
* Bind the underlying rectangle of pixels as a OpenGL Texture. |
|
256 |
* |
|
257 |
* @return <code>true</code> if successful. |
|
258 |
*/ |
|
259 |
public boolean setAsInput() |
|
260 |
{ |
|
261 |
if( mColorH[0]>0 ) |
|
262 |
{ |
|
263 |
GLES31.glActiveTexture(GLES31.GL_TEXTURE0); |
|
264 |
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, mColorH[0]); |
|
265 |
return true; |
|
266 |
} |
|
267 |
|
|
268 |
return false; |
|
269 |
} |
|
270 |
|
|
271 | 253 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
272 | 254 |
/** |
273 | 255 |
* Bind the underlying rectangle of pixels as a OpenGL Texture. |
Also available in: Unified diff
a mix of two changes:
1) remove the DistortedInputSurface interface (now every Surface is Input)
2) make the OIT SSBO self-adjustable in size