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.

Newcomers DBPro Corner / Environments, skyspheres, etc.

Author
Message
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 17th Jul 2007 06:17
I'm creating a 3d flying shooter. So far for terrain/environment I have a skysphere and a plain textured with a water image. They are both continually centered on the ship as it flies but I just scroll the water texture to simulate movement (this way the ship never gets to the edge of the water plain).

My problem is that the skysphere just doesn't seem to "cut it", that is, it doesn't look very real. If you're right down close to the water, it looks great, but when you fly upwards, you can see where the water and skysphere meet and it looks quite fake.

I'm wondering if anybody has any tips for me?

Here are two pictures (sorry for the mediocre quality):

When the ship/camera are low (relatively good):


And when the ship/camera are high (relatively bad):


ZOMG
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 18th Jul 2007 09:10
Since this post is more than 24 hours old, I'll give it a go.

The answer to your problem is probably fog. We're going to try to create an effect where the edge of the water fades into a distant mist which in turn fades into the sky, thus obscuring the seam between the two.

1. Issue the following command:
SET OBJECT FOG SkySphereObjectNumber, 0
This will make it so that the fog doesn't effect the sky sphere.

2. Issue the following commands:
FOG ON
FOG COLOR RGB(255,255,255)
FOG DISTANCE NearDistance, FarDistance
These commands will turn on the fog, colour the fog (white) and set the near and far fog ranges. The colour of the fog probably won't be white. Grey or light blue or something - that's your call. The near distance is the distance at which the fog effect will begin and the far distance is the distance at which an object will completely obscured by the fog. Note: The help file lists the far distance as the only parameter; it will take both parameters as described. The far distance should be just inside the sky sphere. The near distance depends on how gradual a fade you want; play around with it. Obviously, the near distance has to be less than the far distance.

3. This is where you're going to have to get a little bit artistic. Since the fog won't be applied to the sky sphere, it's going to have to be painted on. Paint the bottom half - a little more than the bottom half, actually - in the colour of the fog. This colouring should gradually but quickly give way to the blue sky and the clouds. What we're going for here is that the colour of the sky sphere should be exactly the same colour as the fogged water at the points where they meet.

Hopefully, this will give you the effect you need. A possible problem that you may encounter is that the fog won't be applied properly to the water plain. If this is the case, you won't be able to use a MAKE OBJECT PLAIN command to make the water. You'll need to use a mesh for that.

Give this a go and see what you get. Let me know what happens.

- Jane
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 18th Jul 2007 20:28
I've been playing around with this and have found the following:

1. The far distance for the fog needs to be closer than "just inside the sky sphere".

2. Because of the size increase involved with putting the sky texture on the sky sphere, even a hard colour line on the sky texture will be pretty well blurred.

3. I don't know how high the camera is going in your program, but it may be necessary to place a FOG DISTANCE command in your program loop. This is because the fog distance is based on the camera's position and so as the camera goes up and down, the distance to the seam you're trying to hide will vary, therefore you may have to vary the fog distance.

I've attached an example that I made very quickly. While the quality is pretty ghastly, it shows the effect. There are basically two versions. If you run it as is, there will be an intermediate colour (grey) between the water and the sky. If you change the sky image from "Sky1.png" to "Sky2.png" and then comment out the first FOG COLOR command and uncomment the second FOG COLOR command, there won't be an intermediate colour; it will go straight from the water colour to the sky colour.

If you don't see the fog, press and hold the space bar. If the message says that fog isn't available, then your video card doesn't do fog.

I hope this helps. Let me know what happens.

- Jane

Attachments

Login to view attachments
GMX
19
Years of Service
User Offline
Joined: 19th Sep 2005
Location: In front of my monitor
Posted: 19th Jul 2007 06:22
I tried your approach and it seems to have worked.

If it doesn't work out, I will repost, but it is looking promising.

Thank you!

ZOMG

Login to post a reply

Server time is: 2024-11-26 12:34:13
Your offset time is: 2024-11-26 12:34:13