diff --git a/ExampleScenes/ChessSet/Data/BeigeMarble.jpg b/ExampleScenes/ChessSet/Data/BeigeMarble.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0544046dcd6989d5fa0ef3d4a01ce92e31ddd94b Binary files /dev/null and b/ExampleScenes/ChessSet/Data/BeigeMarble.jpg differ diff --git a/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.mtl b/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.mtl new file mode 100644 index 0000000000000000000000000000000000000000..4043ba09fdf70b7dab5ee25479d3088e3587d155 --- /dev/null +++ b/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.mtl @@ -0,0 +1,67 @@ +# Blender MTL File: 'ChessSet.blend' +# Material Count: 7 + +newmtl Filt_004 +Ns 41.176471 +Ka 0.000000 0.000000 0.000000 +Kd 0.004884 0.035564 0.005529 +Ks 0.020000 0.020000 0.020000 +Ni 1.500000 +d 1.000000 +illum 2 + +newmtl Lyse_brikker_008 +Ns 41.176471 +Ka 0.000000 0.000000 0.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.140000 0.140000 0.140000 +Ni 1.500000 +d 1.000000 +illum 2 +map_Kd cadyou.com_Sapeli.jpg + +newmtl Material.002 +Ns 96.078431 +Ka 0.000000 0.000000 0.000000 +Kd 0.160000 0.160000 0.160000 +Ks 0.500000 0.500000 0.500000 +Ni 1.000000 +d 1.000000 +illum 2 +map_Kd BeigeMarble.jpg + +newmtl Mrke_brikker_004 +Ns 41.176471 +Ka 0.000000 0.000000 0.000000 +Kd 0.640000 0.640000 0.640000 +Ks 0.140000 0.140000 0.140000 +Ni 1.500000 +d 1.000000 +illum 2 +map_Kd Dark_Mahony.jpg + +newmtl Mtl +Ns 96.078431 +Ka 0.000000 0.000000 0.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.500000 0.500000 0.500000 +Ni 1.000000 +d 1.000000 +illum 2 + +newmtl Mtl8 +Ns 96.078431 +Ka 0.000000 0.000000 0.000000 +Kd 0.000000 0.000000 0.000000 +Ks 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 + +newmtl None +Ns 0 +Ka 0.000000 0.000000 0.000000 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.obj b/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.obj new file mode 100644 index 0000000000000000000000000000000000000000..551ea07b304e57e1fadb6fab1d987c5c473f9e3c Binary files /dev/null and b/ExampleScenes/ChessSet/Data/ChessSetNoAreaLight.obj differ diff --git a/ExampleScenes/ChessSet/Data/Dark_Mahony.jpg b/ExampleScenes/ChessSet/Data/Dark_Mahony.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f2100e1ff75f2d5c91b9ef813fcc48a5000eb580 Binary files /dev/null and b/ExampleScenes/ChessSet/Data/Dark_Mahony.jpg differ diff --git a/ExampleScenes/ChessSet/Data/cadyou.com_Sapeli.jpg b/ExampleScenes/ChessSet/Data/cadyou.com_Sapeli.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55765bb7e11e1857bf587b46a5070d4250e97946 Binary files /dev/null and b/ExampleScenes/ChessSet/Data/cadyou.com_Sapeli.jpg differ diff --git a/ExampleScenes/ChessSet/Data/studio007small.exr b/ExampleScenes/ChessSet/Data/studio007small.exr new file mode 100644 index 0000000000000000000000000000000000000000..0f563d8a61c9f38dd75bb762b858a53dde298977 Binary files /dev/null and b/ExampleScenes/ChessSet/Data/studio007small.exr differ diff --git a/ExampleScenes/ChessSet/Data/studio007small.tiff b/ExampleScenes/ChessSet/Data/studio007small.tiff new file mode 100644 index 0000000000000000000000000000000000000000..fb2e6d40e2e58a2e73e5526641c01150b866c8bd Binary files /dev/null and b/ExampleScenes/ChessSet/Data/studio007small.tiff differ diff --git a/ExampleScenes/ChessSet/ExampleRenders/ChessSet_depth.png b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_depth.png new file mode 100644 index 0000000000000000000000000000000000000000..9afecf1d5812b2f1384004c9d1acd80c91bd3855 Binary files /dev/null and b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_depth.png differ diff --git a/ExampleScenes/ChessSet/ExampleRenders/ChessSet_material.png b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_material.png new file mode 100644 index 0000000000000000000000000000000000000000..8b3244cd2d8686074fc854236bbe8ff7409a5797 Binary files /dev/null and b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_material.png differ diff --git a/ExampleScenes/ChessSet/ExampleRenders/ChessSet_mesh.png b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_mesh.png new file mode 100644 index 0000000000000000000000000000000000000000..4fb5a27715a70fa9951b91b5e98327abd41aca17 Binary files /dev/null and b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_mesh.png differ diff --git a/ExampleScenes/ChessSet/ExampleRenders/ChessSet_radiance.png b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_radiance.png new file mode 100644 index 0000000000000000000000000000000000000000..43b7f9ed6b93da34d7137f94ed800177d3cea381 Binary files /dev/null and b/ExampleScenes/ChessSet/ExampleRenders/ChessSet_radiance.png differ diff --git a/ExampleScenes/ChessSet/rtbChessSetMexximpRemodeler.m b/ExampleScenes/ChessSet/rtbChessSetMexximpRemodeler.m new file mode 100644 index 0000000000000000000000000000000000000000..64ee03379cfff0ac902bc95ca2a82f25580364c9 --- /dev/null +++ b/ExampleScenes/ChessSet/rtbChessSetMexximpRemodeler.m @@ -0,0 +1,28 @@ +function [scene, mappings] = rtb360MexximpRemodeler(scene, mappings, names, conditionValues, conditionNumber) + +% This is an example of how to modify the incoming mexximp scene directly, +% with a "remodeler" hook funtion. It modifies the scene struct that will +% be used during subsequent processing and rendering. +% +% The function is called by the batch renderer when needed. Various +% parameters are passed in, like the mexximp scene, the native scene, and +% names and values read from the conditions file. + +%% Place the camera at a good location + +% The following camera location was found by manually moving the camera in +% the Blender scene and then copying camera values over. + +cameraPosition = [466 -163 286]; +cameraTarget = [39.27 -6.69 11.95]; +cameraUp = [0 0 1]; + +% build a lookat for the camera +cameraTransform = mexximpLookAt(cameraPosition, cameraTarget, cameraUp); + +% find the camera node +cameraNodeSelector = strcmp({scene.rootNode.children.name}, 'Camera'); +scene.rootNode.children(cameraNodeSelector).transformation = cameraTransform; + + +end \ No newline at end of file diff --git a/ExampleScenes/ChessSet/rtbChessSetPBRTRemodeler.m b/ExampleScenes/ChessSet/rtbChessSetPBRTRemodeler.m new file mode 100644 index 0000000000000000000000000000000000000000..d0eb1154a7784e15c3f2e7f34ac5fa5050cd63be --- /dev/null +++ b/ExampleScenes/ChessSet/rtbChessSetPBRTRemodeler.m @@ -0,0 +1,73 @@ +function nativeScene = rtb360PBRTRemodeler(parentScene,nativeScene,mappings,names,conditionValues,conditionNumber) + +% The function is called by the batch renderer when needed. Various +% parameters are passed in, like the mexximp scene, the native scene, and +% names and values read from the conditions file. + +%% Get condition values + +numSamples = rtbGetNamedNumericValue(names, conditionValues, 'pixelSamples', []); +metadataType = rtbGetNamedValue(names,conditionValues,'metadataType',[]); + +%% Choose integrator and sampler. + +integrator = nativeScene.find('SurfaceIntegrator'); + +% Choose integrator strategy according to metadataType +if(strcmp(metadataType,'depth')) + integrator.type = 'metadata'; + integrator.setParameter('strategy','string','depth'); +elseif(strcmp(metadataType,'material')) + integrator.type = 'metadata'; + integrator.setParameter('strategy','string','material'); +elseif(strcmp(metadataType,'mesh')) + integrator.type = 'metadata'; + integrator.setParameter('strategy','string','mesh'); +elseif(strcmp(metadataType,'radiance')) + integrator.type = 'path'; +else + Error('Cannot recognize metadata type.') +end + +% If we use a metadata integrator, we should change the sampler to make it +% more efficient. +sampler = nativeScene.find('Sampler'); +if(strcmp(integrator.type,'metadata')) + sampler.type = 'stratified'; + sampler.setParameter('jitter','bool','false') + sampler.setParameter('pixelsamples','integer',8); + sampler.setParameter('xsamples','integer',1); + sampler.setParameter('ysamples','integer',1); +else + % Change the number of samples according to the conditions + sampler.setParameter('pixelsamples', 'integer', numSamples); +end + + +%% Choose a type of camera to render with + +% Use a pinhole camera +camera = nativeScene.find('Camera'); +camera.type = 'pinhole'; +camera.setParameter('filmdiag', 'float', 20); +camera.setParameter('filmdistance', 'float', 20); + +%% Add environment light + +environmentLight = MPbrtElement('LightSource','type','infinite'); +environmentLight.setParameter('nsamples','integer',32); +% TODO: Fix PBRT so we can scale this. +environmentLight.setParameter('mapname','string','resources/studio007small.exr'); +% environmentLight.setParameter('L','rgb',1*[1 1 1]) +nativeScene.world.append(environmentLight); + +%% Add lights +% +% % Find the AreaLight mesh element +% AreaLightElement = nativeScene.world.find('Object','name','LightMaterial'); +% +% % Promote object to AreaLight +% rtbMPbrtBlessAsAreaLight(AreaLightElement,nativeScene,'L','D65.spd'); + + +end \ No newline at end of file diff --git a/ExampleScenes/ChessSet/rtbMakeChessSet.m b/ExampleScenes/ChessSet/rtbMakeChessSet.m new file mode 100644 index 0000000000000000000000000000000000000000..2fe71b140d8477d40a205fc25ec6ac2f6132bae3 --- /dev/null +++ b/ExampleScenes/ChessSet/rtbMakeChessSet.m @@ -0,0 +1,216 @@ +%% Render a chess set with different metadata parameters. + +% We render a scene of a chess set along with some "metadata" images. There +% are four images total: +% 1. Radiance image +% 2. Depth map +% 3. Material map +% 4. Mesh object map + +% The depth images is the distance between the camera and each object. The +% material image is an indexed image that corresponds to each unique +% material. The mesh image is an indexed image that corresponds to each +% unique mesh (object). + +% When the metadata integrator is used in PBRT, we also output a text file +% that gives the corresponding index to material/mesh name mapping. This +% text file is placed in the "renderings" folder in the working folder, +% along with the rest of the renderer output. + +% Note: For the "mesh index," we output its "primitive index" in PBRT. +% However, PBRT defines many things in the renderer with the same +% "primitive" class (e.g. acceleration structures, individual triangles, +% mesh objects.) Because of these two facts, these mesh indices tend to +% have very large numbers, potentially in the tens of thousands. To +% visualize I usually remap these numbers to a only the ones that actually +% show up in our list of indices. In the future, we can probably make some +% changes to give mesh objects unique indices instead of sharing the +% primitive index. + +% WARNING: Be sure to remove the radiometric scale factor when displaying +% the metadata images. The scale factor is unnecessary (and a bit arbitrary +% to begin with) since PBRT is configured to output the metadata numbers +% directly. + +% Approximate time to render +% Size = [200x200] +% Pinhole, 1024 pixel samples +% Total time = ~300 seconds + +% Trisha Lian + +%% Initialize + +tic +ieInit; + +% We must be in the same folder as this script +[path,name,ext] = fileparts(mfilename('fullpath')); +cd(path); + +%% Load scene + +% When exporting as an OBJ Blender, we must keep the coordinate system +% consistent. Right now I always export with YForward/ZUp and a scaling +% factor of 1000 (to convert to mm) - if the scene was original in meters. +% Nonetheless, there seems to still be a right/left flip in the images +% right now. + +% The following scenefile must be a full path. +sceneFile = fullfile(path,'Data','ChessSetNoAreaLight.obj'); +[scene, elements] = mexximpCleanImport(sceneFile,... + 'flipUVs',true,... + 'imagemagicImage','hblasins/imagemagic-docker',... + 'toReplace',{'jpg','tiff'},... + 'targetFormat','exr'); + +% Add a camera +scene = mexximpCentralizeCamera(scene); + +%% Choose batch renderer options. +hints.imageWidth = 200; +hints.imageHeight = 200; + +hints.recipeName = 'ChessSet'; + +hints.renderer = 'PBRT'; +hints.batchRenderStrategy = RtbAssimpStrategy(hints); + +% This function modifies general scene paraemters +hints.batchRenderStrategy.remodelPerConditionAfterFunction = @rtbChessSetMexximpRemodeler; +% This function modifies PBRT specific parameters +hints.batchRenderStrategy.converter.remodelAfterMappingsFunction = @rtbChessSetPBRTRemodeler; + +% Change the docker container to our version of PBRT-spectral +hints.batchRenderStrategy.renderer.pbrt.dockerImage = 'vistalab/pbrt-v2-spectral'; + +%% Copy environment map over to working folder + +resourceFolder = rtbWorkingFolder( ... + 'folderName', 'resources',... + 'hints', hints); +envMapPath = 'Data/studio007small.exr'; +copyfile(envMapPath, resourceFolder); % Copy to main recipe folder + +%% Write conditions and generate scene files + +% We will render four images. +metadataType = {'depth','material','mesh','radiance'}; + +nConditions = length(metadataType); +pixelSamples = ones(1,nConditions).*1024; + +% Place all condition variables in a giant cell matrix +names = {'pixelSamples','metadataType'}; +values = cell(nConditions, numel(names)); +values(:,1) = num2cell(pixelSamples,1); +values(:,2) = metadataType; + +% Write the parameters in a conditions file. +conditionsFile = 'ChessSetConditions.txt'; +conditionsPath = fullfile(resourceFolder, conditionsFile); +rtbWriteConditionsFile(conditionsPath, names, values); + +% Make the PBRT scene file. +nativeSceneFiles = rtbMakeSceneFiles(scene,'hints', hints,'conditionsFile',conditionsPath); + +%% Render! +radianceDataFiles = rtbBatchRender(nativeSceneFiles, ... + 'hints', hints); + +%% View as an OI + +renderingsFolder = rtbWorkingFolder( ... + 'folderName', 'renderings',... + 'hints', hints); + +% Load in rendered data +for i = 1:nConditions + + imageData = load(radianceDataFiles{i}); + + % Get rid of the radiometric scale factor + % If we don't do this, it will interfere with the metadata output, + % since those values do not need to be scaled. + photons = imageData.multispectralImage./imageData.radiometricScaleFactor; + + % Name the OI according to which metadata we rendered + oiName = sprintf('%s_%s',hints.recipeName,metadataType{i}); + + % We will display each image differently depending on what type of data + % it contains. + if(strcmp(metadataType{i},'radiance')) + + %%% ---Radiance Image--- %%% + + % Create an oi + oi = oiCreate; + oi = initDefaultSpectrum(oi); + oi = oiSet(oi, 'photons', single(photons).*imageData.radiometricScaleFactor); + oi = oiSet(oi,'name',oiName); + + % Show the oi + vcAddAndSelectObject(oi); + + % Save oi + save(fullfile(renderingsFolder,oiName),'oi'); + + % Save an RGB image + rgb = oiGet(oi,'rgb'); + imwrite(rgb,sprintf('%s.png',oiName),'png'); + + elseif(strcmp(metadataType{i},'depth')) + + %%% ---Depth Image--- %%% + + depthMap = photons(:,:,1); + fig1 = imagesc(depthMap); colorbar; colormap(flipud(gray)); + axis image; axis off; + title('Depth Map') + saveas(fig1,oiName,'png') + + elseif(strcmp(metadataType{i},'material')) + + %%% ---Material Image--- %%% + + materialData = photons(:,:,1); + fig2 = imagesc(materialData); colormap default; + axis image; axis off; + title('Material Index') + saveas(fig2,oiName,'png') + + elseif(strcmp(metadataType{i},'mesh')) + + %%% ---Mesh Image--- %%% + + % Let's remap the mesh image indicides to be more easily viewed. + % (See note on the top of this script). + + % This, however, means it will not correspond to the metadata text + % file output for the mesh. One should use the actual meshData mat + % for that. + + meshData = photons(:,:,1); + uniqueValues = unique(meshData(:)); + remap = 1:length(uniqueValues); + for j = 1:length(uniqueValues) + curI = (meshData == uniqueValues(j)); + meshData(curI) = remap(j); + end + fig3 = imagesc(meshData);colormap default; + axis image; axis off; + title('Mesh Index') + saveas(fig3,oiName,'png') + + else + end + +end + +oiWindow; + +toc + + + + diff --git a/ExampleScenes/CrytekSponza/rtbMakeCrytekSponza.m b/ExampleScenes/CrytekSponza/rtbMakeCrytekSponza.m index 28b371ce8f2472230de78ff6a3580d103b6b0693..5b107116930ec0d0427561da8b4eb9be29fd2304 100644 --- a/ExampleScenes/CrytekSponza/rtbMakeCrytekSponza.m +++ b/ExampleScenes/CrytekSponza/rtbMakeCrytekSponza.m @@ -43,13 +43,16 @@ cd(path); % When exporting as an OBJ Blender, we must keep the coordinate system % consistent. Nonetheless, there seems to still be a right/left flip in the % images right now. -sceneFile = 'Data/scaledCrytek.obj'; + +% The following scenefile must be a full path. +sceneFile = fullfile(path,'Data','scaledCrytek.obj'); % The import will convert the JPG texture files into EXR format if % necessary. [scene, elements] = mexximpCleanImport(sceneFile,... 'flipUVs',true,... - 'toReplace',{'jpg','png'},... + 'imagemagicImage','hblasins/imagemagic-docker',... + 'toReplace',{'jpg','tiff'},... 'targetFormat','exr'); %% Add a camera and move it to a starting position @@ -68,10 +71,8 @@ cameraNodeSelector = strcmp(scene.cameras.name, {scene.rootNode.children.name}); scene.rootNode.children(cameraNodeSelector).transformation = cameraTransform; %% Choose batch renderer options. -hints.imageWidth = 600; -hints.imageHeight = 400; -% hints.imageWidth = 144; -% hints.imageHeight = 88; +hints.imageWidth = 144; +hints.imageHeight = 88; hints.recipeName = 'rtbMakeCrytek'; hints.renderer = 'PBRT'; @@ -95,7 +96,7 @@ rtbWriteSpectrumFile(wls, spd, fullfile(rtbWorkingFolder('hints', hints),'D65.sp nConditions = 3; -pixelSamples = ones(1,nConditions).*4096; +pixelSamples = ones(1,nConditions).*1024; lightRotateAxis = [1 0 0;... 1 0 0;... 1 0 0]'; diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/crytekSmall.mtl b/ExampleScenes/OpacityAndBumpTest/Data/crytekSmall.mtl similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/crytekSmall.mtl rename to ExampleScenes/OpacityAndBumpTest/Data/crytekSmall.mtl diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/crytekSmall.obj b/ExampleScenes/OpacityAndBumpTest/Data/crytekSmall.obj similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/crytekSmall.obj rename to ExampleScenes/OpacityAndBumpTest/Data/crytekSmall.obj diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant.exr b/ExampleScenes/OpacityAndBumpTest/Data/vase_plant.exr similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant.exr rename to ExampleScenes/OpacityAndBumpTest/Data/vase_plant.exr diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_plant.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_plant.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_mask.exr b/ExampleScenes/OpacityAndBumpTest/Data/vase_plant_mask.exr similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_mask.exr rename to ExampleScenes/OpacityAndBumpTest/Data/vase_plant_mask.exr diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_mask.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_plant_mask.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_mask.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_plant_mask.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_spec.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_plant_spec.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_plant_spec.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_plant_spec.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_round.exr b/ExampleScenes/OpacityAndBumpTest/Data/vase_round.exr similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_round.exr rename to ExampleScenes/OpacityAndBumpTest/Data/vase_round.exr diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_round.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_round.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_round.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_round.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_bump.exr b/ExampleScenes/OpacityAndBumpTest/Data/vase_round_bump.exr similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_bump.exr rename to ExampleScenes/OpacityAndBumpTest/Data/vase_round_bump.exr diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_bump.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_round_bump.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_bump.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_round_bump.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_spec.png b/ExampleScenes/OpacityAndBumpTest/Data/vase_round_spec.png similarity index 100% rename from ExampleScenes/MakeMaskAndBumpTest/Data/vase_round_spec.png rename to ExampleScenes/OpacityAndBumpTest/Data/vase_round_spec.png diff --git a/ExampleScenes/MakeMaskAndBumpTest/maskAndBumpTest.m b/ExampleScenes/OpacityAndBumpTest/opacityAndBumpTest.m similarity index 94% rename from ExampleScenes/MakeMaskAndBumpTest/maskAndBumpTest.m rename to ExampleScenes/OpacityAndBumpTest/opacityAndBumpTest.m index 044860ff2f59037e246c8ede323dba6538308762..6b1b00af56fad6104e5e032b0842dbf78cae7ed8 100644 --- a/ExampleScenes/MakeMaskAndBumpTest/maskAndBumpTest.m +++ b/ExampleScenes/OpacityAndBumpTest/opacityAndBumpTest.m @@ -1,5 +1,5 @@ %% Render a vase to test mask and bump textures. -% For testing purposes. +% This vase is from the Crytek scene. It has opacity and bump textures. %% Choose batch renderer options. clear; diff --git a/ExampleScenes/SponzaAtrium/dgauss.50mm.dat b/ExampleScenes/SponzaAtrium/dgauss.50mm.dat new file mode 100644 index 0000000000000000000000000000000000000000..f9f3f849a7102460c4a50af77855c02dea6fb2cf --- /dev/null +++ b/ExampleScenes/SponzaAtrium/dgauss.50mm.dat @@ -0,0 +1,18 @@ +# D-GAUSS F/2 22deg HFOV +# US patent 2,673,491 Tronnier" +# Moden Lens Design, p.312" +# Scaled to 50 mm from 100 mm +# focal length (in mm) +50 +# radius axpos N aperture +29.475 3.76 1.67 25.2 +84.83 0.12 1 25.2 +19.275 4.025 1.67 23 +40.77 3.275 1.699 23 +12.75 5.705 1 18 +0 4.5 0 17.1 +-14.495 1.18 1.603 17 +40.77 6.065 1.658 20 +-20.385 0.19 1 20 +437.065 3.22 1.717 20 +-39.73 0 1 20 diff --git a/ExampleScenes/SponzaAtrium/rtbMakeSponzaAtrium.m b/ExampleScenes/SponzaAtrium/rtbMakeSponzaAtrium.m index 9d1fc618c466f8ca170fbdfd99412a88dcae4480..102c582365fd2ebcdd770fdc5014a5b6efbf93e9 100644 --- a/ExampleScenes/SponzaAtrium/rtbMakeSponzaAtrium.m +++ b/ExampleScenes/SponzaAtrium/rtbMakeSponzaAtrium.m @@ -25,7 +25,7 @@ % % Size = [400x270] % Condition 3 (only) --> 1024 pixel samples -% Total Time: ~300 seconds +% Total Time: ~400 seconds % % Size = [150x100] % Condition 1 --> (4096 pixel samples) @@ -60,12 +60,12 @@ cd(path); %% Load scene -sponzaFile = 'Data/SponzaScaled-YForwardZUp.obj'; - -[scene, elements] = mexximpCleanImport(sponzaFile,... +% The following scenefile must be a full path. +sceneFile = fullfile(path,'Data','SponzaScaled-YForwardZUp.obj'); +[scene, elements] = mexximpCleanImport(sceneFile,... 'flipUVs',true,... 'imagemagicImage','hblasins/imagemagic-docker',... - 'toReplace',{'jpg'},... + 'toReplace',{'jpg','tiff'},... 'targetFormat','exr'); @@ -168,9 +168,9 @@ nativeSceneFiles = rtbMakeSceneFiles(scene,'hints', hints,'conditionsFile',condi %% Move lens file into resource folder. % TODO: Any chance we can do this automatically? - -rtbRoot = rtbsRootPath(); -lensFilePath = fullfile(rtbRoot,'SharedData','dgauss.50mm.dat'); +% rtbRoot = rtbsRootPath(); +% lensFilePath = fullfile(rtbRoot,'SharedData','dgauss.50mm.dat'); +lensFilePath = fullfile(path,'dgauss.50mm.dat'); copyfile(lensFilePath, rtbWorkingFolder('hints', hints)); % Copy to main recipe folder (not Resources) %% Render!