Project

General

Profile

Download (24.3 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / main / DistortedNode.java @ 11845a9e

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// Distorted is free software: you can redistribute it and/or modify                             //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Distorted is distributed in the hope that it will be useful,                                  //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.library.main;
21

    
22
import android.opengl.GLES31;
23

    
24
import org.distorted.library.mesh.MeshBase;
25

    
26
import java.util.ArrayList;
27
import java.util.Collections;
28

    
29
///////////////////////////////////////////////////////////////////////////////////////////////////
30
/**
31
 * Class which represents a Node in a Tree of (InputSurface,Mesh,Effects) triplets.
32
 * <p>
33
 * Having organized such sets into a Tree, we can then render any Node to any OutputSurface.
34
 * That recursively renders the set held in the Node and all its children.
35
 * <p>
36
 * The class takes special care to only render identical sub-trees once. Each Node holds a reference
37
 * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
38
 * will point to the same NodeData; only the first of this is rendered (mData.numRender!).
39
 */
40
public class DistortedNode implements DistortedChildrenList.Parent
41
  {
42
  private MeshBase mMesh;
43
  private DistortedEffects mEffects;
44
  private DistortedSurface mSurface;
45
  private DistortedRenderState mState;
46
  private DistortedNodeData mData;
47
  private DistortedChildrenList mChildren;
48
  private DistortedChildrenList.Parent mParent;
49

    
50
  private int mFboW, mFboH, mFboDepthStencil;
51
  private boolean mRenderWayOIT;
52

    
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

    
55
  public void markForDeletion()
56
    {
57
    if( mData.removeData() )
58
      {
59
      mData.mFBO.markForDeletion();
60
      mData.mFBO = null;
61
      }
62

    
63
    mEffects.removeNode(this);
64
    }
65

    
66
///////////////////////////////////////////////////////////////////////////////////////////////////
67

    
68
  private ArrayList<Long> generateIDList()
69
    {
70
    ArrayList<Long> ret = new ArrayList<>();
71
    int numChildren = mChildren.getNumChildren();
72

    
73
    if( numChildren==0 )
74
      {
75
      // add a negative number so this leaf never gets confused with a internal node
76
      // with a single child that happens to have ID identical to some leaf's Effects ID.
77
      ret.add(-mEffects.getID());
78
      }
79
    else
80
      {
81
      DistortedNode node;
82
   
83
      for(int i=0; i<numChildren; i++)
84
        {
85
        node = mChildren.getChild(i);
86
        ret.add(node.mData.ID);
87
        }
88

    
89
      // A bit questionable decision here - we are sorting the children IDs, which means
90
      // that order in which we draw the children is going to be undefined (well, this is not
91
      // strictly speaking true - when rendering, if no postprocessing and isomorphism are
92
      // involved, we *DO* render the children in order they were added; if however there
93
      // are two internal nodes with the same list of identical children, just added in a
94
      // different order each time, then we consider them isomorphic, i.e. identical and only
95
      // render the first one. If then two children of such 'pseudo-isomorphic' nodes are at
96
      // exactly the same Z-height this might result in some unexpected sights).
97
      //
98
      // Reason: with the children being sorted by postprocessing buckets, the order is
99
      // undefined anyway (although only when postprocessing is applied).
100
      //
101
      // See the consequences in the 'Olympic' app - remove a few leaves and add them back in
102
      // different order. You will see the number of renders go back to the original 15.
103
      Collections.sort(ret);
104
      }
105

    
106
    ret.add( 0, mSurface.getID() );
107

    
108
    return ret;
109
    }
110

    
111
///////////////////////////////////////////////////////////////////////////////////////////////////
112
/**
113
 * This is not really part of the public API. Has to be public only because it is a part of the
114
 * DistortedChildrenList.Parent interface.
115
 *
116
 * @y.exclude
117
 */
118
  public void adjustIsomorphism()
119
    {
120
    DistortedNodeData newData = DistortedNodeData.returnData(generateIDList());
121
    boolean deleteOldFBO = mData.removeData();
122
    boolean createNewFBO = (mChildren.getNumChildren()>0 && newData.mFBO==null);
123

    
124
    if( deleteOldFBO && createNewFBO )
125
      {
126
      newData.mFBO = mData.mFBO;
127
      }
128
    else if( deleteOldFBO )
129
      {
130
      mData.mFBO.markForDeletion();
131
      mData.mFBO = null;
132
      }
133
    else if( createNewFBO )
134
      {
135
      newData.mFBO = allocateNewFBO();
136
      }
137

    
138
    mData = newData;
139

    
140
    if( mParent!=null ) mParent.adjustIsomorphism();
141
    }
142

    
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144
/**
145
 * This is not really part of the public API. Has to be public only because it is a part of the
146
 * DistortedChildrenList.Parent interface.
147
 *
148
 * @y.exclude
149
 */
150
  public DistortedChildrenList getChildren()
151
    {
152
    return mChildren;
153
    }
154

    
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156
// return the total number of render calls issued
157

    
158
  int drawNoBlend(long currTime, DistortedOutputSurface surface)
159
    {
160
    DistortedSurface input = getInternalSurface();
161

    
162
    if( input.setAsInput() )
163
      {
164
      mState.apply();
165
      GLES31.glDisable(GLES31.GL_BLEND);
166
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
167
      GLES31.glEnable(GLES31.GL_BLEND);
168
      return 1;
169
      }
170

    
171
    return 0;
172
    }
173

    
174
///////////////////////////////////////////////////////////////////////////////////////////////////
175
// Use the Order Independent Transparency method to draw a non-postprocessed child.
176

    
177
  int drawOIT(long currTime, DistortedOutputSurface surface)
178
    {
179
    DistortedSurface input = getInternalSurface();
180

    
181
    if( input.setAsInput() )
182
      {
183
      mState.apply();
184
      mEffects.drawPrivOIT(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
185
      return 1;
186
      }
187

    
188
    return 0;
189
    }
190

    
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192
// return the total number of render calls issued
193

    
194
  int draw(long currTime, DistortedOutputSurface surface)
195
    {
196
    DistortedSurface input = getInternalSurface();
197

    
198
    if( input.setAsInput() )
199
      {
200
      mState.apply();
201
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
202
      return 1;
203
      }
204

    
205
    return 0;
206
    }
207

    
208
///////////////////////////////////////////////////////////////////////////////////////////////////
209
// return the total number of render calls issued
210

    
211
  int renderRecursive(long currTime)
212
    {
213
    int numRenders = 0;
214
    int numChildren = mChildren.getNumChildren();
215

    
216
    if( numChildren>0 && mData.notRenderedYetAtThisTime(currTime) )
217
      {
218
      for (int i=0; i<numChildren; i++)
219
        {
220
        numRenders += mChildren.getChild(i).renderRecursive(currTime);
221
        }
222

    
223
      if( mData.mFBO==null ) mData.mFBO = allocateNewFBO();
224
      mData.mFBO.setAsOutput(currTime);
225

    
226
      if( mSurface.setAsInput() )
227
        {
228
        numRenders++;
229
        DistortedEffects.blitPriv(mData.mFBO);
230
        }
231

    
232
      numRenders += mData.mFBO.renderChildren(currTime,numChildren,mChildren,0, mRenderWayOIT);
233
      }
234

    
235
    return numRenders;
236
    }
237

    
238
///////////////////////////////////////////////////////////////////////////////////////////////////
239

    
240
  private DistortedFramebuffer allocateNewFBO()
241
    {
242
    int width  = mFboW <= 0 ? mSurface.getWidth()  : mFboW;
243
    int height = mFboH <= 0 ? mSurface.getHeight() : mFboH;
244
    return new DistortedFramebuffer(1,mFboDepthStencil, DistortedSurface.TYPE_TREE, width, height);
245
    }
246

    
247
///////////////////////////////////////////////////////////////////////////////////////////////////
248

    
249
  void setParent(DistortedChildrenList.Parent parent)
250
    {
251
    mParent = parent;
252
    }
253

    
254
///////////////////////////////////////////////////////////////////////////////////////////////////
255

    
256
  void sort()
257
    {
258
    if( mParent!=null )
259
      {
260
      DistortedChildrenList siblings = mParent.getChildren();
261
      siblings.removeChild(this);
262
      siblings.addSortingByBuckets(this);
263
      }
264
    }
265

    
266
///////////////////////////////////////////////////////////////////////////////////////////////////
267

    
268
  EffectQueuePostprocess getPostprocessQueue()
269
    {
270
    return mEffects.getPostprocess();
271
    }
272

    
273
///////////////////////////////////////////////////////////////////////////////////////////////////
274
// PUBLIC API
275
///////////////////////////////////////////////////////////////////////////////////////////////////
276
/**
277
 * Constructs new Node.
278
 *     
279
 * @param surface InputSurface to put into the new Node.
280
 * @param effects DistortedEffects to put into the new Node.
281
 * @param mesh MeshBase to put into the new Node.
282
 */
283
  public DistortedNode(DistortedSurface surface, DistortedEffects effects, MeshBase mesh)
284
    {
285
    mSurface       = surface;
286
    mEffects       = effects;
287
    mMesh          = mesh;
288
    mState         = new DistortedRenderState();
289
    mChildren      = new DistortedChildrenList(this);
290
    mParent        = null;
291
    mRenderWayOIT  = false;
292

    
293
    mFboW            = 0;  // i.e. take this from
294
    mFboH            = 0;  // mSurface's dimensions
295
    mFboDepthStencil = DistortedFramebuffer.DEPTH_NO_STENCIL;
296

    
297
    mData = DistortedNodeData.returnData(generateIDList());
298
    mEffects.newNode(this);
299
    }
300

    
301
///////////////////////////////////////////////////////////////////////////////////////////////////  
302
/**
303
 * Copy-constructs new Node from another Node.
304
 *     
305
 * @param node The DistortedNode to copy data from.
306
 * @param flags bit field composed of a subset of the following:
307
 *        {@link Distorted#CLONE_SURFACE},  {@link Distorted#CLONE_MATRIX}, {@link Distorted#CLONE_VERTEX},
308
 *        {@link Distorted#CLONE_FRAGMENT} and {@link Distorted#CLONE_CHILDREN}.
309
 *        For example flags = CLONE_SURFACE | CLONE_CHILDREN.
310
 */
311
  public DistortedNode(DistortedNode node, int flags)
312
    {
313
    mEffects      = new DistortedEffects(node.mEffects,flags);
314
    mMesh         = node.mMesh;
315
    mState        = new DistortedRenderState();
316
    mParent       = null;
317
    mRenderWayOIT = false;
318

    
319
    mFboW            = node.mFboW;
320
    mFboH            = node.mFboH;
321
    mFboDepthStencil = node.mFboDepthStencil;
322

    
323
    if( (flags & Distorted.CLONE_SURFACE) != 0 )
324
      {
325
      mSurface = node.mSurface;
326
      }
327
    else
328
      {
329
      int w = node.mSurface.getWidth();
330
      int h = node.mSurface.getHeight();
331

    
332
      if( node.mSurface instanceof DistortedTexture )
333
        {
334
        mSurface = new DistortedTexture(w,h, DistortedSurface.TYPE_TREE);
335
        }
336
      else if( node.mSurface instanceof DistortedFramebuffer )
337
        {
338
        int depthStencil = DistortedFramebuffer.NO_DEPTH_NO_STENCIL;
339

    
340
        if( ((DistortedFramebuffer) node.mSurface).hasDepth() )
341
          {
342
          boolean hasStencil = ((DistortedFramebuffer) node.mSurface).hasStencil();
343
          depthStencil = (hasStencil ? DistortedFramebuffer.BOTH_DEPTH_STENCIL:DistortedFramebuffer.DEPTH_NO_STENCIL);
344
          }
345

    
346
        mSurface = new DistortedFramebuffer(1,depthStencil,DistortedSurface.TYPE_TREE,w,h);
347
        }
348
      }
349

    
350
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )
351
      {
352
      mChildren = node.mChildren;
353
      }
354
    else
355
      {
356
      mChildren = new DistortedChildrenList(this);
357
      }
358

    
359
    mData = DistortedNodeData.returnData(generateIDList());
360
    mEffects.newNode(this);
361
    }
362

    
363
///////////////////////////////////////////////////////////////////////////////////////////////////
364
  /**
365
   * When rendering this Node, should we use the Order Independent Transparency render more?
366
   * <p>
367
   * There are two modes of rendering: the fast 'normal' way, which however renders transparent
368
   * fragments in different ways depending on which fragments get rendered first, or the slower
369
   * 'oit' way, which renders transparent fragments correctly regardless of their order.
370
   *
371
   * @param oit True if we want to render more slowly, but in a way which accounts for transparency.
372
   */
373
  public void setOrderIndependentTransparency(boolean oit)
374
    {
375
    mRenderWayOIT = oit;
376
    }
377

    
378
///////////////////////////////////////////////////////////////////////////////////////////////////
379
  /**
380
   * When rendering this Node, should we use the Order Independent Transparency render more?
381
   * <p>
382
   * There are two modes of rendering: the fast 'normal' way, which however renders transparent
383
   * fragments in different ways depending on which fragments get rendered first, or the slower
384
   * 'oit' way, which renders transparent fragments correctly regardless of their order.
385
   *
386
   * @param oit True if we want to render more slowly, but in a way which accounts for transparency.
387
   * @param initialSize Initial number of transparent fragments we expect, in screenfulls.
388
   *                    I.e '1.0' means 'the scene we are going to render contains about 1 screen
389
   *                    worth of transparent fragments'. Valid values: 0.0 &lt; initialSize &lt; 10.0
390
   *                    Even if you get this wrong, the library will detect that there are more
391
   *                    transparent fragments than it has space for and readjust its internal buffers,
392
   *                    but only after a few frames during which one will probably see missing objects.
393
   */
394
  public void setOrderIndependentTransparency(boolean oit, float initialSize)
395
    {
396
    mRenderWayOIT = oit;
397

    
398
    if( initialSize>0.0f && initialSize<10.0f )
399
      DistortedEffects.setSSBOSize(initialSize);
400
    }
401

    
402
///////////////////////////////////////////////////////////////////////////////////////////////////
403
/**
404
 * Adds a new child to the last position in the list of our Node's children.
405
 * <p>
406
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
407
 * DistortedMaster (by calling doWork())
408
 *
409
 * @param node The new Node to add.
410
 */
411
  public void attach(DistortedNode node)
412
    {
413
    mChildren.attach(node);
414
    }
415

    
416
///////////////////////////////////////////////////////////////////////////////////////////////////
417
/**
418
 * Adds a new child to the last position in the list of our Node's children.
419
 * <p>
420
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
421
 * DistortedMaster (by calling doWork())
422
 *
423
 * @param surface InputSurface to initialize our child Node with.
424
 * @param effects DistortedEffects to initialize our child Node with.
425
 * @param mesh MeshBase to initialize our child Node with.
426
 * @return the newly constructed child Node, or null if we couldn't allocate resources.
427
 */
428
  public DistortedNode attach(DistortedSurface surface, DistortedEffects effects, MeshBase mesh)
429
    {
430
    return mChildren.attach(surface,effects,mesh);
431
    }
432

    
433
///////////////////////////////////////////////////////////////////////////////////////////////////
434
/**
435
 * Removes the first occurrence of a specified child from the list of children of our Node.
436
 * <p>
437
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
438
 * DistortedMaster (by calling doWork())
439
 *
440
 * @param node The Node to remove.
441
 */
442
  public void detach(DistortedNode node)
443
    {
444
    mChildren.detach(node);
445
    }
446

    
447
///////////////////////////////////////////////////////////////////////////////////////////////////
448
/**
449
 * Removes the first occurrence of a specified child from the list of children of our Node.
450
 * <p>
451
 * A bit questionable method as there can be many different Nodes attached as children, some
452
 * of them having the same Effects but - for instance - different Mesh. Use with care.
453
 * <p>
454
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
455
 * DistortedMaster (by calling doWork())
456
 *
457
 * @param effects DistortedEffects to remove.
458
 */
459
  public void detach(DistortedEffects effects)
460
    {
461
    mChildren.detach(effects);
462
    }
463

    
464
///////////////////////////////////////////////////////////////////////////////////////////////////
465
/**
466
 * Removes all children Nodes.
467
 * <p>
468
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
469
 * DistortedMaster (by calling doWork())
470
 */
471
  public void detachAll()
472
    {
473
    mChildren.detachAll();
474
    }
475

    
476
///////////////////////////////////////////////////////////////////////////////////////////////////
477
/**
478
 * Returns the DistortedEffects object that's in the Node.
479
 * 
480
 * @return The DistortedEffects contained in the Node.
481
 */
482
  public DistortedEffects getEffects()
483
    {
484
    return mEffects;
485
    }
486

    
487
///////////////////////////////////////////////////////////////////////////////////////////////////
488
/**
489
 * Returns the DistortedSurface object that's in the Node.
490
 *
491
 * @return The DistortedSurface contained in the Node.
492
 */
493
  public DistortedSurface getSurface()
494
    {
495
    return mSurface;
496
    }
497

    
498
///////////////////////////////////////////////////////////////////////////////////////////////////
499
  /**
500
   * Returns the DistortedSurface object that's in the Node.
501
   *
502
   * @return The DistortedSurface contained in the Node (if a leaf), or the FBO (if an internal Node)
503
   */
504
  public DistortedSurface getInternalSurface()
505
    {
506
    return mChildren.getNumChildren()==0 ? mSurface : mData.mFBO;
507
    }
508

    
509
///////////////////////////////////////////////////////////////////////////////////////////////////
510
/**
511
 * Returns the Mesh object that's in the Node.
512
 *
513
 * @return Mesh contained in the Node.
514
 */
515
  public MeshBase getMesh()
516
    {
517
    return mMesh;
518
    }
519

    
520
///////////////////////////////////////////////////////////////////////////////////////////////////
521
/**
522
 * Resizes the DistortedFramebuffer object that we render this Node to.
523
 */
524
  public void resize(int width, int height)
525
    {
526
    mFboW = width;
527
    mFboH = height;
528

    
529
    if ( mData.mFBO !=null )
530
      {
531
      // TODO: potentially allocate a new NodeData if we have to
532
      mData.mFBO.resize(width,height);
533
      }
534
    }
535

    
536
///////////////////////////////////////////////////////////////////////////////////////////////////
537
/**
538
 * Enables/disables DEPTH and STENCIL buffers in the Framebuffer object that we render this Node to.
539
 */
540
  public void enableDepthStencil(int depthStencil)
541
    {
542
    mFboDepthStencil = depthStencil;
543

    
544
    if ( mData.mFBO !=null )
545
      {
546
      // TODO: potentially allocate a new NodeData if we have to
547
      mData.mFBO.enableDepthStencil(depthStencil);
548
      }
549
    }
550

    
551
///////////////////////////////////////////////////////////////////////////////////////////////////
552
// APIs that control how to set the OpenGL state just before rendering this Node.
553
///////////////////////////////////////////////////////////////////////////////////////////////////
554
/**
555
 * When rendering this Node, use ColorMask (r,g,b,a).
556
 *
557
 * @param r Write to the RED color channel when rendering this Node?
558
 * @param g Write to the GREEN color channel when rendering this Node?
559
 * @param b Write to the BLUE color channel when rendering this Node?
560
 * @param a Write to the ALPHA channel when rendering this Node?
561
 */
562
  @SuppressWarnings("unused")
563
  public void glColorMask(boolean r, boolean g, boolean b, boolean a)
564
    {
565
    mState.glColorMask(r,g,b,a);
566
    }
567

    
568
///////////////////////////////////////////////////////////////////////////////////////////////////
569
/**
570
 * When rendering this Node, switch on writing to Depth buffer?
571
 *
572
 * @param mask Write to the Depth buffer when rendering this Node?
573
 */
574
  @SuppressWarnings("unused")
575
  public void glDepthMask(boolean mask)
576
    {
577
    mState.glDepthMask(mask);
578
    }
579

    
580
///////////////////////////////////////////////////////////////////////////////////////////////////
581
/**
582
 * When rendering this Node, which bits of the Stencil buffer to write to?
583
 *
584
 * @param mask Marks the bits of the Stencil buffer we will write to when rendering this Node.
585
 */
586
  @SuppressWarnings("unused")
587
  public void glStencilMask(int mask)
588
    {
589
    mState.glStencilMask(mask);
590
    }
591

    
592
///////////////////////////////////////////////////////////////////////////////////////////////////
593
/**
594
 * When rendering this Node, which Tests to enable?
595
 *
596
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
597
 */
598
  @SuppressWarnings("unused")
599
  public void glEnable(int test)
600
    {
601
    mState.glEnable(test);
602
    }
603

    
604
///////////////////////////////////////////////////////////////////////////////////////////////////
605
/**
606
 * When rendering this Node, which Tests to enable?
607
 *
608
 * @param test Valid values: GL_DEPTH_TEST, GL_STENCIL_TEST, GL_BLEND
609
 */
610
  @SuppressWarnings("unused")
611
  public void glDisable(int test)
612
    {
613
    mState.glDisable(test);
614
    }
615

    
616
///////////////////////////////////////////////////////////////////////////////////////////////////
617
/**
618
 * When rendering this Node, use the following StencilFunc.
619
 *
620
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
621
 * @param ref  Reference valut to compare our stencil with.
622
 * @param mask Mask used when comparing.
623
 */
624
  @SuppressWarnings("unused")
625
  public void glStencilFunc(int func, int ref, int mask)
626
    {
627
    mState.glStencilFunc(func,ref,mask);
628
    }
629

    
630
///////////////////////////////////////////////////////////////////////////////////////////////////
631
/**
632
 * When rendering this Node, use the following StencilOp.
633
 * <p>
634
 * Valid values of all 3 parameters: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP
635
 *
636
 * @param sfail  What to do when Stencil Test fails.
637
 * @param dpfail What to do when Depth Test fails.
638
 * @param dppass What to do when Depth Test passes.
639
 */
640
  @SuppressWarnings("unused")
641
  public void glStencilOp(int sfail, int dpfail, int dppass)
642
    {
643
    mState.glStencilOp(sfail,dpfail,dppass);
644
    }
645

    
646
///////////////////////////////////////////////////////////////////////////////////////////////////
647
/**
648
 * When rendering this Node, use the following DepthFunc.
649
 *
650
 * @param func Valid values: GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL
651
 */
652
  @SuppressWarnings("unused")
653
  public void glDepthFunc(int func)
654
    {
655
    mState.glDepthFunc(func);
656
    }
657

    
658
///////////////////////////////////////////////////////////////////////////////////////////////////
659
/**
660
 * When rendering this Node, use the following Blending mode.
661
 * <p>
662
 * Valid values: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
663
 *               GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR,
664
 *               GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_SRC_ALPHA_SATURATE
665
 *
666
 * @param src Source Blend function
667
 * @param dst Destination Blend function
668
 */
669
  @SuppressWarnings("unused")
670
  public void glBlendFunc(int src, int dst)
671
    {
672
    mState.glBlendFunc(src,dst);
673
    }
674

    
675
///////////////////////////////////////////////////////////////////////////////////////////////////
676
/**
677
 * Before rendering this Node, clear the following buffers.
678
 * <p>
679
 * Valid values: 0, or bitwise OR of one or more values from the set GL_COLOR_BUFFER_BIT,
680
 *               GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT.
681
 * Default: 0
682
 *
683
 * @param mask bitwise OR of BUFFER_BITs to clear.
684
 */
685
  @SuppressWarnings("unused")
686
  public void glClear(int mask)
687
    {
688
    mState.glClear(mask);
689
    }
690
  }
(7-7/19)