|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel <a_l### [at] hotmailcom> wrote:
> Just curious, why should it not be evenly distributed
Because the diffuse illumination of a surface depends on the angle from
which the light is coming: The more perpendicular the incoming light is to
the surface, the stronger its contribution. The strength of the contribution
decreases as a function of the cosine of the angle. If the incoming light
is parallel to the light, it has zero contribution.
You could sample evenly along the hemisphere, but then you will be taking
tons of samples which contribute only little to the illumination. (In fact,
rather ironically, if you sample evenly, the majority of the samples will
be on the parts of the hemisphere which contribute the least to the
illumination.)
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <nomail@nomail> wrote:
> If I'd need a RNG for that, I guess I'd use whatever is commonly used in POV
> already. Speed is not really an issue for that job (nor is precision).
It's not only a quetion of speed, but a question of quality of the
randomness. A linear congruential generator, which is what std::rand()
usually is (and what the SDL "rand()" also is), is an extremely poor
random number generator, especially for things like stochastic sampling.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel <a_l### [at] hotmailcom> wrote:
> Just curious, why should it not be evenly distributed (or should I read
> that paper)?
The paper explains that there should be a bias and how it should be,
mathematically - but I guess it wouldn't get you much further about the "why".
The thing is simply that incident light coming in at a shallow angle illuminates
the surface less than light coming in steeper.
This could be modeled by multiplying each sampling ray with a correctional
weight term - but it is much more elegant to model it via a non-uniform
distribution of rays, because you can concentrate precious render time on rays
that really matter - and it may also save you some mathematical operations
during the sampling.
It would be some waste of time to run your random number generator output
through some trigonometric formulae first to get a uniform distribution, and
then run those co-ordinates again through more trigonometry to get your weight
- when maybe you can simply run your RNG output through some different trig
formulae to give you just the biased distribution you need to do without a
weight term and with a better overall "computing time per weight" ratio.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
> andrel <a_l### [at] hotmailcom> wrote:
>> Just curious, why should it not be evenly distributed
>
> Because the diffuse illumination of a surface depends on the angle from
> which the light is coming: The more perpendicular the incoming light is to
> the surface, the stronger its contribution. The strength of the contribution
> decreases as a function of the cosine of the angle. If the incoming light
> is parallel to the light, it has zero contribution.
In theory the contribution is zero, in reality it is not though, due to the
lack of perfectly flat surfaces. Micro-facets and a high-intensity light
source can have surprising effects...
> You could sample evenly along the hemisphere, but then you will be taking
> tons of samples which contribute only little to the illumination. (In fact,
> rather ironically, if you sample evenly, the majority of the samples will
> be on the parts of the hemisphere which contribute the least to the
> illumination.)
Actually, that they contribute the least is not universally correct: It is
only correct if all contributions of light are about the same intensity
range. Now, if one light source is significantly brighter than all other
contributing light sources, even a small angle contribution can be brighter
than all other contributions. -- While this may sound like a rare case, it
actually is not: Sunlight and a 100W light bulb would be an example. This
case is relevant in architecture.
However, the probability that small area but high intensity contributions
are missed increases with the unevenness of the distribution (because it is
a function of the sample density). The computational complexity can be cut
by exploiting ray coherence (presorting samples into coherent groups is
easiest). Of course this would actually require POV-Ray to support coherent
ray tracing, which it does not yet do (the bounding code and SIMD
abstraction is in Perforce though).
Thorsten
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29-Dec-08 14:40, clipka wrote:
> andrel <a_l### [at] hotmailcom> wrote:
>> Just curious, why should it not be evenly distributed (or should I read
>> that paper)?
>
> The paper explains that there should be a bias and how it should be,
> mathematically - but I guess it wouldn't get you much further about the "why".
Ok, I'll try to read it. If only I could find the link.
Could you post that again, I clicked through most of your posts here and
I cannot find it. :(
> The thing is simply that incident light coming in at a shallow angle illuminates
> the surface less than light coming in steeper.
Ok, that would be a fixed relation that does not depend on the material
used. I should be able to derive that myself. If only my brain would be
not so rusty.
> This could be modeled by multiplying each sampling ray with a correctional
> weight term - but it is much more elegant to model it via a non-uniform
> distribution of rays, because you can concentrate precious render time on rays
> that really matter - and it may also save you some mathematical operations
> during the sampling.
>
> It would be some waste of time to run your random number generator output
> through some trigonometric formulae first to get a uniform distribution, and
> then run those co-ordinates again through more trigonometry to get your weight
> - when maybe you can simply run your RNG output through some different trig
> formulae to give you just the biased distribution you need to do without a
> weight term and with a better overall "computing time per weight" ratio.
I'd be surprised if there is not already an efficient random generator
that does that all in one go, bypassing the need for trigonometry. Maybe
we only need the help of a resident google expert.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thorsten Froehlich <tho### [at] trfde> wrote:
> Warp wrote:
> > andrel <a_l### [at] hotmailcom> wrote:
> >> Just curious, why should it not be evenly distributed
> >
> > Because the diffuse illumination of a surface depends on the angle from
> > which the light is coming: The more perpendicular the incoming light is to
> > the surface, the stronger its contribution. The strength of the contribution
> > decreases as a function of the cosine of the angle. If the incoming light
> > is parallel to the light, it has zero contribution.
> In theory the contribution is zero, in reality it is not though, due to the
> lack of perfectly flat surfaces. Micro-facets and a high-intensity light
> source can have surprising effects...
But we are talking about simple diffuse lighting here... :P
> However, the probability that small area but high intensity contributions
> are missed increases with the unevenness of the distribution (because it is
> a function of the sample density).
I wonder if adaptive supersampling (similar to what is used in antialiasing
method 2 and adaptive area lights) could be used in the stochastic sampling:
If the brightness of two adjacent samples differ more than a given threshold,
take an additional sample between them.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka wrote:
> Distribution over a hemisphere is not enough for radiosity. There needs to be a
> particular bias towards the "zenith".
Do it like I do:
1. Choose a random point on a disc. (You can do this quickly by first
choosing a random point on square and then check if it is inside a circle).
2. Project it on a hemisphere.
Voila! There you have a cosine weighted random point on a hemishpere. No
need to do the cosine weighting anymore.
That is the method I use in ssRay. With 1600+ samples they are very well
distributed with a decent PRNG. If not you can try Halton sequence or
something similar to generate a more even distribution.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Thorsten Froehlich <tho### [at] trfde> wrote:
> > In theory the contribution is zero, in reality it is not though, due to the
> > lack of perfectly flat surfaces. Micro-facets and a high-intensity light
> > source can have surprising effects...
>
> But we are talking about simple diffuse lighting here... :P
It looks anything but simple. ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> -----Original Message-----
> From: clipka [mailto:nomail@nomail]
> Warp <war### [at] tagpovrayorg> wrote:
> > Any chances of removing the upper limit of 1600 samples? While
1600
> samples
> > is a lot, some people have encountered the limit and complained
about
> it.
>
> Yes, definitely a chance to do that. However...
>
> (1) I expect quality to improve even with less samples
Just a quick note: a few quick calculations will show that 1600 samples
is not enough for things like a lightbulb across the room, or the sun in
the sky, to be effectively used for radiosity.
> implement some adaptive algorithm. I also think it would be a good
idea
> to flag
> objects as "radiosity targets", like it is done with photons, to
inform
> the
> sampling algorithm about small but bright objects so it can shoot a
few
> more
> rays in that direction.
That would be a great way to deal with what would otherwise be extremely
large sample sets.
...Ben Chambers
www.pacificwebguy.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chambers <ben### [at] pacificwebguycom> wrote:
> Just a quick note: a few quick calculations will show that 1600 samples
> is not enough for things like a lightbulb across the room, or the sun in
> the sky, to be effectively used for radiosity.
OTOH, why not make the lightbulb or the sun a light source?
I don't really understand people's obsession in making radiosity-only
scenes. Radiosity calculates diffuse lighting only. If you use only radiosity
to calculate the lighting of the scene, the entire scene will consist of
purely diffusely lighted surfaces. There will be no specular component.
When a surface is purely diffuse, without any specular component to it,
it's like a 100% matte surface, with no reflective component. There will
be no highlights caused by light sources, which will make all surfaces
matte and dull.
It's the specular component of lighting which makes surfaces look vivid,
lively and brilliant, which make them have that "sparky" look. Purely matte
surfaces are flat and dull.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |