Skylight Shaders

share shaders here
Post Reply
  • Author
  • Message
Offline
*sensei*
Posts: 373
Joined: 07 Mar 2013, 10:14

Skylight Shaders

Hello all ya happy code monkeys and tweakers alike!

I figured it would be about time to create a thread here as well for my shaders. They include the current versions I use for my preset Skylight ENB and perhaps there is something that someone else will see as useful.
Currently I have made my own enbeffect.fx, enbbloom.fx and enbeffectprepass.fx file. I will quickly provide a short list of the features that are not just generic.

The general point in all my shaders are gameplay! Hence I value the both decent performance as well as features that does not distract one too much while playing.

enbeffect.fx:
Everything is sort of tidy and most functions are moved into separate files in order to tidy up the file and make it easier to read and understand what is going on.

Adaptation controlled vanilla bloom (OF DOOM!):
Essentially this makes the vanilla bloom effect dynamic.. the brighter the image the less bloom is applied to the image.
Finally a real use for the vanilla adaptation and bloom in ENB.
One could expand on this and include the ENB controlled bloom as well if one wanted to make everything more dynamic.

Exposure based on adaptation:
I have linked adaptation with the general exposure levels which in my experience allows for a really smooth control of the adaptation effect... as long as it is used within reason, and only the ENB version of it is used. It does however also work decently with the vanilla implementation if one wants to use it.


enbbloom.fx

Gaussian blurred depth based bloom (done by vertex):
I use the vertex shader to calculate the positions of a gaussian blur on the bloom, and then apply differently at various depths. I have also made it so that one can somewhat control where the bloom is applied... hence you can make sure no bloom is applied up close but only at a distance... and vice versa. You can also create a belt of bloom in between far away and close up.

The reason I calculate in vertex is because... nobody else does it, and it does provide a bit better performance then doing it all in a pixel shader. I suspect this is because the GPU is much better at doing large matrix multiplications rather then sequential calculations.
The down side is that the tap size of the blur is limited.


enbeffectprepass.fx

Basic bokeh DoF:
It is mainly just that... a basic Bokeh DoF with really low performance costs. I added in the feature to make the close up areas blur radially rather then linear... this prevents the annoying weapon blurring, as well as working better in general.
I also included a basic example on how to include other functions to get all fancy with having certain color effects only affect the blurred parts.



That is about it! I hope some of you will find a good use for some of these ideas, and perhaps build upon them to create even more pretty and epic stuff!
Attachments
Skylight Shaders.rar
(23.07 KiB) Downloaded 597 times

Offline
User avatar
*blah-blah-blah maniac*
Posts: 983
Joined: 09 Dec 2012, 00:29

Re: Skylight Shaders

Thanks for sharing your great effects :)
_________________
Rudy ENB for Skyrim, Skyrim SE, for Fallout New Vegas, for Dragon's Dogma

English is not my native language.

AMD Ryzen 9 5900X, Gigabyte B550 AORUS PRO AC, Arctic Liquid Freezer II 280, Nvidia Geforce RTX 2070 Super, 64GB ram

Offline
User avatar
*blah-blah-blah maniac*
Posts: 3123
Joined: 27 Jan 2012, 13:42

Re: Skylight Shaders

Thanks for sharing, that's a great toolkit for anyone no matter whether just starting out or simply wanting to expand their horizons by checking out new stuff.

I haven't tried your adaptation yet, but the bloom seems visually very nice and thanks to depth testing it's possible to achieve some pretty nifty effects with it.

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: Skylight Shaders

vertex shader only execute once per vertex, so moving the constant calculation to it can boost some performance.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*sensei*
Posts: 344
Joined: 17 Jul 2013, 18:41
Location: Germany

Re: Skylight Shaders

Thanks for sharing, the dynamic Vanilla Bloom sound really interesting for me.
_________________
YouTube: http://www.youtube.com/user/ScytheOfSteel
Water plugin for Realistic Water Two and ENB

Intel Core i5-3570 @ 4.00GHz | 8GB Corsair Vengeance DDR3 1600 | Asus Geforce GTX 670 DirectCU ii 4GB Vram | Win7 64bit on Samsung SSD 840 120GB

Offline
*sensei*
Posts: 373
Joined: 07 Mar 2013, 10:14

Re: Skylight Shaders

The dynamic bloom is really easy to implement on just about all files currently around, so just copy paste that part if that is what you want into your own file.


@kingeric: What constant do you refer too ?

Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: Skylight Shaders

I'm just saying the reason for the performance gain from moving calculations to VS.

Computations that independent to pixel position will return constant value to all pixel in each frame, so instead of repeating the process in PS millions of times, moving them to VS can increase some performance.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*sensei*
Posts: 373
Joined: 07 Mar 2013, 10:14

Re: Skylight Shaders

Ah okay like that! Yeah that does make a lot of sense.

I first thought you had a trick to get even more performance which would amaze me! Since afaik this setup is fairly hard to optimize further.... short of typing things in ASM, which will not happen ever because I hate writing in ASM.

Offline
User avatar
*sensei*
Posts: 344
Joined: 17 Jul 2013, 18:41
Location: Germany

Re: Skylight Shaders

@Ayen: Thanks , that sounds pretty awesome! Goes the same thing for the Adaptation based Exposure?
_________________
YouTube: http://www.youtube.com/user/ScytheOfSteel
Water plugin for Realistic Water Two and ENB

Intel Core i5-3570 @ 4.00GHz | 8GB Corsair Vengeance DDR3 1600 | Asus Geforce GTX 670 DirectCU ii 4GB Vram | Win7 64bit on Samsung SSD 840 120GB

Offline
*sensei*
Posts: 373
Joined: 07 Mar 2013, 10:14

Re: Skylight Shaders

It will require a bit more, but it is documented how to include the file and call the function into your enbeffect.fx file. Just make sure you disable other lines that deal with adaptation as well. Or try out having more things going... my own short experiments down that road did not produce anything worthwhile. Mainly because the more dynamic parameters you got going, the more you narrow your options without issues.
Post Reply