Skip to content
Snippets Groups Projects
Commit 84f6349d authored by Ben Heasly's avatar Ben Heasly
Browse files

use anonymous function to pass extra parameter to remodeler function

parent 018b10e2
No related branches found
No related tags found
No related merge requests found
function nativeScene = rtbCrytekPBRTRemodeler(parentScene,nativeScene,mappings,names,conditionValues,conditionNumber)
function nativeScene = rtbCrytekPBRTRemodeler(parentScene,nativeScene,mappings,names,conditionValues,conditionNumber,cameraInfo)
% The function is called by the batch renderer when needed. Various
% parameters are passed in, like the mexximp scene, the native scene, and
......@@ -24,8 +24,8 @@ sampler.setParameter('pixelsamples', 'integer', numSamples);
camera = nativeScene.find('Camera');
camera.type = 'pinhole';
camera.setParameter('filmdiag', 'float', 20);
camera.setParameter('filmdistance', 'float', 20);
camera.setParameter('filmdiag', 'float', cameraInfo.filmdiag);
camera.setParameter('filmdistance', 'float', cameraInfo.filmdistance);
%% Promote the area light mesh into an actual area light.
% Assign appropriate spectrum based on the conditionValues
......
......@@ -47,10 +47,17 @@ hints.recipeName = 'CrytekSponza';
hints.renderer = 'PBRT';
hints.batchRenderStrategy = RtbAssimpStrategy(hints);
% camera params we need to share between the remodeler and iset, below
cameraInfo.filmdiag = 20;
cameraInfo.filmdistance = 20;
% This function modifies general scene paraemters
hints.batchRenderStrategy.remodelPerConditionAfterFunction = @rtbCrytekMexximpRemodeler;
% This function modifies PBRT specific parameters
hints.batchRenderStrategy.converter.remodelAfterMappingsFunction = @rtbCrytekPBRTRemodeler;
% append the cameraInfo to the expected RTB parameters
pbrtRemodelerFunction = @(varargin) rtbCrytekPBRTRemodeler(varargin{:}, cameraInfo);
hints.batchRenderStrategy.converter.remodelAfterMappingsFunction = pbrtRemodelerFunction;
% Change the docker container to our version of PBRT-spectral
hints.batchRenderStrategy.renderer.pbrt.dockerImage = 'vistalab/pbrt-v2-spectral';
......@@ -145,12 +152,8 @@ radianceDataFiles = rtbBatchRender(nativeSceneFiles, ...
%% View as an OI
% TODO: Ideally, we want to use BuildOI here. Unfortunately, we don't have
% the "oiParameters" structure anymore. In RTB4, this structure held
% information about the film distance, diagonal, etc. We could then use
% this information to fill in parameter info in the OI, such as the
% F-number or the FOV. Now all that info is held in the remodeler. How
% should we move that info out from the remodeler into the oi?
% TODO: use cameraInfo struct to build correct optics for optical image,
% below.
renderingsFolder = rtbWorkingFolder( ...
'folderName', 'renderings',...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment