Skip to content

Commit 8d8b4af

Browse files
committed
minor name changes of methods
1 parent 40d585c commit 8d8b4af

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

include/nbl/builtin/hlsl/path_tracing/concepts.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ NBL_CONCEPT_END(
5656
((NBL_CONCEPT_REQ_TYPE)(T::vector3_type))
5757
((NBL_CONCEPT_REQ_TYPE)(T::spectral_type))
5858
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.init(v/*origin*/, v/*direction*/)), ::nbl::hlsl::is_same_v, void))
59-
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.template initInteraction<impl::DummyInteraction>(interaction)), ::nbl::hlsl::is_same_v, void))
59+
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.template setInteraction<impl::DummyInteraction>(interaction)), ::nbl::hlsl::is_same_v, void))
6060
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.initPayload()), ::nbl::hlsl::is_same_v, void))
6161
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.shouldDoMIS()), ::nbl::hlsl::is_same_v, bool))
6262
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.foundEmissiveMIS(scalar)), ::nbl::hlsl::is_same_v, typename T::spectral_type))
6363
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.addPayloadContribution(color)), ::nbl::hlsl::is_same_v, void))
6464
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.getPayloadAccumulatiion()), ::nbl::hlsl::is_same_v, typename T::spectral_type))
65-
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setPayloadMISWeights(color, scalar)), ::nbl::hlsl::is_same_v, void))
65+
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.updateThroughputAndMISWeights(color, scalar)), ::nbl::hlsl::is_same_v, void))
6666
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.setT(scalar)), ::nbl::hlsl::is_same_v, void))
6767
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.getT()), ::nbl::hlsl::is_same_v, typename T::scalar_type))
6868
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((ray.getPayloadThroughput()), ::nbl::hlsl::is_same_v, typename T::spectral_type))

include/nbl/builtin/hlsl/path_tracing/unidirectional.hlsl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,7 @@ struct Unidirectional
8585
vector3_type eps1 = randGen(depth * 2u + 1u, _sample);
8686

8787
const vector3_type intersectP = intersectData.getPosition();
88-
vector3_type throughput = ray.getPayloadThroughput();
89-
measure_type throughputCIE_Y = spectralTypeToLumaCoeffs * throughput;
90-
{
91-
scalar_type sum_throughput = throughputCIE_Y[0];
92-
NBL_UNROLL for (uint16_t i = 1; i < vector_traits<measure_type>::Dimension; i++)
93-
sum_throughput += throughputCIE_Y[i];
94-
throughputCIE_Y /= sum_throughput;
95-
}
88+
measure_type throughputCIE_Y = interaction.getLuminosityContributionHint();
9689

9790
// sample lights
9891
const scalar_type neeProbability = bxdf.getNEEProb();
@@ -132,7 +125,7 @@ struct Unidirectional
132125
const vector3_type direction = nee_sample.getL().getDirection();
133126
ray_type nee_ray;
134127
nee_ray.init(origin, direction);
135-
nee_ray.template initInteraction<anisotropic_interaction_type>(interaction);
128+
nee_ray.template setInteraction<anisotropic_interaction_type>(interaction);
136129
nee_ray.setT(t);
137130
tolerance_method_type::template adjust<ray_type>(nee_ray, direction, depth);
138131
if (getLuma(neeContrib.quotient) > lumaContributionThreshold)
@@ -143,6 +136,7 @@ struct Unidirectional
143136
// sample BSDF
144137
scalar_type bxdfPdf;
145138
vector3_type bxdfSample;
139+
vector3_type throughput = ray.getPayloadThroughput();
146140
{
147141
anisocache_type _cache;
148142
sample_type bsdf_sample = materialSystem.generate(matID, interaction, eps1, _cache);
@@ -163,13 +157,13 @@ struct Unidirectional
163157
{
164158
scalar_type otherTechniqueHeuristic = neeProbability / bxdfPdf; // numerically stable, don't touch
165159
assert(!hlsl::isinf(otherTechniqueHeuristic));
166-
ray.setPayloadMISWeights(throughput, otherTechniqueHeuristic * otherTechniqueHeuristic);
160+
ray.updateThroughputAndMISWeights(throughput, otherTechniqueHeuristic * otherTechniqueHeuristic);
167161

168162
// trace new ray
169163
vector3_type origin = intersectP;
170164
vector3_type direction = bxdfSample;
171165
ray.init(origin, direction);
172-
ray.template initInteraction<anisotropic_interaction_type>(interaction);
166+
ray.template setInteraction<anisotropic_interaction_type>(interaction);
173167
ray.setT(1.0/*kSceneSize*/);
174168
tolerance_method_type::template adjust<ray_type>(ray, direction, depth);
175169

@@ -203,7 +197,7 @@ struct Unidirectional
203197

204198
continuePath = intersection.foundHit();
205199
if (continuePath)
206-
continuePath &= closestHitProgram(d, sampleIndex, ray, intersection);
200+
continuePath = closestHitProgram(d, sampleIndex, ray, intersection);
207201
}
208202
if (!continuePath)
209203
missProgram(ray);

0 commit comments

Comments
 (0)