Conceptdrawing:

Turns out mapping a Gradient to a rectangular with seemless stretching is tough..

I get a error:

Code: Select all

```
0(831) : error C5025: lvalue in array access too complex
0(831) : error C1068: ... or possible array index out of bounds
0(831) : error C5025: lvalue in array access too complex
0(831) : error C1068: ... or possible array index out of bounds
0(831) : error C5025: lvalue in array access too complex
0(831) : error C1068: ... or possible array index out of bounds
```

So in the attachments you can find how far i got. If you remove the functions mapping the gradient to the vertex, you get a rotating spiral.

In this function, the distorted rectacngular is mapped to a default Square (0,0)(1,0)(1,1),(0,1) to determinate the colour of each pixel. The approach is derived from the case 2 of this paper, an is basically a gradual remapping per pixel:

http://graphics.cs.cmu.edu/courses/15-4 ... s/proj.pdf

The error is produced by the functions calculating the determinant of the mapping matrice, that has to be inverted. Any advice is welcome.

If somebody needs it , i can post the shaderMonkey Projectfile.