Author Topic: Skybox blending  (Read 4267 times)

0 Members and 1 Guest are viewing this topic.

motorsep

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Skybox blending
« on: May 16, 2015, 02:45:40 PM »
I remember seeing this video:


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

  • Sr. Member
  • ****
  • Posts: 374
  • Karma: +96/-87
  • Doom Newbie
    • View Profile
    • Scared Pixel Studios
Re: Skybox blending
« Reply #1 on: May 16, 2015, 03:06:52 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

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #2 on: May 16, 2015, 03:24:22 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

  • Sr. Member
  • ****
  • Posts: 374
  • Karma: +96/-87
  • Doom Newbie
    • View Profile
    • Scared Pixel Studios
Re: Skybox blending
« Reply #3 on: May 16, 2015, 04:28:24 PM »
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

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #4 on: May 17, 2015, 03:00:01 PM »
Check it out:


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

oneofthe8devilz

  • Sr. Member
  • ****
  • Posts: 374
  • Karma: +96/-87
  • Doom Newbie
    • View Profile
    • Scared Pixel Studios
Re: Skybox blending
« Reply #5 on: May 17, 2015, 08:02:35 PM »
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

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #6 on: May 17, 2015, 08:07:45 PM »
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

  • Sr. Member
  • ****
  • Posts: 374
  • Karma: +96/-87
  • Doom Newbie
    • View Profile
    • Scared Pixel Studios
Re: Skybox blending
« Reply #7 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...
I got six little friends and they all run faster than you ;)


Check out our mods at
moddb or the SPS Homepage

motorsep

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #8 on: May 18, 2015, 10:27:31 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

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +13/-1
  • idTech4 Mod Artist
    • View Profile
Re: Skybox blending
« Reply #9 on: May 20, 2015, 02:47:39 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

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #10 on: May 20, 2015, 07:06:20 PM »
Here is my material:

Code: [Select]
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

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +13/-1
  • idTech4 Mod Artist
    • View Profile
Re: Skybox blending
« Reply #11 on: May 20, 2015, 09:15:28 PM »
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

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #12 on: May 20, 2015, 09:17:07 PM »
Not a problem! Glad it worked for you :)

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: Skybox blending
« Reply #13 on: May 21, 2015, 11:39:49 AM »
that's pretty neat Motorsep :)

motorsep

  • Hero Member
  • *****
  • Posts: 1,039
  • Karma: +74/-131
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Skybox blending
« Reply #14 on: May 23, 2015, 12:02:18 AM »
More goodies:


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

Hopefully it will be a 3-layer skybox.
« Last Edit: May 23, 2015, 03:05:16 AM by motorsep »