Project

General

Profile

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

library / src / main / java / org / distorted / library / DistortedNode.java @ 63b6561a

1 d333eb6b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 6a06a912 Leszek Koltunski
package org.distorted.library;
21
22
import java.util.ArrayList;
23
import java.util.HashMap;
24
25 194ab46f Leszek Koltunski
import android.opengl.GLES30;
26 6a06a912 Leszek Koltunski
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28
/**
29 a09ada4c Leszek Koltunski
 * Class which represents a Node in a Tree of (InputSurface,Mesh,Effects) triplets.
30 c204c69d leszek
 * <p>
31 a09ada4c Leszek Koltunski
 * Having organized such sets into a Tree, we can then render any Node to any OutputSurface.
32 7b8086eb Leszek Koltunski
 * That recursively renders the set held in the Node and all its children.
33 c204c69d leszek
 * <p>
34
 * The class takes special care to only render identical sub-trees once. Each Node holds a reference
35
 * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
36
 * will point to the same NodeData; only the first of this is rendered (when mData.numRendered==0).
37 6a06a912 Leszek Koltunski
 */
38 c204c69d leszek
public class DistortedNode implements DistortedAttacheable
39 6a06a912 Leszek Koltunski
  {
40 bd3da5b2 Leszek Koltunski
  private static HashMap<ArrayList<Long>,NodeData> mMapNodeID = new HashMap<>();
41
  private static long mNextNodeID =0;
42
43 05403bba Leszek Koltunski
  private MeshObject mMesh;
44 07d8ef09 Leszek Koltunski
  private DistortedEffects mEffects;
45 c5369f1b leszek
  private DistortedInputSurface mSurface;
46 6a06a912 Leszek Koltunski
  private NodeData mData;
47 bd3da5b2 Leszek Koltunski
48 a09ada4c Leszek Koltunski
  private ArrayList<DistortedNode> mChildren;
49 6a06a912 Leszek Koltunski
  private int[] mNumChildren;  // ==mChildren.length(), but we only create mChildren if the first one gets added
50
51
  private class NodeData
52
    {
53 bd3da5b2 Leszek Koltunski
    long ID;
54 6a06a912 Leszek Koltunski
    int numPointingNodes;
55 d620ff06 Leszek Koltunski
    int numRendered;
56 af27df87 leszek
    ArrayList<Long> key;
57 8c327653 Leszek Koltunski
    DistortedFramebuffer mFBO;
58 6a06a912 Leszek Koltunski
59 af27df87 leszek
    NodeData(long id, ArrayList<Long> k)
60 6a06a912 Leszek Koltunski
      {
61 bd3da5b2 Leszek Koltunski
      ID              = id;
62 af27df87 leszek
      key             = k;
63 bd3da5b2 Leszek Koltunski
      numPointingNodes= 1;
64 d620ff06 Leszek Koltunski
      numRendered     = 0;
65 8c327653 Leszek Koltunski
      mFBO            = null;
66 6a06a912 Leszek Koltunski
      }
67 bd3da5b2 Leszek Koltunski
    }
68 6a06a912 Leszek Koltunski
 
69 436899f2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
70
71 7b8086eb Leszek Koltunski
  static synchronized void onDestroy()
72 436899f2 Leszek Koltunski
    {
73
    mNextNodeID = 0;
74
    mMapNodeID.clear();
75
    }
76
77 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
78
79
  private ArrayList<Long> generateIDList()
80
    {
81 9361b337 Leszek Koltunski
    ArrayList<Long> ret = new ArrayList<>();
82 6a06a912 Leszek Koltunski
     
83 c5369f1b leszek
    ret.add( mSurface.getID() );
84 a09ada4c Leszek Koltunski
    DistortedNode node;
85 6a06a912 Leszek Koltunski
   
86
    for(int i=0; i<mNumChildren[0]; i++)
87
      {
88
      node = mChildren.get(i);
89
      ret.add(node.mData.ID);
90
      }
91
   
92
    return ret;
93
    }
94
95
///////////////////////////////////////////////////////////////////////////////////////////////////  
96
// this will be called on startup and every time OpenGL context has been lost
97 d620ff06 Leszek Koltunski
98 6a06a912 Leszek Koltunski
  static void reset()
99
    {
100
    NodeData tmp;   
101
     
102
    for(ArrayList<Long> key: mMapNodeID.keySet())
103
      {
104
      tmp = mMapNodeID.get(key);
105
          
106 02de77c9 Leszek Koltunski
      if( tmp.mFBO != null ) tmp.numRendered = 0;
107 6a06a912 Leszek Koltunski
      }
108
    }
109 fee0865c Leszek Koltunski
110
///////////////////////////////////////////////////////////////////////////////////////////////////
111
// Debug - print all the Node IDs
112 c204c69d leszek
113 af27df87 leszek
  @SuppressWarnings("unused")
114 fee0865c Leszek Koltunski
  void debug(int depth)
115
    {
116
    String tmp="";
117
    int i;
118
119
    for(i=0; i<depth; i++) tmp +="   ";
120 c204c69d leszek
    tmp += ("NodeID="+mData.ID+" (nodes pointing: "+mData.numPointingNodes+" surfaceID="+mSurface.getID()+")");
121 fee0865c Leszek Koltunski
122 1942537e Leszek Koltunski
    android.util.Log.e("NODE", tmp);
123 fee0865c Leszek Koltunski
124
    for(i=0; i<mNumChildren[0]; i++)
125
      mChildren.get(i).debug(depth+1);
126
    }
127
128
///////////////////////////////////////////////////////////////////////////////////////////////////
129
// Debug - print contents of the HashMap
130
131 af27df87 leszek
  @SuppressWarnings("unused")
132 fee0865c Leszek Koltunski
  static void debugMap()
133
    {
134
    NodeData tmp;
135
136
    for(ArrayList<Long> key: mMapNodeID.keySet())
137
      {
138
      tmp = mMapNodeID.get(key);
139 c204c69d leszek
      android.util.Log.e("NODE", "NodeID: "+tmp.ID+" <-- "+key);
140
      }
141
    }
142
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144
145
  void treeIsomorphism()
146
    {
147
    for(int i=0; i<mNumChildren[0]; i++)
148
      {
149
      mChildren.get(i).treeIsomorphism();
150
      }
151
152
    ArrayList<Long> newList = generateIDList();
153
    NodeData newData = mMapNodeID.get(newList);
154
155
    if( newData==null )
156
      {
157 af27df87 leszek
      newData = new NodeData(++mNextNodeID,newList);
158 c204c69d leszek
      mMapNodeID.put(newList,newData);
159
      }
160
    else if( newData.ID != mData.ID )
161
      {
162
      newData.numPointingNodes++;
163
      }
164
165
    if( newData.ID != mData.ID )
166
      {
167
      boolean fboUsed = false;
168
169
      if( mNumChildren[0]>0 && newData.mFBO==null )
170
        {
171
        if( mData.mFBO!=null )
172
          {
173 af27df87 leszek
          android.util.Log.d("NODE", "copying over FBO of node surfaceID="+mSurface.getID());
174
175 c204c69d leszek
          newData.mFBO = mData.mFBO;
176
          fboUsed = true;
177
          }
178
        else
179
          {
180 af27df87 leszek
          android.util.Log.d("NODE", "creating new FBO of node surfaceID="+mSurface.getID());
181 c204c69d leszek
          newData.mFBO = new DistortedFramebuffer(mSurface.getWidth(),mSurface.getHeight());
182
          }
183
        }
184
      if( mNumChildren[0]==0 && newData.mFBO!=null )
185
        {
186 af27df87 leszek
        android.util.Log.d("NODE", "deleting FBO of newData node!!");
187
188
189 c204c69d leszek
        newData.mFBO.markForDeletion();
190
        newData.mFBO = null;
191
        }
192
193
      if( --mData.numPointingNodes==0 )
194
        {
195 af27df87 leszek
        mMapNodeID.remove(mData.key);
196 c204c69d leszek
197
        if( !fboUsed && mData.mFBO!=null )
198
          {
199 af27df87 leszek
          android.util.Log.d("NODE", "deleting FBO of node surfaceID="+mSurface.getID());
200
201 c204c69d leszek
          mData.mFBO.markForDeletion();
202
          mData.mFBO = null;
203
          }
204
        }
205
206
      mData = newData;
207 fee0865c Leszek Koltunski
      }
208
    }
209 c204c69d leszek
210 a0f644b7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
211
212 c5369f1b leszek
  void drawRecursive(long currTime, DistortedOutputSurface surface)
213 a0f644b7 Leszek Koltunski
    {
214 c5369f1b leszek
    float halfX = mSurface.getWidth()/2.0f;
215
    float halfY = mSurface.getHeight()/2.0f;
216 a0f644b7 Leszek Koltunski
217
    if( mNumChildren[0]<=0 )
218
      {
219 c5369f1b leszek
      mSurface.setAsInput();
220 a0f644b7 Leszek Koltunski
      }
221
    else
222
      {
223
      if( mData.numRendered==0 )
224
        {
225 8c327653 Leszek Koltunski
        mData.mFBO.setAsOutput();
226 a0f644b7 Leszek Koltunski
227 194ab46f Leszek Koltunski
        GLES30.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
228
        GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
229 a0f644b7 Leszek Koltunski
230 c5369f1b leszek
        if( mSurface.setAsInput() )
231 af4cc5db Leszek Koltunski
          DistortedEffects.drawNoEffectsPriv(halfX, halfY, mMesh, mData.mFBO );
232 a0f644b7 Leszek Koltunski
233 a09ada4c Leszek Koltunski
        for(int i=0; i<mNumChildren[0]; i++)
234 a0f644b7 Leszek Koltunski
          {
235 a09ada4c Leszek Koltunski
          mChildren.get(i).drawRecursive(currTime, mData.mFBO);
236 a0f644b7 Leszek Koltunski
          }
237
        }
238
239
      mData.numRendered++;
240
      mData.numRendered %= mData.numPointingNodes;
241 8c327653 Leszek Koltunski
      mData.mFBO.setAsInput();
242 a0f644b7 Leszek Koltunski
      }
243
244 c5369f1b leszek
    mEffects.drawPriv(halfX, halfY, mMesh, surface, currTime);
245 a0f644b7 Leszek Koltunski
    }
246
247 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
248
// PUBLIC API
249
///////////////////////////////////////////////////////////////////////////////////////////////////
250
/**
251 a09ada4c Leszek Koltunski
 * Constructs new Node.
252 6a06a912 Leszek Koltunski
 *     
253 c5369f1b leszek
 * @param surface InputSurface to put into the new Node.
254 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to put into the new Node.
255 05403bba Leszek Koltunski
 * @param mesh MeshObject to put into the new Node.
256 6a06a912 Leszek Koltunski
 */
257 a09ada4c Leszek Koltunski
  public DistortedNode(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
258 6a06a912 Leszek Koltunski
    {
259 c5369f1b leszek
    mSurface       = surface;
260 8ca9f899 Leszek Koltunski
    mEffects       = effects;
261
    mMesh          = mesh;
262
    mChildren      = null;
263
    mNumChildren   = new int[1];
264
    mNumChildren[0]= 0;
265 6a06a912 Leszek Koltunski
   
266 9361b337 Leszek Koltunski
    ArrayList<Long> list = new ArrayList<>();
267 c5369f1b leszek
    list.add(mSurface.getID());
268 1942537e Leszek Koltunski
269 6a06a912 Leszek Koltunski
    mData = mMapNodeID.get(list);
270
   
271
    if( mData!=null )
272
      {
273
      mData.numPointingNodes++;
274
      }
275
    else
276
      {
277 af27df87 leszek
      mData = new NodeData(++mNextNodeID,list);
278 1942537e Leszek Koltunski
      mMapNodeID.put(list, mData);
279 6a06a912 Leszek Koltunski
      }
280
    }
281
282
///////////////////////////////////////////////////////////////////////////////////////////////////  
283
/**
284 a09ada4c Leszek Koltunski
 * Copy-constructs new Node from another Node.
285 6a06a912 Leszek Koltunski
 *     
286 a09ada4c Leszek Koltunski
 * @param node The DistortedNode to copy data from.
287 6a06a912 Leszek Koltunski
 * @param flags bit field composed of a subset of the following:
288 29a06526 Leszek Koltunski
 *        {@link Distorted#CLONE_SURFACE},  {@link Distorted#CLONE_MATRIX}, {@link Distorted#CLONE_VERTEX},
289 6a06a912 Leszek Koltunski
 *        {@link Distorted#CLONE_FRAGMENT} and {@link Distorted#CLONE_CHILDREN}.
290 29a06526 Leszek Koltunski
 *        For example flags = CLONE_SURFACE | CLONE_CHILDREN.
291 6a06a912 Leszek Koltunski
 */
292 a09ada4c Leszek Koltunski
  public DistortedNode(DistortedNode node, int flags)
293 6a06a912 Leszek Koltunski
    {
294 432442f9 Leszek Koltunski
    mEffects= new DistortedEffects(node.mEffects,flags);
295 05403bba Leszek Koltunski
    mMesh = node.mMesh;
296 9361b337 Leszek Koltunski
297 29a06526 Leszek Koltunski
    if( (flags & Distorted.CLONE_SURFACE) != 0 )
298 e7a20702 Leszek Koltunski
      {
299 c5369f1b leszek
      mSurface = node.mSurface;
300 e7a20702 Leszek Koltunski
      }
301
    else
302
      {
303 c5369f1b leszek
      int w = node.mSurface.getWidth();
304
      int h = node.mSurface.getHeight();
305 8ca9f899 Leszek Koltunski
306 c5369f1b leszek
      if( node.mSurface instanceof DistortedTexture )
307 8ca9f899 Leszek Koltunski
        {
308 c5369f1b leszek
        mSurface = new DistortedTexture(w,h);
309 8ca9f899 Leszek Koltunski
        }
310 c5369f1b leszek
      else if( node.mSurface instanceof DistortedFramebuffer )
311 8ca9f899 Leszek Koltunski
        {
312 c5369f1b leszek
        boolean hasDepth = ((DistortedFramebuffer) node.mSurface).hasDepth();
313
        mSurface = new DistortedFramebuffer(w,h,hasDepth);
314 8ca9f899 Leszek Koltunski
        }
315 e7a20702 Leszek Koltunski
      }
316 9361b337 Leszek Koltunski
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )
317 6a06a912 Leszek Koltunski
      {
318 c204c69d leszek
      if( node.mChildren==null )     // do NOT copy over the NULL!
319
        {
320
        node.mChildren = new ArrayList<>(2);
321
        }
322
323 6a06a912 Leszek Koltunski
      mChildren = node.mChildren;
324
      mNumChildren = node.mNumChildren;
325
      }
326
    else
327
      {
328
      mChildren = null;
329
      mNumChildren = new int[1];
330
      mNumChildren[0] = 0;
331
      }
332
   
333
    ArrayList<Long> list = generateIDList();
334
   
335
    mData = mMapNodeID.get(list);
336
   
337
    if( mData!=null )
338
      {
339
      mData.numPointingNodes++;
340
      }
341
    else
342
      {
343 af27df87 leszek
      mData = new NodeData(++mNextNodeID,list);
344 6a06a912 Leszek Koltunski
      mMapNodeID.put(list, mData);
345
      }
346
    }
347 c204c69d leszek
348 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
349
/**
350
 * Adds a new child to the last position in the list of our Node's children.
351 c204c69d leszek
 * <p>
352
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
353
 * DistortedAttachDeamon (by calling attachNow())
354
 *
355 6a06a912 Leszek Koltunski
 * @param node The new Node to add.
356
 */
357 c204c69d leszek
  public void attach(DistortedNode node)
358 6a06a912 Leszek Koltunski
    {
359 c204c69d leszek
    DistortedAttachDaemon.attach(this,node);
360 6a06a912 Leszek Koltunski
    }
361 c204c69d leszek
362 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
363
/**
364
 * Adds a new child to the last position in the list of our Node's children.
365 c204c69d leszek
 * <p>
366
 * We cannot do this mid-render - actual attachment will be done just before the next render, by the
367
 * DistortedAttachDeamon (by calling attachNow())
368
 *
369 c5369f1b leszek
 * @param surface InputSurface to initialize our child Node with.
370 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to initialize our child Node with.
371 05403bba Leszek Koltunski
 * @param mesh MeshObject to initialize our child Node with.
372 6a06a912 Leszek Koltunski
 * @return the newly constructed child Node, or null if we couldn't allocate resources.
373
 */
374 c204c69d leszek
  public DistortedNode attach(DistortedInputSurface surface, DistortedEffects effects, MeshObject mesh)
375 6a06a912 Leszek Koltunski
    {
376 c204c69d leszek
    DistortedNode node = new DistortedNode(surface,effects,mesh);
377
    DistortedAttachDaemon.attach(this,node);
378
    return node;
379
    }
380 f8377ef8 leszek
381 c204c69d leszek
///////////////////////////////////////////////////////////////////////////////////////////////////
382
/**
383
 * This is not really part of the public API. Has to be public only because it is a part of the
384
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
385
 * Java has no multiple inheritance.
386
 *
387
 * @param node The new Node to add.
388
 */
389
  public void attachNow(DistortedNode node)
390
    {
391 9361b337 Leszek Koltunski
    if( mChildren==null ) mChildren = new ArrayList<>(2);
392 c204c69d leszek
393 6a06a912 Leszek Koltunski
    mChildren.add(node);
394
    mNumChildren[0]++;
395
    }
396 c204c69d leszek
397 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
398
/**
399
 * Removes the first occurrence of a specified child from the list of children of our Node.
400 c204c69d leszek
 * <p>
401
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
402
 * DistortedAttachDeamon (by calling detachNow())
403
 *
404 6a06a912 Leszek Koltunski
 * @param node The Node to remove.
405
 */
406 c204c69d leszek
  public void detach(DistortedNode node)
407 6a06a912 Leszek Koltunski
    {
408 c204c69d leszek
    DistortedAttachDaemon.detach(this,node);
409 6a06a912 Leszek Koltunski
    }
410 a09ada4c Leszek Koltunski
411 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
412
/**
413
 * Removes the first occurrence of a specified child from the list of children of our Node.
414 a09ada4c Leszek Koltunski
 * <p>
415
 * A bit questionable method as there can be many different Nodes attached as children, some
416
 * of them having the same Effects but - for instance - different Mesh. Use with care.
417 c204c69d leszek
 * <p>
418
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
419
 * DistortedAttachDeamon (by calling detachNow())
420 a09ada4c Leszek Koltunski
 *
421 07d8ef09 Leszek Koltunski
 * @param effects DistortedEffects to remove.
422 6a06a912 Leszek Koltunski
 */
423 c204c69d leszek
  public void detach(DistortedEffects effects)
424 6a06a912 Leszek Koltunski
    {
425 07d8ef09 Leszek Koltunski
    long id = effects.getID();
426 a09ada4c Leszek Koltunski
    DistortedNode node;
427
428 6a06a912 Leszek Koltunski
    for(int i=0; i<mNumChildren[0]; i++)
429
      {
430
      node = mChildren.get(i);
431 a09ada4c Leszek Koltunski
432 07d8ef09 Leszek Koltunski
      if( node.mEffects.getID()==id )
433 6a06a912 Leszek Koltunski
        {
434 c204c69d leszek
        DistortedAttachDaemon.detach(this,node);
435
        break;
436 6a06a912 Leszek Koltunski
        }
437
      }
438
    }
439 a09ada4c Leszek Koltunski
440 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
441
/**
442 c204c69d leszek
 * This is not really part of the public API. Has to be public only because it is a part of the
443
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
444
 * Java has no multiple inheritance.
445
 *
446
 * @param node The Node to remove.
447 6a06a912 Leszek Koltunski
 */
448 c204c69d leszek
  public void detachNow(DistortedNode node)
449 6a06a912 Leszek Koltunski
    {
450 c204c69d leszek
    if( mNumChildren[0]>0 && mChildren.remove(node) )
451 6a06a912 Leszek Koltunski
      {
452 c204c69d leszek
      mNumChildren[0]--;
453 af27df87 leszek
454
      if( mNumChildren[0]==0 && mData.mFBO!=null )
455
        {
456
        mData.mFBO.markForDeletion();
457
        mData.mFBO = null;
458
        }
459 6a06a912 Leszek Koltunski
      }
460 c204c69d leszek
    }
461
462
///////////////////////////////////////////////////////////////////////////////////////////////////
463
/**
464
 * Removes all children Nodes.
465
 * <p>
466
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
467
 * DistortedAttachDeamon (by calling detachAllNow())
468
 */
469
  public void detachAll()
470
    {
471
    DistortedAttachDaemon.detachAll(this);
472
    }
473
474
///////////////////////////////////////////////////////////////////////////////////////////////////
475
/**
476
 * This is not really part of the public API. Has to be public only because it is a part of the
477
 * DistortedAttacheable interface, which should really be a class that we extend here instead but
478
 * Java has no multiple inheritance.
479
 */
480
  public void detachAllNow()
481
    {
482 6a06a912 Leszek Koltunski
    if( mNumChildren[0]>0 )
483
      {
484
      mNumChildren[0] = 0;
485
      mChildren.clear();
486 af27df87 leszek
487
      if( mData.mFBO!=null )
488
        {
489
        mData.mFBO.markForDeletion();
490
        mData.mFBO = null;
491
        }
492 6a06a912 Leszek Koltunski
      }
493
    }
494 d1e740c5 Leszek Koltunski
495 6a06a912 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
496
/**
497 421c2728 Leszek Koltunski
 * Returns the DistortedEffects object that's in the Node.
498 6a06a912 Leszek Koltunski
 * 
499 421c2728 Leszek Koltunski
 * @return The DistortedEffects contained in the Node.
500 6a06a912 Leszek Koltunski
 */
501 421c2728 Leszek Koltunski
  public DistortedEffects getEffects()
502 6a06a912 Leszek Koltunski
    {
503 07d8ef09 Leszek Koltunski
    return mEffects;
504 4e2382f3 Leszek Koltunski
    }
505
506
///////////////////////////////////////////////////////////////////////////////////////////////////
507
/**
508 c5369f1b leszek
 * Returns the DistortedInputSurface object that's in the Node.
509 4e2382f3 Leszek Koltunski
 *
510 c5369f1b leszek
 * @return The DistortedInputSurface contained in the Node.
511 4e2382f3 Leszek Koltunski
 */
512 c5369f1b leszek
  public DistortedInputSurface getSurface()
513 4e2382f3 Leszek Koltunski
    {
514 c5369f1b leszek
    return mSurface;
515 6a06a912 Leszek Koltunski
    }
516
517 8c327653 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
518
/**
519
 * Returns the DistortedFramebuffer object that's in the Node.
520
 *
521
 * @return The DistortedFramebuffer contained in the Node.
522
 */
523
  public DistortedFramebuffer getFramebuffer()
524
    {
525
    return mData.mFBO;
526
    }
527 6a06a912 Leszek Koltunski
528 8c327653 Leszek Koltunski
  }