| 139 |
139 |
val deleteOldFBO = mData.removeData()
|
| 140 |
140 |
val createNewFBO = (mChildren.numChildren>0 && newData.mFBO==null)
|
| 141 |
141 |
|
| 142 |
|
if (deleteOldFBO&&createNewFBO)
|
|
142 |
if( deleteOldFBO && createNewFBO )
|
| 143 |
143 |
{
|
| 144 |
144 |
newData.mFBO = mData.mFBO
|
| 145 |
145 |
}
|
| ... | ... | |
| 155 |
155 |
|
| 156 |
156 |
mData = newData
|
| 157 |
157 |
|
| 158 |
|
if (mParent!=null) mParent!!.adjustIsomorphism()
|
|
158 |
mParent?.adjustIsomorphism()
|
| 159 |
159 |
}
|
| 160 |
160 |
|
| 161 |
161 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| ... | ... | |
| 215 |
215 |
var numRenders = 0
|
| 216 |
216 |
val numChildren = mChildren.numChildren
|
| 217 |
217 |
|
| 218 |
|
if (numChildren>0&&mData.notRenderedYetAtThisTime(currTime))
|
|
218 |
if( numChildren>0 && mData.notRenderedYetAtThisTime(currTime) )
|
| 219 |
219 |
{
|
| 220 |
220 |
var node: DistortedNode
|
| 221 |
221 |
var oldBucket: Long = 0
|
| ... | ... | |
| 231 |
231 |
}
|
| 232 |
232 |
|
| 233 |
233 |
if (mData.mFBO==null) mData.mFBO = allocateNewFBO()
|
| 234 |
|
mData.mFBO!!.setAsOutput(currTime)
|
|
234 |
val fbo = mData.mFBO!!
|
|
235 |
fbo.setAsOutput(currTime)
|
| 235 |
236 |
|
| 236 |
237 |
if (mSurface!!.setAsInput())
|
| 237 |
238 |
{
|
| 238 |
239 |
numRenders++
|
| 239 |
|
DistortedLibrary.blitPriv(mData.mFBO!!)
|
|
240 |
DistortedLibrary.blitPriv(fbo)
|
| 240 |
241 |
}
|
| 241 |
242 |
|
| 242 |
|
numRenders += mData.mFBO!!.renderChildren(currTime, numChildren, mChildren, 0, mRenderWayOIT)
|
|
243 |
numRenders += fbo.renderChildren(currTime, numChildren, mChildren, 0, mRenderWayOIT)
|
| 243 |
244 |
}
|
| 244 |
245 |
|
| 245 |
246 |
return numRenders
|
| ... | ... | |
| 350 |
351 |
mFboH = node.mFboH
|
| 351 |
352 |
mFboDepthStencil = node.mFboDepthStencil
|
| 352 |
353 |
|
| 353 |
|
if ((flags and DistortedLibrary.CLONE_SURFACE)!=0)
|
|
354 |
if( (flags and DistortedLibrary.CLONE_SURFACE)!=0 )
|
| 354 |
355 |
{
|
| 355 |
356 |
mSurface = node.mSurface
|
| 356 |
357 |
}
|
| ... | ... | |
| 558 |
559 |
*/
|
| 559 |
560 |
fun setProjection(fov: Float, near: Float)
|
| 560 |
561 |
{
|
| 561 |
|
if (fov<180.0f&&fov>=0.0f)
|
|
562 |
if ( fov<180.0f && fov>=0.0f )
|
| 562 |
563 |
{
|
| 563 |
564 |
mFOV = fov
|
| 564 |
565 |
}
|
| 565 |
566 |
|
| 566 |
|
if (near<1.0f&&near>0.0f)
|
|
567 |
if ( near<1.0f && near>0.0f )
|
| 567 |
568 |
{
|
| 568 |
569 |
mNear = near
|
| 569 |
570 |
}
|
| 570 |
|
else if (near<=0.0f)
|
|
571 |
else if ( near <= 0.0f )
|
| 571 |
572 |
{
|
| 572 |
573 |
mNear = 0.01f
|
| 573 |
574 |
}
|
| 574 |
|
else if (near>=1.0f)
|
|
575 |
else if ( near >= 1.0f )
|
| 575 |
576 |
{
|
| 576 |
577 |
mNear = 0.99f
|
| 577 |
578 |
}
|
| 578 |
579 |
|
| 579 |
|
if (mData.mFBO!=null)
|
| 580 |
|
{
|
| 581 |
|
mData.mFBO!!.setProjection(mFOV, mNear)
|
| 582 |
|
}
|
|
580 |
mData.mFBO?.setProjection(mFOV, mNear)
|
| 583 |
581 |
}
|
| 584 |
582 |
|
| 585 |
583 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
Minor