Archived

This topic is now archived and is closed to further replies.

tcs

Landscape, Skybox, Water

Recommended Posts

tcs    122
Hi ! I''m facing a tough problem while making my new landscape engine. (also known as pic of the day generator for flipcode.com ;-)) I have quake 2 style skybox (a cube with six correct distorted textures). Now I want that my water fits seemless into the horizon. My terrain is an isle that is surrounded by this water. But I can''t get this look nice. When I make the water surface very very large, it logically looks like it would go till the horizon... but not really, when you raise your viepoint you''ll see the fake ;-) So my water surface must beof infinite size to archive the effect, damn ;-) Any ideas how to solve this ? btw: horizon, horizone, horizont ??? shame on me ;-)) Tim -------------------------- glvelocity.gamedev.net www.gamedev.net/hosted/glvelocity

Share this post


Link to post
Share on other sites
tcs    122
To use fog at all I would need range based fog , and this is only supported on the ATI Radeon. I can''t use blending, because this would look artifical.

And even if those two methods would look good, they still wouldn''t solve my problem... When the cam y position changes, you would see how the finite water plane moves against the infinite skybox, that''s my problem...


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity

Share this post


Link to post
Share on other sites
Premandrake    175
I have a funny idea.. might work, and then again maybe not .

If you solve the problem in screen space, then you can always draw to the edge of your screen and thusly, the person will never see the edge of your water . So first you need to calculate where the water intersects the screen edges, then draw that 4 sided poly. To find texture coords, perhaps raytrace the intersection points as an infinite plane and then let the hardware interpolate for you.. Of course, z info will be tough to come up with.. hmm.. interesting, I think the raytrace of the infinite plane would solve this also.

So, in summary, I have no idea if this works, but try solving for the intersection with screen edges using raytracing and then draw the four sided poly in screen space using the info that the raytracer returns.. Of course this could be garbage, but who knows . Good luck!

PreManDrake

Share this post


Link to post
Share on other sites
tcs    122
Nope, I can''t do screenspace. If so, I had made the water part of the skybox. My water i just a plane somewhere in the landscape, I need to have it in object space.

Your approach looks interesting, but I can''t draw an infinite plane (glBegin(GL_INFINITE_PLANE) ;-) ) and I can''t make my water plane fit into this concept ;-)

Nice idea anyway...

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


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity

Share this post


Link to post
Share on other sites
zedzeek    529
Damn, does anyon know how somce commercial engines solve this problem ?

do u know of any screenshots of a comericial game doing this


http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
tcs    122
hey, I don''t have a problem with the skybox !?
I want to fade my water plane into the horizone. To do this I need to have the effect of an infinite large water plane without actually rendering one...

I guess this DGMZ demo or some flight sims need to do this..


Tim

--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity

Share this post


Link to post
Share on other sites
microdot    324
I''ve never actually done this, but it sounds like it should work. How about using a sphere instead of a box. This should work just as well, if not better, when you keep the sphere centered on the player. You horizon then would look correct no matter what direction you look.

Share this post


Link to post
Share on other sites
Assassin    246
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.

Share this post


Link to post
Share on other sites
tcs    122
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

Share this post


Link to post
Share on other sites
Premandrake    175
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

Share this post


Link to post
Share on other sites
tcs    122
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

Share this post


Link to post
Share on other sites
Jjesterr    122
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

Share this post


Link to post
Share on other sites
tcs    122
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

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
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

Share this post


Link to post
Share on other sites
tcs    122
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

Share this post


Link to post
Share on other sites
Moe    1256
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."

Share this post


Link to post
Share on other sites