@@ -284,20 +284,20 @@ MatballScene::MatballScene()
284
284
return ;
285
285
}
286
286
287
- void MatballScene::Render (const std::string& outImgFileName, int iterationCount)
287
+ void MatballScene::Render (const std::string& outImgFileName, int iterationCount, bool useResolveFramebuffer )
288
288
{
289
289
// clear framebuffer before starting a new rendering.
290
290
CHECK ( rprFrameBufferClear (m_frame_buffer) );
291
291
292
- if ( !m_usingHybridContext ) // there is no iteration for Hyrbid
292
+ if ( iterationCount > 0 ) // if iterationCount=-1 , we ignore this parameter ( may be needed if using Hybrid.DLL )
293
293
{
294
294
CHECK ( rprContextSetParameterByKey1u (m_context, RPR_CONTEXT_ITERATIONS, iterationCount) );
295
295
}
296
296
297
297
std::cout<<" Rendering " <<outImgFileName<<" ..." <<std::endl;
298
298
CHECK ( rprContextRender (m_context) );
299
299
300
- if ( !m_usingHybridContext ) // There is no framebuffer resolve for Hyrbid
300
+ if ( useResolveFramebuffer )
301
301
{
302
302
// last argument is FALSE because we want to apply the display gamma (changed with RPR_CONTEXT_DISPLAY_GAMMA) to this COLOR AOV.
303
303
CHECK ( rprContextResolveFrameBuffer (m_context, m_frame_buffer, m_frame_buffer_res, false ) );
@@ -339,10 +339,8 @@ void MatballScene::Clean()
339
339
}
340
340
341
341
342
- MatballScene::MATBALL MatballScene::Init (rpr_context context, int shapeShiftX, int shapeShiftY, bool usingHybridContext )
342
+ MatballScene::MATBALL MatballScene::Init (rpr_context context, int shapeShiftX, int shapeShiftY, bool forceUberMaterialForFloor )
343
343
{
344
-
345
- m_usingHybridContext = usingHybridContext;
346
344
m_context = context;
347
345
348
346
// create scene
@@ -387,12 +385,12 @@ MatballScene::MATBALL MatballScene::Init(rpr_context context, int shapeShiftX, i
387
385
CHECK ( rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_IMAGE_TEXTURE,&m_floorImageMaterial) );
388
386
CHECK ( rprMaterialNodeSetInputImageDataByKey (m_floorImageMaterial,RPR_MATERIAL_INPUT_DATA,m_floorImage) );
389
387
390
- if ( !usingHybridContext )
388
+ if ( !forceUberMaterialForFloor )
391
389
{
392
390
CHECK ( rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_DIFFUSE,&m_floorMaterial) );
393
391
CHECK ( rprMaterialNodeSetInputNByKey (m_floorMaterial, RPR_MATERIAL_INPUT_COLOR, m_floorImageMaterial) );
394
392
}
395
- else // Hybrid only manages UBER material meaning we can't use the RPR_MATERIAL_NODE_DIFFUSE like with Northstar.
393
+ else // Hybrid/HybridPro only manages UBER material meaning we can't use the RPR_MATERIAL_NODE_DIFFUSE like with Northstar.
396
394
{
397
395
CHECK (rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_UBERV2,&m_floorMaterial));
398
396
CHECK (rprMaterialNodeSetInputNByKey (m_floorMaterial, RPR_MATERIAL_INPUT_UBER_DIFFUSE_COLOR, m_floorImageMaterial));
0 commit comments