Showing posts with label color distribution. Show all posts
Showing posts with label color distribution. Show all posts

2011/07/16

Weird Voronoi Pro

Finally, I published my professional version of my live-wallpaper. Currently (while I'm writing those words), the live-wallpaper is not available on the Market, BUT NOW IT'S AVAILABLE. I think there's a delay before a paid apps is officially available (I hope it's not too long).

The big changes compared with the free version is the number of functions. First, you can choose a "ratio" as a basic value. For each pixel, before determining its color, the three closest points (according to the distance function used, not necessary the straight line) are found. Let d1, d2 and d3 be those distances. In the free version, the only ratio that exists is d1/d2. Which is the basic one used to draw Voronoi diagram. The background used on this blog is drawn with that ratio. Remember that where there's a Voronoi's edge, it means that two points are a the same distance, so d1/d2 = 1. If the pixel is right on a point, then d1/d2 = 0.

But in this new version, you have access to other ratio, like d1/d3, d2/d3 and (d1*d2)/(d3*d3). You, currently, have 11 choices for this. And the ratio influence the shape of the cells. For the color, only ratio using d1 and d2 make sense. All the other creates weird interaction. But some people might like it.

Second, the functions. For now, the function used to compute the distribution of the color consist of 4 steps. Let R be the ratio, then you have:

  1. x = f(R)
  2. y = f(x)
  3. z = f(y)
  4. c = f(z)

where 'c' is the value used for the color. For each step, you can choose among 55 functions (but let say 54, because if you choose f(R) = 1, then you remove a lot of choices). The default function is f(R) = R.
So, if we consider all possible choices (and ignore those that opposed each other), you have 54^4 possibles functions with 11 ratios. Therefore, you have 93 millions functions available to you.

NOTE that all function are f:[0,1] -> [0,1]. So, by restraining to this interval, it's easier to control at each steps.

Among the functions, there's some that use [?] and [!], two values between 0 and 1. These are values controlled elsewhere in the computation.

  • [?] is a random value that changes for each frame rendered. This value is not stable so it creates effects that some time might look like lightnings.
  • [!] on the other hand is more stable. It's a wave that follow the positive values of a sine. Therefore, it goes from 0 to 1 and then from 1 to 0. It can be used to have a regular effects over the color distribution. By default, it takes 4 seconds to have a full cycle, but it's possible to change the speed.

Here's the qr code and the direct link:

https://market.android.com/details?id=com.blogspot.widgg_research.WVP

Here's some screenshots:



The settings for the function. From the settings, click on "Functions" then "Cell and Color functions". You can see the selection of the ratio first followed by the four steps of functions.





I also post an update for the [!] feature. First, I was using the function sin(pi * t) where t is in [0;1]. But I forgot that this function is not continuous on the first derivative. This mean that at some point, the transition was not very fluid. It was following an half-circle and going fast on the 0 and took a lot of time around the 1.

Therefore, I changed it to cos(2*pi*t) * 0.5 + 0.5. With this, the function is still in the [0;1] range but the transition is very smooth. There's no drastic, unaesthetic, changes. All of this because the this function is continuous on the first derivative.

2011/06/21

Yin Yang Texture

Here's a post on texture.

Previously, we were using a method to control images with points and normals. Alone, a point and a normal split the plane in two, a positive and negative part. But combined with other points and normals, we can actually control curve shapes. To visualize it, we assign white to the positive part and black for the other.

The textures proposed here are made by first splitting the plane in two parts. The two parts must be symmetrical just like the Yin Yang symbol.

We then distribute points and normals inside one of the part. We then reflect the point into the second part, but not the normal.

The method create a contrast and a perfect symmetry. Here's some results:




I won't describe the method to render those images because it's very complex. Also, the process is very slow. Unlike the live-wallpaper I'm working on, or the previous images I showed, we cannot compute those in real-time.

Unfortunately, we haven't implement this with CUDA. With CUDA, it wouldn't be in real-time, but it would be much faster. Specially the per-pixel rendering part. Let me know what you think about these Yin-Yang images.

2011/06/20

Live Wallpaper (list of function)

I started to implement the settings and it's going well. Here, I will present a partial list of function use to compute the color of a particular pixel.

But first, the weird Voronoi diagram presented here are not so different from the original one. The cells and edges still have the same meaning. Therefore, when there's an edge, it means that points on this edge are equidistant from two sites. Even if the method used to compute the distance is not the Euclidean one.

The function that I present here all use value R, which is the ratio of d1 over d2. Where d1 is the distance to the closest point and d2 the distance to the second closest point. So if R = 0, it means it's directly on the site, and R = 1 is on an edge.

First, functions with exponent, there will be three models:

  1. R^n
  2. 1 - R^n
  3. (1-R)^n
where n is a value in {1/2, 1, 2, 10}.

The other possible functions are:
  1. sin(Pi * R)
  2. 1 - sin(Pi * R)
  3. 1 + log(R)
  4. -log(R)
In gray scale, a value from the function of 0 or less means black and a value of 1 or above means white.

In color, each site will have its color assigned. And that color will influence the color in the cell. The color will be randomly assigned to the points.

I hope to post a first version by the end of the week.