Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Vlad Andreev, posted on September 14, 2000




Image Description, by Vlad Andreev



This is something that was thrown together over the course of about ten hours after having been awake for a good 30 hours prior to that. Nothing terribly amazing from the technological standpoint, but it looks fairly nice so I thought I'd submit it. Also, the landscape parade has been dying down, and I thought it'd be a good idea to resurrect it :).


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
9600man

September 14, 2000, 04:11 AM

Wow, i'm impressed. I just started to learn OpenGL a month ago, so to me almost everything seems impossible to code. :)
How did you create the "land" and then the "water" to fill up the parts where you want it?
I know it sounds vauge. I had a few other questions, but i did just start, and i want to keep it simple.
Other then that, i like it a lot.
Oh, and for reflections, does one need to use reflection maps, or can one use certian algorithms to proximate a reflection on a surface?

Cheers

 
malkia/eastern.analog

September 14, 2000, 04:26 AM

cool! goltrpoat, you cyberhomo!

 
goltrpoat

September 14, 2000, 05:01 AM

9600man:

The land is a perlin noise function, 3 or 4 octaves. The input is modulated by a sine wave to create some ridging, although you can't really see that in those shots.
As far as reflections go, the water is at a constant water level, I basically clipped the part of the world that's above the water at that level, then rendered it again, this time turned upside down and clipped at the same plane but with the normal pointing down.
Then I rendered the water as two horizontal multi-textured triangles with the 'u' coordinate offset by a function of time, so it looks like you're standing in the middle of a stream. That's basically the fake reflection algorithm you use when you have 10 hours to code the entire thing :)
Reflection maps are another way to fake proper reflections, in that they don't reflect, pardon the pun, dynamic changes in geometry within the scene. It's possible to overcome that by taking a shot of the scene with a 360 FOV camera every time the geometry changes and using that as the reflection map, but it's not terribly efficient. One way to speed that up is to create a static reflection map with the static geometry and then render only the dynamic objects with a 360deg camera and add up the two maps. I personally would suggest looking into portal based rendering though for a simple and efficient way to do flat reflections (curved reflective surfaces are also possible with portals, but involve some fairly intersting math).

malkia:

umm.. good afternoon to you too.

-goltrpoat

 
morgan

September 14, 2000, 08:07 AM

9600man:

The portal technique goltrpoat mentions is very similar to what he actually did in the engine. When rendering a "reflective" portal (e.g. a mirror polygon), you set your clipping planes to the edges of the portal, reflect the transformation matrix about the plane of the portal (reflect each of the first 3 column vectors of the matrix through the portal plane), then re-render the scene. You can alpha blend a nice surface on top to make the mirror more interesting.

Note that this turns counter-clockwise polygons into clockwise polygons. One of the features of the approach is that you don't have to store geometry twice, or modify it (by changing the transformation only, you can use your existing vertex buffers, or even whole display lists).

goltrpoat:
Nice! How are you rendering your background? The slightly polygonal curvature of the moon in the lower left shot suggest an Unreal-style sky-sphere. Everything is beautiful!

-morgan

 
goltrpoat

September 14, 2000, 08:32 AM

morgan:

thanks :). the sky is actually a skybox, i had a bit of a fisheye effect going on (low FOV camera) since when in motion it added to the atmosphere i was trying to convey, so that's probably why the moon gets distorted at certain angles.

by the way, the full demo (second place at coma2) can be found at ftp://ftp.scene.org/pub/parties/2000/coma00/demo/runscenerrun.zip

make sure you have card specific opengl drivers. it may not work on NT or win2k, and won't work with voodoo1, 2 and 3 due to the 256x256 texture size cap. that can be alleviated however by breaking out photoshop and resizing every texture in the demo :).


-goltrpoat

 
krogoth

September 14, 2000, 09:41 AM

Nice pic.....you might want to try relfecting the sky too, unless this is a one-(screen)shot demo :)

 
goltrpoat

September 14, 2000, 09:57 AM

the sky reflects as well. if you notice in the upper left shot, there are stars being reflected by the water :).

 
The Wolf

September 14, 2000, 01:19 PM

Very Nice.

would be awesome if the planet is seperate from the skybox and is animated..

 
krogoth

September 14, 2000, 08:14 PM

cool....never noticed that, and i haven't gotten to that part in the demo yet :(
It is in the demo, right?

 
malkia/eastern.analog

September 14, 2000, 11:15 PM

Cool music tunes!

I saw the demo - a little bad looking on my LCD monitor, but I'm sure it's because of monitor (everything look little smooth on it - HP Pavilion FX70). Or maybe Detonator drivers were crap - i was seening also Vertical blank interrupt line, maybe you were not doing VSync(0)?

I saw something very interresting - I'm supposing that your part of the demo was actually a software renderer - the only screenshots are from. Am i right? It was fine in 1024x768x32...

 
9600man

September 15, 2000, 04:10 AM

thanks for the insight guys. appreciate. I'm sure that once i get more and more into opengl, i'll actually understand what was said. : )

Cheers

 
goltrpoat

September 15, 2000, 05:11 AM

malkia - thanks. hmm.. actually, everything should be more or less hardware accelerated via opengl, why do you think it was in software?

 
goltrpoat

September 15, 2000, 05:13 AM

krogoth - yep.. its the last part of the demo

 
MasterBoy

September 15, 2000, 11:25 AM

First of all: golt, make it work on win2k, dammit!
None of my friends have win98 with a decent video card. Maybe you or vasta could make some screenshots for me? ;)

9600man: OpenGL has got nothing to do with it. OpenGL is just an API that lets you communicate with 3d cards. What you need to learn is 3d theory. Knowledge of the API would help, but it's not something I'd focus on.

 
This thread contains 14 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.