Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Ways to smooth-texture a sphere?

Author
Message
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 22nd Sep 2013 23:51 Edited at: 23rd Sep 2013 01:18
Hey, I'm sorry for not replying for a while... I could have sworn I did yesterday, but I guess I forgot to press 'Post Message' xD
Thank you all for the replies and the help!
I never expected this would be such a hot topic
You've all posted some really interesting suggestions, and I'd love to give you some direct feedback on which ones seem to work for me, but unfortunately I've managed to break a little of the code in the program I'm working on, which needs to be fixed before I can continue :/
It shouldn't take long though, when I can I'll play around with all your suggestions and let you know the result!
Chris has a good point, I probably didn't describe very well what I was after here, sorry about that. The game I am working on is a simulation of a game where (basically) you bowl metal balls at another ball, and try to get them as close as you can... Best description I can think of xP
It's called 'Boules' by the way, in case you're interested :3
In the image I posted earlier in the thread, the ball was wooden, but that's just an early placeholder. Real-life boules are metal with a number of grooves marked in them to show who they belong to in the game. Here's a picture of one, taken from Wikipedia:



My plan was to create a metal image to wrap around the sphere, then use Parallax Mapping to give the illusion of scores in the ball...
So basically I'm not just looking to hide the missing parts of the texture at the poles that make it look distorted, I'm looking to get rid of the texture pinching, and find a way to wrap the image smoothly around. Something like the image in Stab In The Dark's second post, or in Chafari's next post after that looks like the kind of thing I'm after
It's possible I'm not going about this the right way... Maybe I should try actually modelling in grooves in Blender, but my knowledge of Blender isn't exactly amazing
Thanks for offering to help me with Blender, Chris, it's a really kind offer, but you'd probably find teaching me anything pretty stressful xD
If I stop being lazy and put some effort in, I could probably figure it myself... Hopefully
Thanks for all the help
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Sep 2013 02:41 Edited at: 23rd Sep 2013 03:30
Quote: "True - but for someone who thinks all this is a "waste of time" you've managed to "waste time" writing some very long posts on one particular interpretation of the problem.
"


GG I know you may not have considered what I said 6 times already, in conjunction with the reason for having to lengthen my posts; you have not considered to remark about my initial 2 sentence proposition in your last message which is the same proposal I had to elaborate. Instead you have choosen to complain about long posts and my view about wasting time.

It is ironic that you complain about my long posts when it is you who asked for elaboration. It is also ironic that until I had to make another reply to reiterate my initial brief solution, it was not me was doing most of the posting; I just made a two sentence direction which is ultimately one of the best ways to solve what turned out to be the real problem. The grooves on the metal ball could easily follow the pattern I posted without polar points.

This means that your goal is likely to frustrate me; knowing that you pushed me to keep having to reply, to then put the blame on me; which also means that anyone reading what I said should not take anything away from it; instead they should take home with them the point in your quote; that I managed to waste time. Let's tell the whole world that young ones and learners should not avoid reinventing the wheel; that message is a waste of time - likey you are simply offended by me thinking it is a 'waste of time' or 'overkill' not realizing that I am not trying to offend.

I still can't believe you are still posting about the issue once again; all day long; and we are still talking about this... This is what I mean when I say 'waste of time', not the practice of invention or science; but the questioning of answered questions. If you did not ask for clarification I would not have spent so much of my time making longer explanations.

Perhaps you think my view of it being a waste of time is an offense or something; hopefully not because my goal is not to offend, just to get Sam to make the reply he ended up making.

I'm sorry if I offended you. But I must say I am so shocked at your implication that it is making it ever so hard for me to not be doubtful as to whether I should take you seriously.

@Sam

Sam; thanks for the clarification. The groves can be achieved with parallax mapping as well, you'd need a high resolution image for smooth results; I do not think modelling the grooves with vertices is going to be easier.
Quote: "
Chris, it's a really kind offer, but you'd probably find teaching me anything pretty stressful xD"


And I am a patient teacher; because I am also a learner. You haven't done anything to aggravate me or cause me frustration, I asked for clarification in my second post and you posted it.

Ask any questions, but always post specific images if you struggle to put things into words.

[edit] I think I will not post in this thread anymore otherwise the wrong impression will continue to be interpreted. Contact me directly if you struggle; which I doubt you will.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2013 03:14
Quote: "I'm sorry if I offended you."


You haven't. You did baffle me though as did Stab In The Dark Software. I think both of you were answering a question different from the one I was addressing.

As I said before I think we've got our wires crossed somehow - you seem to have misunderstood what I meant and vice versa or so it would seem. Lets just move on and help SamKM if he still needs it when he's studied the various suggestions.



Powered by Free Banners
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 23rd Sep 2013 16:02 Edited at: 23rd Sep 2013 16:08
Any square texture applied to a sphere will have distortion, that's a fact, it's a rule, get over it

Even if you go to mad lengths, like subdivide a skycube and mould it back into a sphere, so it has 6 textures, even then it'll still have distortion. When this is the best result we can manage, then it's easier to just use a skybox, for it's purpose it would do the same job. It's obviously possible to UV map a sphere so the poles are completely fine, just plain map from the top, job done - but that isn't a sphere map, that would have issues around the equator instead.

The DBPro standard sphere cannot weld the poles properly, because the jagged ends don't align to 1 point - if UV data and vertex data doesn't match, the polygons don't weld together, that's why along with texture distortion, you notice the texture isn't blending like it does over the rest of the sphere. With a geosphere, the problem is still there, it just isn't so uniformily obvious - it'll always have the texture distortion, it'll never be able to completely weld because a square texture is not just some unwrapped sphere.

It's like a wrapped sweet - if you take a round sweet and a piece of square wrapper, you can't wrap that sweet without twisting the wrapper at the poles - that's bascially what DBPro spheres do.

For a planet, I would use a 6-sided sphere, because it gives good results and can avoid the issues, but I would use a special sphere render routine, so the distortion is taken into account. Like, the planets in Spore use this technique, not only for texturing but for the actual height data, it's 6 heightmaps, or 1 specifically laid out map - but it really is like taking a cube and squishing it into a sphere - the 6 sides get distorted, but the distortion is spread throughout the 6 textures, so it's much less noticeable.

If someone uploads a model of a sphere with a single texture and no distortion, then I will eat all my words. Seriously I will print out this post and physically eat it. Mankind has struggled with this problem for centuries - it's not a new worry, it took a long long long time before people could effectively map the earth, or rather represent the earth in 2D form.

I am the one who knocks...
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2013 16:48
VanB

I agree with all of that - but make sure you choose something edible like rice paper.

Following your cube map theme, another solution is to use tri-planar texturing which will also avoid the issues around the poles. It might be possible to combine that with a simple normal map representing the grooves. For this particular application
you would need only two standard textures.

But both those solutions would need a shader and I'm unsure whether SamKM wants to go down that route. For the moment the best solution is probably to do what was suggested early in this thread by various people: use a reasonably high poly sphere with a suitably modified texture. Then live with the residual distortion around the pole which, as you and Chafari noted earlier, can be minimized by having a uniform colour in the area covered by the polys adjacent to the pole.



Powered by Free Banners
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 28th Sep 2013 13:42
http://forum.thegamecreators.com/?m=forum_view&t=205077&b=8

In this old wip of mine i ran into a lot of the same problems,but there is a simple to use plugin that helped a lot,have a look,see if it helps at all.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Sep 2013 15:14 Edited at: 28th Sep 2013 15:19
Quote: "but there is a simple to use plugin "


Do you mean the one posted by WLGfx here? If so thereseems to be something wrong with the download - I just get a weird file when I try to download it. Could be a temporary glitch at this end though, I'll try again on another machine.

http://forum.thegamecreators.com/?m=forum_view&t=205077&b=8&msg=2453474#m2453474

Edit Never mind. For some odd reason the file was downloaded as "2453474". I simply renamed it as "2453474.7z" and everything was fine. No idea what was wrong though.



Powered by Free Banners
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 28th Sep 2013 16:18
That's the one Green Gandalf,makes spherical texture creation quite simple
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Sep 2013 01:49 Edited at: 30th Sep 2013 01:52
Since everyone seems to be oblivious to what GG is actually talking about, here is a possible solution to the problem:



The image should be pre-distorted at the poles so that none of the image exists in the darker region between triangles. The number of triangles should match the number of columns in the sphere, and the UV data modified appropriately so that each triangle at the pole maps perfectly onto one of the triangles in the image.

Where there are two adjacent edges of the same colour, those should map to the same location on the original image so that the textured sphere is seamless.

This will preserve vertical lines exactly over the whole sphere.

[b]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Sep 2013 13:15 Edited at: 30th Sep 2013 13:17
Spot on, Diggsey! Thanks.

When I get back from holiday in two weeks or so I hope to try and code that idea. The problem of course is that the distortion would need to be specific to the particular subdivision used in constructing the sphere.



Powered by Free Banners

Login to post a reply

Server time is: 2026-07-06 18:45:56
Your offset time is: 2026-07-06 18:45:56