<div dir="ltr">Hi,<div><br></div><div>I think sampling should be left out of the shader entirely, that&#39;s the job of the integrator. Dispersion should be implemented as a closure.<div><br></div><div>It can be useful for experimenting, but the closure based design exists to have a clean separation here. For example the branched path tracer can take multiple samples for the same shader evaluation, bidirectional methods might do something similar.</div>


<div><br></div><div>Brecht.<br><br>On Friday, March 21, 2014, Lukas Stockner &lt;<a href="mailto:lukas.stockner@freenet.de" target="_blank">lukas.stockner@freenet.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
I recently noticed that a Random Value Node would be useful, for example<br>
for spectral dispersion shader setups.<br>
So now I&#39;m thinking about implementing one, but my question is how to do<br>
the actual random number generation in the SVM. Using the randb value<br>
will probably give correlation issues, so the best approach would be to<br>
actually get a separate number from the RNG. However, since the number<br>
of random nodes used isn&#39;t known in advance, so setting aside RNG<br>
dimensions for these is problematic (also, allocating several dimensions<br>
per bounce only for the nodes is quite a waste since it reduces quality<br>
for the other values).<br>
So far, my best idea was to hash the randb value and use the resulting<br>
value as a seed for a LCG, however, for this every Random Node would<br>
have to carry an unique ID. However, the resulting samples wouldn&#39;t be<br>
as well-distributed as regular RNG samples...<br>
So, do you think the hashing idea would work, would you use another<br>
approach or not add a Random Node at all?<br>
<br>
Lukas Stockner<br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a>Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</blockquote>
</div></div></div>