Advertisement

Question about Sky Spheres...

Started by February 12, 2004 12:33 PM
8 comments, last by Ransom 21 years ago
I''ve created a Sky Sphere but i have some questions about it. Is there any way to fix the ends of the sphere? When the texture is mapped to it, it gets all distorted and is extremely noticable... Also, no matter how large I make my sphere, whether it''s radius is 2.0f or 200.0f, it still appears the same size. It''s not the same size... but when the same texture is mapped you really can''t tell. I am using MipMaps with regards to the texture. Is there a way around this, or do i just need to find a better texture to map? Thanks
Just curious, but is there a reason you aren''t using a sky box? I''ve had really good luck with them, though you have to have textures made specifically for them. There is a good tutorial at gametutorials.com, page 2 of the openGL tut''s.

Advertisement
The 2.0 sphere looks just as large as a 200.0 sphere probably because you stay at the origin and rotate around it only. This way, you will get the same result as the texels will always have the same screen size, so the sphere looks the same. Like when you take a piece of paper, and one that''s half the size of the other in both dimensions. If you go closer to the small paper, it will look just as large as the large paper.
I''ve heard that Adobe Photoshop has a feature that pre-distorts a sky texture in such a way that it looks normal when mapped to a sphere.

Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

Most artists will model the skysphere and map it in such a way that there is more texture detail near the horizon where you will notice it and as the horizon drops down it caps the bottom portion of the level. This usually creates more of an elipsis effect.

It is difficult to just use a sphere and map a texture to it using spherical coordinates in such a way that it will look good. If you don't have an artist you are better off using an automated tool like bryce and it's render to skybox functionality.


Imagine if you took a big salad bowl, turned it upside down and capped the bottom of it.. yeah something like that

[edited by - proj on February 12, 2004 2:33:09 PM]
I''m not using a sky box because I can''t seem to get rid of the edge lines, I''ve made Sky Box texures before with Bryce by switching the veiwing angle to 112.5 Degrees and taking the six pictures, but I could never seem to get rid of the edges.

Proj: Are you refferring to a sky dome kind of thing? And if you are are there any good Tutorials on it? I''ve searched and found some source code, but i''m not as proliffic with GL yet to learn from straight code.

Tree Penguin: Is there any way around that? Any way to make the cloud/space/sky texture i put on it look farther away? I''m still relatively new to this...
Advertisement
Im guessing you have a ATI card, either way, on a skybox you have to clamp the texture edges like this.

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);

There is no easy solution using a sky sphere, it's by defenition warped, unless the sky texture is prewarped, but then you will get resolution problems(either straight up, or if you use a sky dome on the horison).

A skybox is the best thing, unless you have an ATI card, then you might want to overlap the polygons just slightly.

It might allso be worth researching other methods of enviroment rendering, i will.

---------------------------------
For an overdose of l33tness, flashbang.nu

[edited by - lc_overlord on February 12, 2004 5:56:45 PM]
lc_overlord has it right i had the smae skybox probs until i noticed the use of GL_Clamp, since then no probs
quote:
Tree Penguin: Is there any way around that? Any way to make the cloud/space/sky texture i put on it look farther away? I''m still relatively new to this...


Yes:

1. Using a higher detailed skybox/dome/sphere, this will cause detail to (dis)appear when rotating the viewpoint/sky_x_, also, with higher detail it will look further as texels will look smaller (your brain says ''hey, big=near'', how stupid). This will not solve much, but it is a start.

2. Adding clouds, particles, fog, or terrain occasionally raising above the viewpoint. This will solve a lot.

3. Slightly translating the skysphere when the player moves (just that it''s noticable) this will also create the illusion ov a far skysphere. I think the best is to create a skysphere about 25 times (ie. a large value) as big as your world''s size and simply translating/rotating the skydome with it.
One of the benefit's of perspective(particulary in openGL) is that if you are in the center of the skysphere or the skybox it doesn't matter if it is 1 meter in size or a gazillion meters big.
The one i use is only 10x10x10.
the texture are allso highres and mipmapped so guess what, no textels
Translating the skybox so that the camera is not in the center of the cube is NEVER!!! a good idea.

If you want you could try a multilayerd sky.
First you draw a skysphere with only a smooth gradient texture to simulate atmosphere.
then draw a skydome(or a skyplane) with some nice slow moving cloud's.
Finaly a skybox(with the sky part made transparent).
>>>note: i han't tried this, so i don't know if it will look good.<<<

---------------------------------
For an overdose of l33tness, flashbang.nu

[edited by - lc_overlord on February 16, 2004 6:11:02 AM]

[edited by - lc_overlord on February 16, 2004 6:12:13 AM]

This topic is closed to new replies.

Advertisement