Please use english language
It is currently 30 Mar 2017, 16:40

All times are UTC





Post new topic Reply to topic  [ 57 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: enblens.fx WeatherFX
PostPosted: 01 Aug 2014, 16:06 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 471
Location: Taiwan
Hi everyone,
this enblens.fx contains Boris' stock lens reflection/dirt & following weather specific effects.


Detail instructions are in the file.
Requirement:
enb 264+
Attachment:
File comment: update: Dec 9, 2016
WeatherFX.rar [1000.84 KiB]
Downloaded 123 times

It also contains .psd photoshop resource for creating droplets.
Use smudge tool and liquid filter to deform droplets.
video demo
and arrange them like this (will add more variant in the future....)
Image
(alpha channel is for alpha mask)

Thanks to number6 for discussing with me.
Thanks to abc for inputs and helping me testing weather settings.
Thanks to Boris making this possible with new parameters.

======= Additional Demos =========

Dynamic Lens Dirt:

Normal mapped Droplet:
amazing demo made by abc75179778300 (CR ENB)

Frost vignette for snow
Image


=======history version=========

Attachment:
File comment: update: Jan 17, 2015
ENBweatherFX.rar [819.56 KiB]
Downloaded 1081 times


=======update history=========

12/9/2016 update
Upload new file, allows more flexiblity and easy management.

1/20 update
change file host to enbdev
add a demo made by abc

1/17 update
update weatherFX.rar
add normal map droplet

12/7 update
Add WeatherFX.rar
description change
Topic change

9/5 update
Add link to CR ENB
update post Subject

8/30 update
testing weather trainsition
Rain:https://www.youtube.com/watch?v=CtcJKgOYcMk
Frost:https://www.youtube.com/watch?v=GGnwTLvR_fA
8/7 update
Frost vignette suggested by Insomnia

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Last edited by kingeric1992 on 08 Dec 2016, 18:40, edited 16 times in total.

Top
 Profile  
 
Tomoko
PostPosted: 01 Aug 2014, 21:06 
Offline
*sensei*

Joined: 28 Jul 2013, 23:26
Posts: 372
Not that I know an answer to your question, but just curious... you can configure different lens effects based on weather type? Does LensParameters contain the weather type somehow? That would actually be nice. If something like that is possible I may actually spend some hours into that shader.

Would anyway be great to have a parameter in the globals that has something like 0=sunny, 1=cloudy, 2=rain, 3=snow, etc


Top
 Profile  
 
PostPosted: 02 Aug 2014, 00:13 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 471
Location: Taiwan
Currently the LensParameters has 4 components, x=reflection intensity, y=reflection power, z=dirt intensity, w=dirt power, which are controlled by enbseries.ini. In order to pass weather parameters, the additional weather info need to encode to the floats, and since lens reflection and dirt effect don't necessary require high precision in my experience, I just utilize decimal parts( < 1.0 ).

for example
int is for original lens parameter
0.0~0.9 is rain parameter
0.00~0.09 is fog parameter
....etc

then
Code:
float orginalpara = floor(input);
float weatherTemp = frac(input); //utilize 0.1, 0.01, 0.001

float3 weatherpara = float3( floor( 10 * frac(weatherTemp)), floor( 10 * frac(weatherTemp * 10)), floor( 10 * frac(weatherTemp * 100)));
// x = 0.1, y = 0.01, z = 0.001


in this case, float4 LensParameter can save 12 weather info, it can also use BloomParameters instead in bloom.fx.
So for the raindrop effect, .0 is off, .1 ~ .9 is frequency parameter which can set according to the magnitude of rain.

cheers

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Top
 Profile  
 
PostPosted: 02 Aug 2014, 16:49 
Offline
*master*
User avatar

Joined: 21 Feb 2013, 03:21
Posts: 226
Location: Los Angeles, CA
This looks very interesting. You are showing us how you decode the LensParameters back into the weather values, but how do you encode the weather values into LensParameters in the first place?

Your blending values of SRCALPHA and INVSRCALPHA look correct for an over composite, so it's weird that color still shows through with an alpha of 1. Could it be something later in the pipeline like enbeffect.fx or effect.txt? Sorry I am also no more help there.

Thanks for posting, I am learning a lot! The effect looks great!

_________________
i7-4970K 4.8ghz, 16gb ram, Geforce Titan X 12gb vram, win7


Top
 Profile  
 
PostPosted: 02 Aug 2014, 18:43 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 471
Location: Taiwan
Sorry I didn't clear that out, this is encode method.
Quote:
for example
int is for original lens parameter
0.0~0.9 is rain parameter
0.00~0.09 is fog parameterr

just set lens parameters in weahter ini files.

so if I set lens intensity to 25.237, after decoding I will get
Code:
weatherpara.x = 2
weatherpara.y = 3
weatherpara.z = 7

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Top
 Profile  
 
PostPosted: 02 Aug 2014, 21:55 
Offline
*master*
User avatar

Joined: 21 Feb 2013, 03:21
Posts: 226
Location: Los Angeles, CA
Thanks, now I get it, LOL. Nice job!

As for making it more realistic here's a few suggestions:

- warp the uv coordinates based on a normal map to simulate refraction
- blur the affected area under a drop
- use more than one texture that is selected randomly
- make the drops grow slightly as they fade out

Just some ideas. It already looks pretty great!

_________________
i7-4970K 4.8ghz, 16gb ram, Geforce Titan X 12gb vram, win7


Top
 Profile  
 
PostPosted: 02 Aug 2014, 23:22 
Offline
*sensei*

Joined: 28 Jul 2013, 23:26
Posts: 372
thanks. I never thought of using ENB weather system to pass weather info to the fx files. Would require quite elaborate coding for smooth transitions though... well not yours, but when for instance influencing other effects like bloom, sharpening and/or color related weather transition could be challenging. But I guess for lens effects it could do quite nicely :)


Top
 Profile  
 
PostPosted: 03 Aug 2014, 00:41 
Offline
*master*
User avatar

Joined: 21 Feb 2013, 03:21
Posts: 226
Location: Los Angeles, CA
I did a simple test shader like this:

Code:
float4 PS_LensPostPass(VS_OUTPUT_POST In) : COLOR
{
   float4 res = 0.0;
   res = tex2D(SamplerColor, In.txcoord0.xy);
   res.rgb = min(res.rgb, 32768.0);
   res.rgb = max(res.rgb, 0.0);

   if (In.txcoord0.x < 0.5)
      return float4(1.0, 0.0, 0.0, 1.0);
   else
      return res;
}


The technique uses:
Code:
SrcBlend=SRCALPHA;
DestBlend=INVSRCALPHA;


If I turn off bloom and adapatation in the main settings, I get the left hand of the screen completely red. If bloom is on, then I see the bloom over the red. If adaptation is on then the red goes to white. Maybe enblens.fx is not the best place for your raindrops. You could pass the lens values down the pipeline by writing to a pixel and then reading the value in later shaders like effect.txt, but that is tedious.

Edit: On second thought, I don't think you can pass the values down like I suggested. Any value you write will be modified by the bloom and adaptation just like is currently happening. I have only done it between enbeffect.fx and effect.txt which are last in the pipline I think.

Can anyone confirm that this is the correct order?
enbeffectprepass.fx
enblens.fx
enbsunsprite.fx
enbbloom.fx
enbeffect.fx
effect.txt

Thanks

_________________
i7-4970K 4.8ghz, 16gb ram, Geforce Titan X 12gb vram, win7


Top
 Profile  
 
PostPosted: 03 Aug 2014, 02:50 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 471
Location: Taiwan
prod80, another major challenge would be preventing D-N-I values from weathers ini interpolating with each others, I'm not sure how sunrise, day, sunset, night are calculated to generate final result. I am thinking that discarding the original value in weahter.ini so that its only purpose is to pass weather info, then do DNI in the .fx with predefined sets of DNI values which will switch according to the weather.

I'm sure there exist more advance method then my naive approach.

number6, thanks for the testing and suggestions. Currently the drops is only simple fish eye lens on bloom texture with random size and positions.

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Top
 Profile  
 
PostPosted: 04 Aug 2014, 16:07 
Offline
*sensei*

Joined: 05 Apr 2014, 10:29
Posts: 471
Location: Taiwan
on second thought, the better way to do this would be using the original lens parameters to set weather ini ID, and just switch between weather parameters according to weather ID in the shader file. about weather ID, I mean the # in _weatherlist.ini

_________________
Intel Xeon L5639 6C12T @3.96GHz // Gigabyte ga-x58a-ud3r// MSI GTX680 4G// 24G RAM
Flickr
YouTube


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 57 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group