@@ -284,20 +284,20 @@ MatballScene::MatballScene()
284284 return ;
285285}
286286
287- void MatballScene::Render (const std::string& outImgFileName, int iterationCount)
287+ void MatballScene::Render (const std::string& outImgFileName, int iterationCount, bool useResolveFramebuffer )
288288{
289289 // clear framebuffer before starting a new rendering.
290290 CHECK ( rprFrameBufferClear (m_frame_buffer) );
291291
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 )
293293 {
294294 CHECK ( rprContextSetParameterByKey1u (m_context, RPR_CONTEXT_ITERATIONS, iterationCount) );
295295 }
296296
297297 std::cout<<" Rendering " <<outImgFileName<<" ..." <<std::endl;
298298 CHECK ( rprContextRender (m_context) );
299299
300- if ( !m_usingHybridContext ) // There is no framebuffer resolve for Hyrbid
300+ if ( useResolveFramebuffer )
301301 {
302302 // last argument is FALSE because we want to apply the display gamma (changed with RPR_CONTEXT_DISPLAY_GAMMA) to this COLOR AOV.
303303 CHECK ( rprContextResolveFrameBuffer (m_context, m_frame_buffer, m_frame_buffer_res, false ) );
@@ -339,10 +339,8 @@ void MatballScene::Clean()
339339}
340340
341341
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 )
343343{
344-
345- m_usingHybridContext = usingHybridContext;
346344 m_context = context;
347345
348346 // create scene
@@ -387,12 +385,12 @@ MatballScene::MATBALL MatballScene::Init(rpr_context context, int shapeShiftX, i
387385 CHECK ( rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_IMAGE_TEXTURE,&m_floorImageMaterial) );
388386 CHECK ( rprMaterialNodeSetInputImageDataByKey (m_floorImageMaterial,RPR_MATERIAL_INPUT_DATA,m_floorImage) );
389387
390- if ( !usingHybridContext )
388+ if ( !forceUberMaterialForFloor )
391389 {
392390 CHECK ( rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_DIFFUSE,&m_floorMaterial) );
393391 CHECK ( rprMaterialNodeSetInputNByKey (m_floorMaterial, RPR_MATERIAL_INPUT_COLOR, m_floorImageMaterial) );
394392 }
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.
396394 {
397395 CHECK (rprMaterialSystemCreateNode (m_matsys,RPR_MATERIAL_NODE_UBERV2,&m_floorMaterial));
398396 CHECK (rprMaterialNodeSetInputNByKey (m_floorMaterial, RPR_MATERIAL_INPUT_UBER_DIFFUSE_COLOR, m_floorImageMaterial));
0 commit comments