Sphere Mapping Textures

For questions about using Classic.

Post » Thu Apr 12, 2012 11:49 pm

[QUOTE=R0J0hound] For sine interpolation:
Lerp(0,IM.GetImageHeight, (1+Sin(LoopIndex("j")*180/IM.GetImageHeight))/2)

But that still won't eliminate the distortion at the poles.
Paul Brouke's method eliminates the pole distortion but causes seams because parts of the image are discarded.
The area in that shape is the only part of the image that is preserved.

The libnoise website it has some sphere textures that are distorted in a way similar to pbrouke's method but I think that it was generated special for spheres.
http://libnoise.sourceforge.net/examples/textures/index.html

Also the Photoshop method just blurs the texture near the poles, it would still have the pole distortion.[/QUOTE]

the new formular is not correct either:


the examples given from libnoise represent what i'm looking for, because the more we go towards the poles the less detailed the texture has to be. so wrapping a cylinder around it does it imho.

you're right, paul bourkes approach is be correct, but it is lossy.
and yeah, screw photoshop. construct is the place to be ;)oppenheimer2012-04-13 01:45:10
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Fri Apr 13, 2012 12:50 am

Here is the projection without distortion at the poles:

sphere-mapping-01.cap

However bear in mind that is impossible to distort this texture to fit perfectly a sphere without seems or distortion. If your goal is to achieve a sphere with an uniform noise you will need to generate the noise with the proper detail density across the poles in a way that it wraps perfectly.Animmaniac2012-04-14 16:43:26
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Fri Apr 13, 2012 12:53 am

Not sure if tillable will work with non power of two in Noise2.

Edit:
However, you can I think you can stretch the output, and noone would probably be able to tell the difference.newt2012-04-13 01:37:40
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Apr 13, 2012 1:44 am

[QUOTE=Animmaniac] Here is the projection without distortion at the poles:

sphere-mapping-01.cap

However bear in mind that is impossible to distort this texture to fit perfectly a sphere without seems or distortion. If your goal is to achieve a sphere with an uniform noise you will need to generate the noise with the proper detail density across the poles in a way that it wraps perfectly.[/QUOTE]

did you just simplified the formular from page 1? impressive to see that it's possible with less variables!
although it's pretty cool, i think that the far more simple approach of "lambert cylindrical equal-area projection" (also on page 1) suitable for this case.
basically it must be something in the direction Rojo posted.


[QUOTE=newt] Not sure if tillable will work with non power of two in Noise2.

Edit:
However, you can I think you can stretch the output, and noone would probably be able to tell the difference.[/QUOTE]

lol, you're right. the noise itself tiles pretty well, but it won't fit spheres if not power of two ;)
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Sat Apr 14, 2012 5:05 pm

Sorry, but I'm not totally following your thinking. If you apply the Lambert cylindrical equal-area projection in that rectangular texture you will only get some distortion near the equator line.

Like I said earlier, if you want to be able to have a noise texture that properly wraps a sphere without distortion you will need to create an algorithm that generates the noise in that "rhombic" space that Rojo posted, and transform it in a rectangle with the previous example I made (that I think results in an approximation of the Lambert projection).

Take a look at this

Also take a look at Sinusoidal Projection.

If this is you goal then know that is impossible to transform that rectangular texture to fit a sphere without seems or distortions. That texture has more information near the poles than what can fit in a sphere surface. If this is not your goal then I misunderstood the purpose of this topic.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Sun Apr 15, 2012 12:42 am

[QUOTE=Animmaniac] Sorry, but I'm not totally following your thinking. If you apply the Lambert cylindrical equal-area projection in that rectangular texture you will only get some distortion near the equator line.[/QUOTE]

And that's the whole point: 'some' distortion. I'm trying to minimize the polar distortion as seen in unprocessed textures. And therefore the pixels towards the poles have to shrink. I know that it will still look distorted, but way less.

Pretty interesting that we get an almost undistorted projection when we first do the sinusodial prjection and afterwards the "rhombic" one. But as we found out, there is too much loss of texture quality (especially with no supersampling at all).

Something that came into my mind while reading your last paragraph is that the original output from Noise2 is a square image. And thinking over this whole subject i realized that we've been working with rectangles the whole time. "Reconstructing" an imaginary square is impossible, too. Now what happens if we shrink down the square to half its height, but not dividing it by 2. Instead a sine-function comes into play. What do you think of this?

something like this:

polar distortion is there, but less than with an unprocessed texture.

furthermore... thanks again for your time, and sorry for me being so neurotic on this topic
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Mon Apr 16, 2012 12:13 am

Ok, now is clear what you are trying to achieve.

I made an example that halfs the height using a sine function. I think this is what you are looking for:

Sphere-mapping-03
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Mon Apr 16, 2012 1:02 am

yo Animmaniac, thanks alot for your example. It shows the effect pretty well with the contained texture, but it does not work with with other textures.
prr-sphere-mapping-03b.cap
I get the feeling that canvas is not as reliable as it should be. If i change to different textures the processed output looks different everytime. It's odd...

Maybe it's best to wait for an update of Noise2 with integrated distortion.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Mon Apr 16, 2012 1:25 am

You could always design a sphere in say Wings 3d, wrap it there, and export the texture, and model to use with the 3d object.
You could then use R0j0hounds texture switcher to swap the image.
No idea if the textures would match up, but it might not be real bad if there's not a lot of detail.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Apr 16, 2012 2:00 am

yeah, that's a good technique newt. the point of this whole matter though was to use procedurally generated textures (noise2). generating random planets is pretty easy. fire up noise2 a couple of times, load it into a sprite's animation. for every planet, set animation & texure to the 3dobject like you said.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests