Postprocess shaders for sky

Moderator: GZDoom Developers

Post Reply
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Postprocess shaders for sky

Post by Marisa the Magician »

This is kind of a wild idea but... How about a postprocess shader that applies on top of the sky? (I assume skies are done on a separate render pass). An "aftersky" keyword has been suggested for this.

Being able to make procedural "backgrounds" would be fun. There are some things that just aren't easily doable with conventional skyboxes.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Postprocess shaders for sky

Post by dpJudas »

Can't you just use a texture shader for this in a conventional skybox?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Postprocess shaders for sky

Post by Graf Zahl »

Skies are NOT done in a separate pass, they are drawn into a stencil of the main scene (or, if there's only one portal effect, drawn into the framebuffer before rendering the rest on top of it.
There is no guarantee that there ever is a framebuffer that could be run through the postprocessing logic.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Postprocess shaders for sky

Post by Pixel Eater »

I briefly considered using chroma-keying (as Nash puts it) to recreate the invulnerability bug until it occured to me that I'd have to work out how to rotate and stretch the sky. So there is one way to do it unless you want compatibility with translucent sprites (they look like ass when they get between you and the "green screen").
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Postprocess shaders for sky

Post by Rachael »

Chroma keying the sky comes with a number of issues beyond just the transparency issues. I do wish the system was a bit more flexible than it currently is.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Postprocess shaders for sky

Post by Graf Zahl »

What's the point of chroma keying when you have a real separate stencil value at your disposal?
The main issue here is that the engine has to account for so many possibilities, most importantly that a map can have more than one sky visible at the same time. It's not all that simple.
User avatar
Pixel Eater
 
 
Posts: 667
Joined: Wed Aug 02, 2017 12:31 am
Location: In between the Moon and you, between the buried and me.

Re: Postprocess shaders for sky

Post by Pixel Eater »

I'm not sure what a stencil value is? It sounds like something useful :)
ChromaSky.pk3
(35.47 KiB) Downloaded 53 times
I knocked this up anyway just to see it in action. You could further animate it or warp it, but really it needs some rotation and stretching with the mouselook to match the original sky.

It's a "Shader in the Sky with Mountains" :lol:
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Postprocess shaders for sky

Post by Marisa the Magician »

Do we have stencil access in pp shaders though?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Postprocess shaders for sky

Post by Graf Zahl »

Marisa Kirisame wrote:Do we have stencil access in pp shaders though?

Currently not, because the stencil normally gets overwritten right afterward when sprites are being done. In any case, the pp shaders will get to the buffer way too late to do anything useful with it.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”