Star Fields & Irrlicht

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Star Fields & Irrlicht

Post by Castaa »

Hi,

I'm trying to do a background "star field" for a space game. I have my sky dome working fine but I don't see a way to tile the stars texture. My texture is already 512x512 but it's not nearly large enough achieve the proper resolution of a near 1x1 pixel to texel ratio for the pin point star effect I'm going for.

Or should I draw my stars as very small individual triangles?


Suggestions? :?
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I wouldn't use triangles as your stars as you'd need a large amount and you're never going to get any closer to the stars.

Can you not just scale down your texture to, say, 256x256 and then tile it to make it a 512x512 texture again? that would give you 4x the amount of stars and might do the trick, you can even repeat the process again if it's not quite enough.

Either that or just get a better texture for your skydome ;)
Image Image Image
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Post by Castaa »

JP wrote:I wouldn't use triangles as your stars as you'd need a large amount and you're never going to get any closer to the stars.

Can you not just scale down your texture to, say, 256x256 and then tile it to make it a 512x512 texture again? that would give you 4x the amount of stars and might do the trick, you can even repeat the process again if it's not quite enough.

Either that or just get a better texture for your skydome ;)
I'm fine with using a tiled texture of any size but I'm not sure how to tile my texture across the one sky dome node.
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I meant to do it in something like photoshop, but thinking about it, if you've got a texture for a skydome it might not work well.. what is your texture, is it just a load of white dots, like this:

Image

or is it warped to fit the skydome something like this:

Image

(might not need warping if it's just stars...)

I wonder if the mesh manipulator's makePlanarTextureMapping() would give you good results or not... hopefully someone with actual skydome experience can offer some advice :D
Image Image Image
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Post by Castaa »

JP wrote:I meant to do it in something like photoshop, but thinking about it, if you've got a texture for a skydome it might not work well.. what is your texture, is it just a load of white dots, like this:

Image


(might not need warping if it's just stars...)

I wonder if the mesh manipulator's makePlanarTextureMapping() would give you good results or not... hopefully someone with actual skydome experience can offer some advice :D

It's just a square field of white dots (stars) for now. It's very arcade-y in it's style. Think 80's video game. :D
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

heh

Post by 3DModelerMan »

In photshop(or the gimp) you can use the polar coordinates filter wich distorts your sky to work on a skydome, for the problem with your texture
I think that on sky domes it works best with 1024 X 1024, so define your picture as a patern and just tile it inside the image so it looks how you want it. The skydome really just maps the texture flat upside down.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Re: heh

Post by Castaa »

3DModelerMan wrote:In photshop(or the gimp) you can use the polar coordinates filter wich distorts your sky to work on a skydome, for the problem with your texture
I think that on sky domes it works best with 1024 X 1024, so define your picture as a patern and just tile it inside the image so it looks how you want it. The skydome really just maps the texture flat upside down.
Ok thanks for your help. I'll see how it goes.
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Re: heh

Post by Castaa »

3DModelerMan wrote:In photshop(or the gimp) you can use the polar coordinates filter wich distorts your sky to work on a skydome, for the problem with your texture
I think that on sky domes it works best with 1024 X 1024, so define your picture as a patern and just tile it inside the image so it looks how you want it. The skydome really just maps the texture flat upside down.
Ok, my skydome is specificed to be a half sphere and my camera looks straight at it's center.

Using the polar method you suggest, my source image looks like this but of course with stars instead of this image.

Image

But I get a large white heart shaped pattern in the center when the sky dome is rendered using this modified texture. I also tried halving the image to be 1024x512 in size, making the image into a half of a circle of stars but same problem occurred only worse.
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The sky dome uses a rectangle texture as if you'd use a panorama picture. This image could be used for sphere mapping environment onto a mesh, but not for skydomes as used in Irrlicht.
Castaa
Posts: 39
Joined: Mon Jul 07, 2008 7:38 pm
Location: San Francisco
Contact:

Post by Castaa »

hybrid wrote:The sky dome uses a rectangle texture as if you'd use a panorama picture. This image could be used for sphere mapping environment onto a mesh, but not for skydomes as used in Irrlicht.
Ok got it, thanks. Rectangular or square? What ratio if not square?
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

rectangular

Post by 3DModelerMan »

You want to use polar to rectangular in the polar coordinates filter.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply