Help in my Shader Learning Journey.....

share shaders here
  • Author
  • Message
Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Help in my Shader Learning Journey.....

Some of the things I am currently curious about are, are there certain effects that would go in enbeffect vs enbpostprocess? how do you decide, how many effects can you do?

Also, in the .fx files under external enb parameters, do not modify, when it says things like

Code: Select all

//x = Width, y = 1/Width, z = aspect, w = 1/aspect, aspect is Width/Height
float4	ScreenSize;
does that mean ScreenSize.x = Width, or ScreenSize.z would give you the aspect ration? or am I off base? Also, are there any hidden variables that are baked into the ENB itself?


Also, has anyone figured out how make the DOF actually center on the cross hair yet? I've tried playing with various settings and all it did was mess it up to where it was way off, so I'm still playing.

In enbdepthoffield.fx, what info does DofParameters hold? I see in the smooth by time portion, DofParamets.w gets used, but what does the .w provide? I didn't see any annotations for what the .w or anything for that was. Are there other variables that can be tacked on to the end of it, and is there a list?

Sorry for all the questions, just trying to learn as much as I can about this. Thanks everyone.

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

Re: Help in my Shader Learning Journey.....

1. there isn't any strict rule on where to put things, but each files has different resource (external inputs, textures), which makes them only suit for certain tasks. per say, enbeffect has adaptation, bloom, dof, lens inputs, so it is work as central hub that combines all those stuff. postprocess doesn't have those and use enbeffect result as input texture, but it support multi pass effects and temporary textures.

2. the external parameters are the resource mentioned above. they are as description says. don't know about hidden variables since they are hidden...

3.1 change this under PS_ReadFocus will make dof focus on screen center.

Code: Select all

//  original	        float	tempcurr=TextureDepth.SampleLevel(Sampler0, coord, 0.0).x;
			float	tempcurr=TextureDepth.SampleLevel(Sampler0, 0.5, 0.0).x; // <--replace coord to 0.5
3.2 DofParameters //z = ApertureTime multiplied by time elapsed, w = FocusingTime multiplied by time elapsed
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Re: Help in my Shader Learning Journey.....

Awesome, thanks... This is a lot to take in at first, but its getting easier. I'm sure it will just take time, plus just getting in there and doing it to truly start grasping it.

Offline
Posts: 3
Joined: 27 Nov 2015, 15:44

Re: Help in my Shader Learning Journey.....

King1992, I have been here for years and only recently signed up. Just wanted to say, there are some contributors around here that deserve some gratitude and you are definitely among them. I thank you for all you do man, It's very appreciated.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: Help in my Shader Learning Journey.....

King1992, I have been here for years and only recently signed up. Just wanted to say, there are some contributors around here that deserve some gratitude and you are definitely among them. I thank you for all you do man, It's very appreciated.
I second this! You are a generous and helpful gentleman and scholar :)
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Re: Help in my Shader Learning Journey.....

tapioks wrote:
King1992, I have been here for years and only recently signed up. Just wanted to say, there are some contributors around here that deserve some gratitude and you are definitely among them. I thank you for all you do man, It's very appreciated.
I second this! You are a generous and helpful gentleman and scholar :)

Here, Here..... :) Everyone love Everyone :) some of the people I've met here are nothing but helpful, and I for one am grateful.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: Help in my Shader Learning Journey.....

EDIT: USER ERROR - post removed. To be clear, the code tip from Kingeric WORKS!
Last edited by tapioks on 15 Dec 2015, 02:41, edited 1 time in total.
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1938
Joined: 05 Mar 2012, 02:08

Re: Help in my Shader Learning Journey.....

You did something wrong, as it is just simply to enter a constant to center the focus point rather than to have a dynamic one with coords.xy as in the default file.
Have you altered or added anything else to the file?

PS_ReadFocus

Code: Select all

float tempcurr=TextureDepth.SampleLevel(Sampler0, 0.5, 0.0).x;

Offline
User avatar
*blah-blah-blah maniac*
Posts: 849
Joined: 28 Dec 2011, 00:50

Re: Help in my Shader Learning Journey.....

@JAWZ

There was something else wrong. I just reinstalled the default depthoffield.fx and made the edit again ... and success! :)
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

Offline
*master*
Posts: 144
Joined: 10 May 2015, 04:33

Re: Help in my Shader Learning Journey.....

I guess I was so happy playing I forgot to mention that the code was spot on.. Only thing off is cut scenes.. You have to move the stick over to line up right, but Im sure as time goes on, we may be able to find a way around that. Me personally, I loved the tilt shift DOF from the skyrim and FO3 ENBs I used, and am going to start my hand at adding one of those.. Now I have to go find them again..

I've been stocking up on reading materials like GPU Pro books and the older ShaderX stuff. What my end goal is to be able to see some theory or whitepaper that somebody does all these formulas and translate that into the shader code to use in a practical form.

P.S. For those that do write custom Shader Code for ENB's, are we somewhat limited to what is made available through each section of the ENB, vs if we were saying writing it into a full fledged game in C++ and had full access to DirectX and the GPU, we would have all the sections for each part, or am I thinking about this wrong?

And after the ENB's are developed more, is there a guideline, or an outline that shows what is exactly made available for each part, or only what is shown in the code for said shader and its up to us to work with those confines
Post Reply