4

I am currently reading the awesome paper by Jorge Jimenez about Character rendering : Next Generation Character Rendering

In the part about multi-sampled transmittance he uses some Poisson offsets and a jitter texture which contains [cos(x), sin(x)] and is used to rotate the the Poisson disk samples.

But I am wondering how do you generate such texture ?

Here is the part of the ppt which talks about this.

enter image description here

MaT
  • 1,229
  • 10
  • 21

1 Answers1

5

The texture is probably generated by picking a random angle per pixel, and populating the image with its sine and cosine, remapped into [0, 1]:

$$\theta \sim [0, 2\pi] \quad \to \quad \begin{bmatrix} \tfrac{1}{2} \cos \theta + \tfrac{1}{2} \\ \tfrac{1}{2} \sin \theta + \tfrac{1}{2} \\ 0 \end{bmatrix}$$

I did a quick test and generated something that looks pretty similar (enlarged 4x):

enter image description here

If you want to be extra fancy, then instead of picking independent random angles for every pixel, you might try stratified sampling or a low-discrepancy sequence. That may give better final results for whatever effect you're using the jitter texture for, due to better local sample distribution.

Nathan Reed
  • 25,002
  • 2
  • 68
  • 107
  • Thank you very much for your answer, could you tell me more about stratified sampling and low-discrepancy sequence ? – MaT Feb 17 '16 at 18:38
  • For reference, here is the source for a low discrepancy sample (blue noise) generator https://github.com/bartwronski/BlueNoiseGenerator – Mikkel Gjoel Oct 05 '16 at 11:15