PDA

View Full Version : gamedarwinia: digital sky - howto create similiar effect?



herc
04-11-2006, 09:49 AM
http://www.coreloop.com/darwinia_sky.jpg

hello experts, do you know how to create this sky-effect from darwinia?
creating a texture with random bits and moving two/three quads with different speeds is no big deal, but how to create this blending / bleeding effect that looks like hdr rendering?
any idea? is it a sort of bloom? (and how do i do this?) help is appreciated!
regards, andre!

04-11-2006, 11:09 AM
hmmm... when i first looked at the image, i thought you were going to ask how to fix the sky, not emulate it. perhaps the screenshot doesn't do it justice.

bloom like this could be hacked with saturated additive blending or blurs of scene light emission. it depends on the target hardware how fancy you get.

cool bloom can be made by taking the image of the rendered sky or any other emissive objects, down-sampling it by 1/2 or so, then adding it back to the scene by way of a fullscreen quad, as a post-process effect.

you could also simple add little light-sprites of varying shapes and size to the cloud areas. clouds of additive blended sprites/particles can create some nice turbulent/bloom like light effects.

quad

herc
04-11-2006, 12:28 PM
thanks! i think i will have a try at additive blending!

why fix it? i found the effect to be cool! has a taste of retro feeling..

herc
04-11-2006, 01:53 PM
jepp, tried it:

glBlendFunc(GL_SRC_ALPHA, GL_ONE);

just does the job.

my first result:
http://www.coreloop.com/my_first_sky.jpg

pretty ugly ;-)

maybe i should a real skydome, like in this cool demo (from 2001!!)
http://www.coreloop.com/terra3d.jpg
http://www.gldomain.com/Programs/Terra3D.htm

04-11-2006, 02:37 PM
>> why fix it? i found the effect to be cool! has a taste of retro feeling..

i didn't mean any offense at all. i like the little village below, or whatever it is. i'm all kinds of into retro and all that :)

cheers from the quad

04-11-2006, 02:54 PM
>> pretty ugly ;-)

not really. the cloudy areas look cool, but the grid/lines make it look a bit busy... kinda cluttered... too much high frequency or something. maybe it's just me...

04-11-2006, 02:59 PM
actually, it looks like the first image is "fogged" to black in the distance, which tones this down quite a bit. perhaps that would help, a gentle fade to black or some dark background color in the distance, to even out the tones a bit. sometimes less is more.

herc
04-12-2006, 04:41 AM
yes, i want to do fogging!! but -- i have problems with that.. using


glFogCoordfEXT(0.0f);glTexCoord2f(0,0);glVertex3f( ...);
glFogCoordfEXT(1.0f);glTexCoord2f(1,0);glVertex3f( ...);
...etc

on the sky quads similiar to texturing seems to fix the fog effect to the quad orientation regardless on camera orientation/rotation.. so if i rotate myself 180°, there will be no fog at the other end of the skyquad.

do i really have to calculate the value to glFogCoordfEXT every frame from the projection matrix?

Overmind
04-12-2006, 04:45 AM
No, just don't use the fog coordinate. It is meant as an override to implement fog with variable density.

You shouldn't put your camera transformation on the projection matrix. When you put it on the modelview matrix, fog works as expected without fog coordinates.

04-12-2006, 10:15 AM
another problem with fog coords is that you need pretty good tessellation in your geometry to avoid some rather nasty visuals. if the eye is in the middle of 1 big quad, and you calculate the fog factor based on the vertex distance to the eye, it will be the same for all 4 vertices, so the entire quad will have a single constant fog factor, which is not very interesting imho. vertex based stuff usually needs decent subdivision.

if you do use the fog coord, remember to render the skyquad centered about the eye, so the eye relative fog factors remain fixed. the assumption here in that the sky is big enough and far enough away that you'd never really see it move anyway.

04-23-2006, 04:19 PM
http://www.coreloop.com/dump/20060424.jpg

here is my current sky: i had to drop using fog, because fog simply does not work together with
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
except for completely dark backgrounds and black fog. in any other case the texture+fog does not blend to fog color in the distance.
so i decided to sudivide my big cloud quad into 10x10 quads and colored the quad vertices with decreasing alpha-values the farther the quad was away from the viewer. this works rather fine, as you can see in this screenshot. here i took a static skybox in combination with my moving texture clouds.
here is a demo file: 2006.04.24.sky.zip (http://www.coreloop.com/dump/20060424sky.zip)

herc
04-23-2006, 04:22 PM
http://www.coreloop.com/dump/2060424sky.jpg

here is my current sky: i had to drop using fog, because fog simply does not work together with
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
except for completely dark backgrounds and black fog. in any other case the texture+fog does not blend to fog color in the distance.
so i decided to sudivide my big cloud quad into 10x10 quads and colored the quad vertices with decreasing alpha-values the farther the quad was away from the viewer. this works rather fine, as you can see in this screenshot. here i took a static skybox in combination with my moving texture clouds.
here is a demo file: 2006.04.24.sky.zip (http://www.coreloop.com/dump/20060424sky.zip)

earthquad
04-23-2006, 04:33 PM
Nice job, Herc. That reminds me a lot of the sky in Unreal.

Another possibility is to use an alpha texture with a radial falloff instead of the subdivision. That'll give you per pixel blendable alpha that you can modulate or replace in your texture combiner. You can use a texture "lightmap" for the coloring, too. But I'm not sure that's what you're after, and it might not really look any better.

herc
04-24-2006, 12:36 AM
@earthquad: yes! thanks for the advice! its finally time for me to try out multitexturing :-)
your method should speed up the rendering alot, i suppose, compared to subdividing into 100 quads?

earthquad
04-24-2006, 01:44 AM
i dunno about being any faster, 100 quads isn't much these days. I'm rendering my sky/atmosphere with a skydome that has thousands of triangles in it. It really depends on what you're doing and what kind of hardware you intend to use. Btw, what kind of hardware are you working with?

Textures can give you a bunch of extra "snaz" for very little effort. They can potentially make things a bit smoother for the gradient stuff, and they can give you some artistic freedom.

herc
04-24-2006, 03:58 AM
i'm using my laptop with a gforce 5600 running in energy safe mode - thats why there are only 20 fps in the screenshot ;-)

earthquad
04-24-2006, 12:23 PM
ah, that explains it :)