texturing planets - breaking the limit
Here is a recent screenshot of Jupiter for my TC:
http://img189.exs.cx/img189/3692/screen346hx.jpg (~380kb)
As you can see the texture is messed. Now I am looking for the reason. If this issue is resolved the doors are open to fully customized planet textures, people, so let's crack this baby open!
What you can see here, and I have confirmed it additionally with test textures containing numbers on them, is that Freelancer is mapping a sphere with a cube UVW, and can put a different image in any side of the cube. That means 6 sides, 6 textures.
Now, I modelled a 3D jupiter at high resolution in 3ds max, and rendered images of it exactly from top, bottom, front, back, left and right.
Those pictures make up the textures after some editing. First, I cut out the planet itself in PaintShopPro (with the "magic hand" a matter of seconds), so I had the plain planet shots from all sides. Now, those had a size of 1211x1211 each. So, to calculate the square that actually makes up the texture put on one of the UV-cube's sides, I found an easy way. The diagonal of the square is exactly the diameter of the visible sphere, which is said 1211 pixels. So, with a bit of basic geometry, the result was a suqare size of 856x856 (which can be used, btw, for all my planetary renders sicne they are on same scale etc., just different textures on the same sphere). Now, I cut exactly that out and put it on the sides. The result is shown on the screenshot image.
On the top side, you see the upper cap of the sphere. The red thing directly in the edge is actually - seen from above the original sphere, part of the red ring on the surface that you can see quite some space below!
Now, the reason for this is quite simple. The cube is inside the planet, not outside around it. In other words, for those that can understand this kind of things, I calculated the cut-out square from a plain circle, and did not the whole thing from a sphere.
I will go ahead and try again cutting the texture out of the renders. This time, I will not calculate the square size in a circle image, but the cube size inside a 3-dimensional sphere. From thast cube I should get smaller squares as sides than my 856x856 (ignore the actual number, as stated it depends on the original render image size, and it was huge). Applying those should do the job, well, in theory.
I will keep you up to date with screenshots once I have textured it again.
What I have seen so far is proof enough that there is a mathematical way to find the actual square to cut out of those renders. Once you know those, you can put up pretty much any texture on a planet, and by adding additional material entries in the MAT and TXM file, you can have real 6-sided maps. Some people say planets use the same texture for the front and the back etc., but that's just because MS seemed lazy to make up all 6, but you can still do them yourself, since the original SPH file defines all 6 (pluse the atmosphere), but just assigns 1 texture to 2 opposite sides of the cube simply.
EDIT: I love mathematics. 30 seconds after posting and jsut started doing skethces and algebra, I found the formula. The square's edges must have a length of
a=d/sqrt(3)
(d=diameter of the sphere, sqrt(3)= sqare root of 3)
instead of my old formula
a=d/sqrt(2)
Instead of the original formula of Pythagoras, you need the enhance version, which is not a²+b²=c², but a²+b²+c²=d² in a 3-dimensional space!
UPDATE:
http://img189.exs.cx/img189/4204/screen364ka.jpg
Looks even worse.
Now, and I only realized this at this very point (i.e 2 minutes before I am writing this ), that I cannot simply cut out squares., as FL is using square textures, but they are then deformed to fit on the exploded cube.
That makes things worse. I understand now what part of the texture I have to cut out exactly, it is a square but with edges bent out. I just need a way to define this exactly, either in 3ds max in PaintShopPro.
I will try a couple of things. I might try to somehow use a Box UV gizmo in 3dsmax used with some fitting deforming modifier (if possible), or create a box deformed in the very way you can see it on the screenshots, and make new renders with the edges of that box visible on top of the sphere, so that you can use those lines ot cut the shape out, and after that somehow bend it to a square *shrugs*.
Thinking of it, the last part seems impossible so far in gaphics editing for me. I think I will have to go with the 3D solution. Whatever kind that exactly is.
Any help is appreaciated. It is not anymore a secret what we do need, but the problem is: What are the tools we need to create this? I, for my part, will play a bit with 3ds max, as I can imagine there could be something I haven't just used yet at all (so many many functions) that does exactly this. Hmm.
I hope you could follow me, as this matter is somehow hard to explain, I can pretty much see the spheres and cubes and squares in my mind, but bringing it to text so you can get what I am saying is kind of hard, so tell me if something is unclear.
Upate (last one for tonight):
I tried around in 3dsmax, I couldn't find a method so quickly, and the render-to-texture function does not behave the way FL uses for planets.
I have already thought of simply making a custom object, but I don't want to.
Now to the original HighRes renderings again. to experiment, I did an overlay of the cut-out square on the original visible circle (sphere seen from one side.
I found if I could simply draw the circle that has the same diameter as the diagonals of this square and cut that circle then out, I would have the actual shape in FL. I would then only have to find some kind of squeeze function that could deform this to a square.
But I also would need a way to exactly select this circle. Drawing with the mosue is not precise enough, there should be a way to enter a number!
Edited by - Mephistopheles on 1/31/2005 4:34:27 PM
http://img189.exs.cx/img189/3692/screen346hx.jpg (~380kb)
As you can see the texture is messed. Now I am looking for the reason. If this issue is resolved the doors are open to fully customized planet textures, people, so let's crack this baby open!
What you can see here, and I have confirmed it additionally with test textures containing numbers on them, is that Freelancer is mapping a sphere with a cube UVW, and can put a different image in any side of the cube. That means 6 sides, 6 textures.
Now, I modelled a 3D jupiter at high resolution in 3ds max, and rendered images of it exactly from top, bottom, front, back, left and right.
Those pictures make up the textures after some editing. First, I cut out the planet itself in PaintShopPro (with the "magic hand" a matter of seconds), so I had the plain planet shots from all sides. Now, those had a size of 1211x1211 each. So, to calculate the square that actually makes up the texture put on one of the UV-cube's sides, I found an easy way. The diagonal of the square is exactly the diameter of the visible sphere, which is said 1211 pixels. So, with a bit of basic geometry, the result was a suqare size of 856x856 (which can be used, btw, for all my planetary renders sicne they are on same scale etc., just different textures on the same sphere). Now, I cut exactly that out and put it on the sides. The result is shown on the screenshot image.
On the top side, you see the upper cap of the sphere. The red thing directly in the edge is actually - seen from above the original sphere, part of the red ring on the surface that you can see quite some space below!
Now, the reason for this is quite simple. The cube is inside the planet, not outside around it. In other words, for those that can understand this kind of things, I calculated the cut-out square from a plain circle, and did not the whole thing from a sphere.
I will go ahead and try again cutting the texture out of the renders. This time, I will not calculate the square size in a circle image, but the cube size inside a 3-dimensional sphere. From thast cube I should get smaller squares as sides than my 856x856 (ignore the actual number, as stated it depends on the original render image size, and it was huge). Applying those should do the job, well, in theory.
I will keep you up to date with screenshots once I have textured it again.
What I have seen so far is proof enough that there is a mathematical way to find the actual square to cut out of those renders. Once you know those, you can put up pretty much any texture on a planet, and by adding additional material entries in the MAT and TXM file, you can have real 6-sided maps. Some people say planets use the same texture for the front and the back etc., but that's just because MS seemed lazy to make up all 6, but you can still do them yourself, since the original SPH file defines all 6 (pluse the atmosphere), but just assigns 1 texture to 2 opposite sides of the cube simply.
EDIT: I love mathematics. 30 seconds after posting and jsut started doing skethces and algebra, I found the formula. The square's edges must have a length of
a=d/sqrt(3)
(d=diameter of the sphere, sqrt(3)= sqare root of 3)
instead of my old formula
a=d/sqrt(2)
Instead of the original formula of Pythagoras, you need the enhance version, which is not a²+b²=c², but a²+b²+c²=d² in a 3-dimensional space!
UPDATE:
http://img189.exs.cx/img189/4204/screen364ka.jpg
Looks even worse.
Now, and I only realized this at this very point (i.e 2 minutes before I am writing this ), that I cannot simply cut out squares., as FL is using square textures, but they are then deformed to fit on the exploded cube.
That makes things worse. I understand now what part of the texture I have to cut out exactly, it is a square but with edges bent out. I just need a way to define this exactly, either in 3ds max in PaintShopPro.
I will try a couple of things. I might try to somehow use a Box UV gizmo in 3dsmax used with some fitting deforming modifier (if possible), or create a box deformed in the very way you can see it on the screenshots, and make new renders with the edges of that box visible on top of the sphere, so that you can use those lines ot cut the shape out, and after that somehow bend it to a square *shrugs*.
Thinking of it, the last part seems impossible so far in gaphics editing for me. I think I will have to go with the 3D solution. Whatever kind that exactly is.
Any help is appreaciated. It is not anymore a secret what we do need, but the problem is: What are the tools we need to create this? I, for my part, will play a bit with 3ds max, as I can imagine there could be something I haven't just used yet at all (so many many functions) that does exactly this. Hmm.
I hope you could follow me, as this matter is somehow hard to explain, I can pretty much see the spheres and cubes and squares in my mind, but bringing it to text so you can get what I am saying is kind of hard, so tell me if something is unclear.
Upate (last one for tonight):
I tried around in 3dsmax, I couldn't find a method so quickly, and the render-to-texture function does not behave the way FL uses for planets.
I have already thought of simply making a custom object, but I don't want to.
Now to the original HighRes renderings again. to experiment, I did an overlay of the cut-out square on the original visible circle (sphere seen from one side.
I found if I could simply draw the circle that has the same diameter as the diagonals of this square and cut that circle then out, I would have the actual shape in FL. I would then only have to find some kind of squeeze function that could deform this to a square.
But I also would need a way to exactly select this circle. Drawing with the mosue is not precise enough, there should be a way to enter a number!
Edited by - Mephistopheles on 1/31/2005 4:34:27 PM