Landscape, Skybox, Water

Started by
18 comments, last by tcs 23 years, 5 months ago
Quite frankly, you''ll either have to settle for a finite plane or you''ll have to use fogging.

In the real world, the Earth is curved, so the horizon stops at a certain point. Using a flat plane would necessarily make the horizon look fake. You might be able to simulate a real horizon by extending the plane when the viewpoint is raised. The trouble is, you have to have a huge terrain to make it look decent when you have a raised viewpoint. Flight simulators, I believe, actually use a curved planet model and fog to stick their terrain and textures on. You could simulate a curved ocean by doing a planet surface tangent-line check along the side planes of your view frustrum and then drawing a polygon out to the points you found, maybe splitting it up a little. If you can only see a portion of your terrain at a time, you really shouldn''t try to create an infinite ocean. It would just look wrong if you had terrain that stopped with the ocean extending further out.

Your problem really doesn''t have a simple solution. If you''re trying to mix an ocean with a planar-based terrain engine, you''ll have to clip out the plane at some point.
Assassin, aka RedBeard. andyc.org
Advertisement
microdot, I ***DON''T*** have a problem with my Skybox !?! Is my explanation so hard to understand ? My Skybox looks right, and using a sphere instead of a cube has zero advantage because the image will look the same... I mean the images are distorted so that they look right on a cube, and they do ;-)

TUna: Generated with Bryce. There''s a tutorial on gamasutra.com. But this tutorial is wrong ;-) But it provides a link to a site called Rusty or so. This link is wrong ;-) But if you go to the tutorials section of the site, you''ll find a very good tut on how to make skyboxes with bryce...

Assassin: Yeah, that''s probably right. I have to fog the ocean as well as my terrain. I just think it looks silly when your heighmap "ends" somewhere, the scene looks better when you treat the heighmap like an island... The trick with expanding he plane when the viewpoint is raised works, but at some point the plane must be incredible large to approximate such an infinite/round Ocean. The worst problem is not clipping the plane at some point, it is that you see the Ocean plan moving against the skybox when you raise your view, something that is very normal for such a small plane ;-)


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Hm.. I think I explained my idea badly. What I meant was for you to do all the calculations in object space for your water, but then project it into screen space manually. This is exactly because you don''t have the ability to draw an infinite plane. And that''s why I suggested using a raytracer for the intersection with the sides of the screen, they support infinite planes .

Even so, I have no idea if this will work, or if it''s viable still .

PreManDrake
A raytracer ? Ha ? I''m using HW OpenGL, I don''t have the option to use a raytracer for rendering a quad or so... I surely can project the water plane in this way, but how crappy would this look ? I mean it is a fixed plane, I can''t move it around, and I can''t project it in screen space this way, just imagine how broken this would look


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
I''m still waiting for a pic of this in a real engine.....
Well, i can think of two easy suggestions:

1. Dont move the cam''s y pos. Then you dont have to deal with how it looks.

2. dont have your world''s x scale = the y scale. meaning, move upwards (y) slower than you do sideways (x,z). this would have the effect of going higher than you actually are, so any visual funnies (ie your ocean lookign like a pond) could be attributed to how high you supposedly are, get my meaning?

I hope so that helps... (i cant really help on teh programming part, cuz im still learning how to do 3d stuff)


Jjesterr
Acolyte in Traning

"A smile can take you a long way. A smile and a gun will take you even farther" - Al Capone
"A smile can take you a long way. A smile and a gun will take you even farther" - Al Capone
ok.

Option one is not suitable for my engine. And that''s the point. I mean a skybox looks always good why you just rotate it, but you never translate it. Something I need to do for my water, too. But I can''t do that because the water is also a part of the terrain, which has to be translated to simulate the observer''s movement ;-)

2.) I don''t get the idea of this. Sounds intersting, could you try to explain it, maybe it works ?



Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
quote:Original post by tcs

Damn, does anyon know how somce commercial engines solve this problem ?


NetImmerse (www.ndl.com) uses fog. CryEngine (something new, see www.crytek.de) seems to use fog. The Unreal2 new technology demo (see media.dailyradar.com/images/pc/unrealtech/terrain4.jpg) seems to use fog.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on November 3, 2000 4:31:18 PM
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
yes, thanx. Maybe the fog approach looks better when my water has the same color as my background, and the background below the skyline gets a single color which fog could blend to...



Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
I am not sure if you will get what I am trying to say.

Rotate but not translate your skybox, then tile your water (curving each tile further away from the center of where the player is). That way when you keep moving over the water, the water looks like it is going by, you are getting further away, and the water could look somewhat infinite. As the player''s location goes up, don''t translate the skybox, but slow the player''s ascent. This way, the player can''t get too high, and if the player does, they would see the curvature of the water like in real life.

I hope that made sense.

"Any statements made by the above poster are strictly opion (unless otherwise stated) and may be offensible to some readers."

This topic is closed to new replies.

Advertisement