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.

3 Dimensional Chat / help the idiot in the audience - sphere starfield

Author
Message
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 26th Mar 2005 05:38
I've generated my nice random 256x256 image and then I've used it as a texture on a 3000,20,20 sphere. I've sorted the cull on the sphere and stuck the camera on the inside to have a look...

I've then started tinkering with uscale and vscale and texture mode because if you stretch the 256x256 over the whole damned sphere the stars look like bird guano not stars ie. I've tried to get the image to tile several times over the sphere so the individual stars are smaller and more definite.... but whatever I do I just cant sort it...

some of the attached code is redundant at the mo but the problem revolves around lines 50 & 51 I think - if I change the uscale / vscale to 2.0 or 4.0 etc then no matter what I do the starfield is there somewhere on the sphere (sort of a triangle in one part of the sphere - but not tiled everywhere...).

can anyone help...?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 26th Mar 2005 05:45
anyone?
G Man
20
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 26th Mar 2005 08:52
A starfield is particularly challenging for the very reason that you mentioned. When the texture is stretched to cover the large area of a sky sphere, those individual pixels when translated into texels become huge blobs. That leaves you with only two real options. Either you use a larger texture or you tile the texture over the sphere's faces.

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro
Vai mamar na pila
20
Years of Service
User Offline
Joined: 10th Nov 2004
Location: Behind Your Behind
Posted: 26th Mar 2005 10:05 Edited at: 26th Mar 2005 10:06
hmmm, im really busy, but i think the way u should solve this is to uvmap the sphere model in a uv program, and smooth the faces, even thow beware you will always have some destortion at the center edegs (the sphere tops), unless u make your texture like a planet texture, seacr for one of those, thow this would be pretty easy, do u have photosho ? just open ur texture and apply a filter called polar coordinates, i think thats the name, uvmap ur sphere properly and then aplly texture, distortion will be minimal when scrolling it, i guess your going for a allow sphere right ? if it is this description fits ur problem perfectly, then u should do what g man said, use a 1024 texture, if u tile it it wont work, so thats the big size to go, make ur sphere big and all the rest of the stuff in your game small, hope i was off any help, but i cant do more right now, sorry.

btw, sorry for the bad spelling, i dont even have time to check that

sig removed due to obscene content
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 27th Mar 2005 03:45
Thanks GMan & Mustrix.... food for thought... what about cube mapping with 6 256x256 textures...? (I'm being lazy now and not attempting to code it unless someone already has and can offer a few pearls of wisdom)...
G Man
20
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 27th Mar 2005 05:09
A texture that small is still going to make your stars look like horkin blobs!

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro
Dylnuge
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: In a dark room in front of a glowing LCD
Posted: 27th Mar 2005 06:24
I would reccomend creating seemless tiles for that. Texture Maker is an ecellent program, and if you don't want to pay, there is some free program in the DBPro showcase (under Apps, I think).

Quote: "I'm being lazy now and not attempting to code it"


And here we have a programmer in DBPro not wanting to code whiel wrighting a game? Lol.

Tranzerk Technologies Current Project: Action Bum (credit to Raffael Coronelli)
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 27th Mar 2005 08:52
@ dylnuge,

Fine, but how do I tile any size of texture over my 3000,20,20 sphere in DBPro such that each individual star looks like a star or dot rather than a seagull strike...?
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 28th Mar 2005 08:41
anyone know how to do good star fields without an external software useage....????
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 4th Apr 2005 04:39
sorry to resurrect this thread but does anyone out there have some simple enough dbpro code to make a star field that looks like one rather than a mouse's view through a babybottle teat after an overhead pass by an incontinent pigeon?
G Man
20
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 4th Apr 2005 06:22
Rather than using a standard sphere object, use a geodesic sphere. Load it into Lithunwrap and map all of the faces of the sphere to cover the same area (also known as tiling the texture). Then paint your starfield into that area. Make your texture sufficiently large that the pixels won't smear. If you can do that, then you've got the problem solved.

Just because I was feeling generous today, I decided to sit down and prove what I'm saying is correct. Attached are a .X model of a geodesic sphere, UV mapped as I've suggested and a sample texture. The sphere is 100 quants in diameter and so will need to be scaled up for use. The texture is 256 x 256. You should be able to scale this thing up to about 20x (yielding a 2000 quant diameter skysphere) with no appreciable blurring of the "stars" If you need it larger, you're likely going to need a larger texture. All in all it took me about 1 hour to slap this together and the most challenging part was UV mapping the sphere. Which was challenging only in that it was rather boring.

I'm releasing these media files for free use of anyone who wishes to use them, although a mention would be nice...

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro

Attachments

Login to view attachments
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 4th Apr 2005 09:13 Edited at: 4th Apr 2005 09:16
@Duffer:I had the same problem. Starspheres just aren't something you can do blind. There's no "Magic Formula"(TM) that makes a perfect starsphere all the time. What I reccomend is making a simple "eyeballing" program that lets you control the UVs with the arrow keys and outputs the result to the screen. Then just match the numbers up and you're good to go.

Here's an example:



Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 5th Apr 2005 04:11
@ G Man & Mr Underhill - many thanks

@ Mr Underhill - start with a u and v of 100.0?

@ All - but why wont my seamless textures tile effectively over the sphere???

Login to post a reply

Server time is: 2024-11-27 20:43:05
Your offset time is: 2024-11-27 20:43:05