News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Skybox blending

Started by motorsep, May 16, 2015, 02:45:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

I remember seeing this video:

https://www.youtube.com/watch?v=Knj_mhjzxTQ

and I thought stock Doom 3 can do the same as far as blending skyboxes. So I put that theory into test and apparently Doom 3 can not do skybox blending. Does the skybox on the video use special shader? Or is it not a skybox at all and just a skydome mesh ?

Thanks.

oneofthe8devilz

Quote from: motorsep on May 16, 2015, 02:45:40 PM
Does the skybox on the video use special shader?

Yes... it uses special shaders and netcode codebase optimizations to make the skybox transitions work properly across the network...
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

Quote from: oneofthe8devilz on May 16, 2015, 03:06:52 PM
Yes... it uses special shaders and netcode codebase optimizations to make the skybox transitions work properly across the network...

Oh, I see.. Somehow I thought it's just vanilla skybox :/

So the setup is the same as for standard skybox, just instead of standard skybox material it uses ARB shader?

oneofthe8devilz

IIRC I created Sky Entities to have more control over the time of day transitions.
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

Check it out:

https://www.youtube.com/watch?v=VsFIX9eg61Y

vanilla skybox blending has been figured out ;) No special shaders or extra code necessary!

oneofthe8devilz

Well... I think the really tough task will be to create useful dynamic scenes with the rbd3bfg build with cascaded shadowmaps and dynamic sky portal objects like suns, planets, moons for a dynamic time of the functionality...
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

I am not aiming at recreating reality ;)

Most likely I will only have sun/moons moving in the sky and skybox will be static. I have a few ideas how to have skybox rotating without rotating horizon, but we'll see if I can manage to implement that. I don't believe it's that critical.

oneofthe8devilz

As long as you keep your global light's color/intensity in sync with the skybox material, you should be good...
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

Quote from: oneofthe8devilz on May 18, 2015, 10:23:36 AM
As long as you keep your global light's color/intensity in sync with the skybox material, you should be good...

Is it even possible to do automatically? Or would I need to experiment and have pre-defined values to match skybox as close as possible ?

Bladeghost

Quote from: motorsep on May 17, 2015, 03:00:01 PM
vanilla skybox blending has been figured out ;) No special shaders or extra code necessary!

could you elaborate  and explain some detail as how to achieve this.
please and thanks

motorsep

Here is my material:


table skyboxFade { { 1, 0 } }

textures/skies/stars1_bw
{
    qer_editorimage   textures/editor/skybox_stars1.jpg
    noFragment
    noshadows
    nooverlays
    noimpact
    forceOpaque // allows for transparent windows to be drawn on top (in front) of the sky
   
    // Layer one -- alpha level
    {
        // first paint alpha only. This'll set how much of texture 1 and texture 2 to use.
        maskcolor           
        alpha skyboxFade[time*0.125]   // animate it
        map makealpha(_white)  // or any b/w TGA image really
    }   
   
    // Layer 2 -- the first skybox texture
    {
        blend gl_dst_alpha, gl_one      // similar to blend add but the colour will be modulated by the alpha level set above
linear
uncompressedCubeMap
        maskalpha                       // don't mess up our alpha layer that got painted above
        cameraCubeMap   env/stars1
        texgen          skybox
    }
   
    // Layer 3 -- the second skybox texture
    {
        blend gl_one_minus_dst_alpha, gl_one
linear
uncompressedCubeMap
        maskalpha                   
        cameraCubeMap   env/testX
        texgen          skybox
    }
}


You should throw away "linear" and "uncompressedCubeMap" tokens. Those are specific to our engine.

Just use it as any skybox material on your map :)

Bladeghost

Thank You for sharing this, I've gotten it to work just fine , now I just need to make some interesting skies. Thanks man! very cool!

motorsep

Not a problem! Glad it worked for you :)

BielBdeLuna

that's pretty neat Motorsep :)

motorsep

#14
More goodies:

https://www.youtube.com/watch?v=QWMPULF3vyc

Still a few tricks required before I think it works for the purpose.

Hopefully it will be a 3-layer skybox.