コード例 #1
0
parser.add_option("-s", "--sample-count", dest="sampleCount", default=256)
parser.add_option("-c",
                  "--distribution",
                  dest="distribution",
                  default=None,
                  type="str")
parser.add_option("-o", "--output", dest="output", type="str")
parser.add_option("-d", "--dry-run", action="store_true", dest="dryRun")

(options, args) = parser.parse_args()

directory = args[0]

dataset = Dataset(directory)
if options.superIndex == -1 and options.index == -1:
    targetBSDF = dataset.lastAvailableBSDF()
else:
    targetBSDF = dataset.BSDFAt(iteration=options.index,
                                superiteration=options.superIndex)
print targetBSDF

if options.dryRun:
    sys.exit(0)

testset = dataset.testSet()

sphereXML = os.path.dirname(__file__) + "/data/sphere-embeddable.xml"
sphereXMLP = os.path.dirname(__file__) + "/data/sphere-postprocessed.xml"
testset.embedOnto(sphereXML, sphereXMLP)

renderable = testset.renderables[0]
コード例 #2
0
# Plots high sample count last image.
parser = optparse.OptionParser()
parser.add_option("-s", "--samples", dest="samples", default=2048, type="int")
parser.add_option("-c", "--distribution", dest="distribution", default=None)

(options, args) = parser.parse_args()

directory = args[0]
dataset = Dataset(directory)

# TODO: Temporary
copyfile(dataset.testSet().targetMeshPath, "/tmp/mts_mesh_intensity_slot_0.ply")

renderable = dataset.testSet().renderable(1)
pt0 = np.array(dataset.lastAvailableBSDF())
pt1 = np.array(dataset.testSet().targetBSDF())

paramList = dataset.testSet().parameterList()
#print paramList
#print pt0
#print toMap(paramList, pt1)
if dataset.testSet().bsdfAdaptiveSampled:
    adaptiveParamList = dataset.bsdfAdaptiveSamplingParameterList
    print adaptiveParamList
    adaptiveParamMap = toMap(adaptiveParamList, len(adaptiveParamList) * [1.0])
else:
    adaptiveParamMap = {}

renderable.setEmbeddedParameter("sampleCount", options.samples)
renderable.setParameter("blockSize", 8)
コード例 #3
0
profiles = [{
    "name":
    "invAlpha",
    "sampleWeights":
    invAlpha(dataset.testSet().bsdfDictionary).tolist(),
    "type":
    "bsdf-adaptive"
}, {
    "name":
    "uniform",
    "sampleWeights": [1.0] * len(dataset.testSet().bsdfDictionary["elements"]),
    "type":
    "bsdf-adaptive"
}, {
    "name": "bsdfWeight",
    "sampleWeights": dataset.lastAvailableBSDF(),
    "type": "bsdf-adaptive"
}]

uniform = np.stack(
    [np.ones(
        (dataset.testSet().targetWidth, dataset.testSet().targetHeight))] *
    dataset.testSet().numLights(),
    axis=0)
np.save(directory + "/uniform.npy", uniform)
spatialProfiles = [{
    "name": "spatialUniform",
    "type": "spatial-custom",
    "spatial-sampler": directory + "/uniform.npy"
}, {
    "name": "spatialAdaptive",