Revision b2939df4
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/library/DistortedNode.java | ||
---|---|---|
238 | 238 |
DistortedEffects.blitPriv(mData.mFBO); |
239 | 239 |
} |
240 | 240 |
|
241 |
// 'renderChildren' |
|
242 |
for(int i=0; i<mNumChildren[0]; i++) |
|
243 |
{ |
|
244 |
numRenders += mChildren.get(i).draw(currTime,mData.mFBO); |
|
245 |
} |
|
241 |
numRenders += mData.mFBO.renderChildren(currTime,mNumChildren[0],mChildren); |
|
246 | 242 |
} |
247 | 243 |
|
248 | 244 |
return numRenders; |
249 | 245 |
} |
250 | 246 |
|
251 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
252 |
// return the total number of render calls issued |
|
253 |
|
|
254 |
int drawRecursive(long currTime, DistortedOutputSurface surface) |
|
255 |
{ |
|
256 |
int ret = 0; |
|
257 |
|
|
258 |
if( mNumChildren[0]>0 && mData.currTime!=currTime ) |
|
259 |
{ |
|
260 |
mData.currTime = currTime; |
|
261 |
mData.mFBO.setAsOutput(); |
|
262 |
|
|
263 |
GLES30.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
|
264 |
GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT); |
|
265 |
|
|
266 |
if( mSurface.setAsInput() ) |
|
267 |
{ |
|
268 |
ret++; |
|
269 |
DistortedEffects.blitPriv(mData.mFBO); |
|
270 |
} |
|
271 |
|
|
272 |
for(int i=0; i<mNumChildren[0]; i++) |
|
273 |
{ |
|
274 |
ret += mChildren.get(i).drawRecursive(currTime, mData.mFBO); |
|
275 |
} |
|
276 |
} |
|
277 |
|
|
278 |
DistortedInputSurface input = mNumChildren[0]==0 ? mSurface : mData.mFBO; |
|
279 |
|
|
280 |
if( input.setAsInput() ) |
|
281 |
{ |
|
282 |
ret++; |
|
283 |
mState.apply(); |
|
284 |
mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime); |
|
285 |
} |
|
286 |
|
|
287 |
return ret; |
|
288 |
} |
|
289 |
|
|
290 | 247 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
291 | 248 |
// PUBLIC API |
292 | 249 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Now there's a single place one can have a look at all the Meshes being rendered to a OutputSurface: OutputSurface.renderChildren().
This will need to get modified for per-object post-processing.