-
Notifications
You must be signed in to change notification settings - Fork 2
/
virtualScenesLocalConfigTemplate.m
135 lines (117 loc) · 4.47 KB
/
virtualScenesLocalConfigTemplate.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
%% Set up machine-specific Virtual Scenes configuration
%
% This script is intended as a template only. You should make a copy of
% this script and save it in a folder separate from Virtual Scenes. You
% should customize that copy with values that are specific to your machine.
%
% The goal of this script is to set Matlab preference values that
% you want to use for your machine. These include file paths where
% Virtual Scenes should look for BaseScenes, Objects, and Lights, image
% processing default parameters, and where to write ouptut files.
%
% When you first install Virtual Scenes, you should copy this script,
% customize it, and run it. You can run it again, any time you want to
% make sure your Virtual Scenes preferences are correct.
%
% @ingroup VirtualScenes
% clear out any old preferences
prefName = 'VirtualScenes';
if ispref(prefName)
rmpref(prefName);
end
% 3D model locations
repository = fullfile(VirtualScenesRoot(), 'ModelRepository');
setpref(prefName, 'modelRepository', repository);
% where to save recipe archives
setpref(prefName, 'recipesFolder', ...
fullfile(rtbGetUserFolder(), 'virtual_scenes', 'recipe_archives'));
% where to put the RenderToolbox3 working folder
setpref(prefName, 'workingFolder', ...
fullfile(rtbGetUserFolder(), 'virtual_scenes', 'working'));
% image processing defaults
setpref(prefName, 'toneMapFactor', 100);
setpref(prefName, 'toneMapScale', true);
setpref(prefName, 'pixelThreshold', 0.01);
setpref(prefName, 'filterWidth', 7);
setpref(prefName, 'lmsSensitivities', 'T_cones_ss2');
setpref(prefName, 'dklSensitivities', 'T_CIE_Y2');
% scaling for large montages
setpref(prefName, 'montageScaleFactor', 1);
setpref(prefName, 'montageScaleMethod', 'lanczos3');
%% Locate RGB build of Mitsuba.
mitsuba.radiometricScaleFactor = 0.0795827427;
% use Docker, if present
mitsuba.dockerImage = 'ninjaben/mitsuba-rgb';
mitsuba.kubernetesPodSelector = 'app=mitsuba-rgb';
% or use local installation
if ismac()
mitsuba.app = '/Applications/Mitsuba-RGB.app';
mitsuba.executable = 'Contents/MacOS/mitsuba';
mitsuba.importer = 'Contents/MacOS/mtsimport';
mitsuba.libraryPathName = 'DYLD_LIBRARY_PATH';
mitsuba.libraryPath = '';
else
mitsuba.app = '';
mitsuba.executable = 'mitusba';
mitsuba.importer = 'mtsimport';
mitsuba.libraryPathName = 'LD_LIBRARY_PATH';
mitsuba.libraryPath = '';
end
% version 2 compatibility -- deprecated
mitsuba.adjustments = fullfile(rtbRoot(), ...
'BatchRenderer', 'Version2Strategy', 'Deprecated', ...
'RendererPlugins', 'Mitsuba', 'MitsubaDefaultAdjustments.xml');
setpref('MitsubaRGB', fieldnames(mitsuba), struct2cell(mitsuba));
%% Typical Mappings used to configure Mitsuba
integratorId = 'integrator';
samplerId = 'Camera-camera_sampler';
configs.Mitsuba.ids = {integratorId, samplerId};
% Mitsuba "full" rendering config
fullIntegrator = BuildDesription('integrator', 'path', ...
{'maxDepth'}, ...
{'10'}, ...
{'integer'});
fullSampler = BuildDesription('sampler', 'ldsampler', ...
{'sampleCount'}, ...
{'512'}, ...
{'integer'});
configs.Mitsuba.full.descriptions = {fullIntegrator, fullSampler};
configs.Mitsuba.full.blockName = 'Mitsuba';
% Mitsuba "quick" rendering config
quickIntegrator = BuildDesription('integrator', 'direct', ...
{'shadingSamples'}, ...
{'32'}, ...
{'integer'});
quickSampler = BuildDesription('sampler', 'ldsampler', ...
{'sampleCount'}, ...
{'32'}, ...
{'integer'});
configs.Mitsuba.quick.descriptions = {quickIntegrator, quickSampler};
configs.Mitsuba.quick.blockName = 'Mitsuba';
%% Typical Mappings used to configure PBRT
integratorId = 'integrator';
samplerId = 'sampler';
configs.PBRT.ids = {integratorId, samplerId};
% PBRT "full" rendering config
fullIntegrator = BuildDesription('SurfaceIntegrator', 'path', ...
{'maxdepth'}, ...
{'1'}, ...
{'integer'});
fullSampler = BuildDesription('Sampler', 'lowdiscrepancy', ...
{'pixelsamples'}, ...
{'8'}, ...
{'integer'});
configs.PBRT.full.descriptions = {fullIntegrator, fullSampler};
configs.PBRT.full.blockName = 'PBRT';
% Mitsuba "quick" rendering config
quickIntegrator = BuildDesription('SurfaceIntegrator', 'directlighting', ...
{'maxdepth'}, ...
{'1'}, ...
{'integer'});
quickSampler = BuildDesription('Sampler', 'lowdiscrepancy', ...
{'pixelsamples'}, ...
{'8'}, ...
{'integer'});
configs.PBRT.quick.descriptions = {quickIntegrator, quickSampler};
configs.PBRT.quick.blockName = 'PBRT';
setpref(prefName, 'rendererConfigs', configs);