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 / Imitate curved horizon with flat tiles

Author
Message
Deego
18
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 7th Oct 2010 22:33
I'm building 3D planet flyover. I built a system of tiles that loop around as the player moves directions Z and X at height Y above the surface, and models of craters/rocks/etc. will be positioned randomly across the surface. This allows the player to move about an infinite planetary environment without having to model an entire planet every time I want to change things a bit.

It works well, but it looks a bit too flat. I want to emulate a curved horizon. Is there a way to "inflate" or change the camera view to make straight lines seem curved? If I can do that, I can render the planetary screen to an image, use that as a backdrop, and then deactivate the camera modification and render the inside of the spacecraft to keep the straight lines.

Is that possible? Is there a way to curve the rendered image? Besides actually using a sphere, is there another way to make flat tiles appear curved?
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th Oct 2010 22:56
I guess maybe playing with camera FOV and a special camera angle could produce the effect, but this is just a guess.

You could generate the terrain curved, and also place the objects on it using various options available... Some of them i would give the first shot: sin(), cos(), new-x/y/z-value()...
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Oct 2010 19:04
Why not just make some curved tiles? I don't think there's a way of producing a 'fish-eye' lense effect. Not that I've come across anyway...

Deet
16
Years of Service
User Offline
Joined: 15th Mar 2010
Location:
Posted: 9th Oct 2010 08:06
Wouldn't making a convincing curve require a lot of polys? Then there's the matter of accurately displaying textures on a curved UV, which is what I wanted to avoid. It was quick to set up the tiles so the texture is always right.

So I don't have to recode what I've already done, I'm making the HUD and spacecraft details obscure the edges of the screen, kind of like how a standard resolution image displays on a HDTV.
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 9th Oct 2010 12:46
You could use vvertex manipulation to change the y values of objects far away from the viewer

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Oct 2010 16:55
Dr. Tank made a fisheye shader demo that could be useful:
http://forum.thegamecreators.com/?m=forum_view&t=170392&b=6


Guns, cinematics, stealth, items and more!
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Oct 2010 10:41
Quote: "Wouldn't making a convincing curve require a lot of polys?"

Not really, if you look at a dbp sphere with only 20 columns it looks pretty smooth.

Quote: "Then there's the matter of accurately displaying textures on a curved UV, which is what I wanted to avoid"

If you don't have the right tools or knowhow then I can see that as a problem.

What about using a curved "fog" image a set distance away from the camera?

I like Dr.Tanks fisheye shader!! I'll be using that on a screensaver I'm making for a friend's band...

Login to post a reply

Server time is: 2026-07-22 03:51:32
Your offset time is: 2026-07-22 03:51:32