How to create ENB for Skyrim

Post Reply
  • Author
  • Message
Offline
Posts: 5
Joined: 15 Jul 2015, 11:37

How to create ENB for Skyrim

Title says it all.Where do I beggin from ?

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17582
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: How to create ENB

If you prefer to make it from scratch, then use default files included in to the mod, almost all parameters are set to not modify colors (lighting) at all. If you planning to use depth of field effect, download any enbeffectprepass.fx from Nexus web site and use it (Matso, IndigoNeko did some good shaders). If you want to go the hard way with setting huge hdr values and with edited in Creation Kit weather, then mine default enbeffect.fx post processing and tonemapping shader is okay. Otherwise get that shader from another preset on Nexus site. Ignore shaders of sun sprite, it's extra not really important at the beginning. Default bloom shader enbbloom.fx is fine, use it.
Presets consist of at least two files: enblocal.ini - per user parameters which i don't recommend to share in preset, it's mostly hardware dependent thing; enbseries.ini - contains parameters and effects togglers, this is the core of preset. There is another thing called weather system and it's actually multiple copies of most parameters of enbseries.ini parameters placed in "enbseries" folder in different files and weather system switch between various files based on game WeatherID. I do not recommend to touch weather system, it's complexity is too high for new users and you can always copy preset to every weather if satisfied with result. The important thing in every preset is to set in game (by console command) certain weather, otherwise preset will look wrong. Why? Most game weathers have strange colors, like green ambient color instead of blue, so shadows are green, brightness also varies a lot. Some modders did custom weathers for presets which looks much more realistic, you may try them (search on Nexus). I don't remember which game weather looks good, more or less, may be "fw 10a232".

There are several important decisions need to be made before start changing parameters.
First of all, do you want to work in linear color space as it happens in real life, it's harder to tweak though. Parameter for that is ColorPow under [ENVIRONMENT] category of enbseries.ini (use editor to modify it). When it's value set to 1.0, then color textures are not modified before applying any color operations, it's incorrect and gives wrong colors at some conditions, but simpler to control. Value 2.2 is proper for high quality preset and it means that texture is converted from 2.2 gamma to linear space as in reality. You may use anything in between, some users prefer 1.6-1.7. When value is above 1.0 all colors looks darker and more contrast, especially skin, but proper tweaking of tonemapping is one of solutions, realistic and hard way. Another one is write in enbeffect.fx shader function which restore gamma 2.2 before any computations, just after texture reading (image of scene and bloom both require this , better to apply gamma after mixing bloom and scene). The math for gamma restoration is color.rgb=pow(color.rgb, 1.0/2.2) in case if you set ColorPow=2.2 in enbseries.ini, otherwise (tonemapping only scenario) everything included in my default enbeffect.fx shader.
Second, the ranges of intensities which you will work with. This means that after some brightness everything will be oversaturated/overexposed and below the limit invisible as black. Adaptation parameters control this from enbseries.ini and some of them are in enbeffect.fx at the beginning of the file. Adaptation is the reverse function of screen brightness (not average brightness, but almost), so if you see the sun on the screen, adaptation automatically reduce brightness and sun do not blind your screen at cost of darker other surfaces. At night it let you see enough. Imagine if wrong adaptation is set and it increase brightness at nigh so much that it looks like day, who will like such cheating preset? So, tweak adaptation at first. The best way to do that is to use sun as brightest spot of screen, look at the sky and set value of sun brightness in enbseries.ini to some maximal desired value to make it much brighter than white and nearest clouds must be partially overexposed, this is how human eye normally see things. Modify adaptation accordingly in enbseries.ini and enbeffect.fx. You may ignore adaptation (to use default parameters), then just tweak sun properties. For low limit of minimal adaptation switch to night and set desired minimal ambient color ([ENVIRONMENT] category of enbseries.ini) multiplier and adaptation parameters to stop automatic brightness increase. Do same tests again at day and night by looking on to different objects, for example under shadow of big building, may be it's too bright. This all can be compensated by parameters, but better to have stable predictable results from adaptation instead of tweaking hundred parameters.

Tweaking parameters can be done intuitively, by knowledge and by measuring values from hdr shots. First and last cases are for you i guess. Hdr images are freely available in i-net (.hdr files), you may open them with HDRShop software (set there gamma =1.0 to see linear space), but this way means lot of pain because game weather must be modified accordingly (edit about 80 weathers in CK is time consuming task). So, changing values intuitively. Better to start from modifying sky, because if sky looks properly, you may enable image based lighting (IBL) effect to apply more realistic look to objects. Sky is simple thing, all, you need to care about is time of the day, because clouds at certain moment and angles starts to looks darker than sky gradient. Sky also affect bloom a lot, because sky and sun are brightest light sources. Btw, do not set too high bloom, 0.05-0.1 is more or less okay. Lens fx better to disable at all by setting their amount to 0. Next thing is ambient color. Ambient is simplified form of light from sky, but in games it's flat (skyrim use top to bottom angle dependency, better than flat, but still not perfect). When sky is clear, ambient must be average blue color of sky hemisphere and bottom ambient color is yellow (kinda reflected light of sun). For the sky fully covered by clouds ambient color is gray. When using skylighting effect, ambient color is darkened in some places, may be you prefer to use this effect as basis for your preset. Most players don't like ambient, because they think it's color of shadows and want darker shadows. This is wrong opinion, darker shadows better to simulate via tonemapping code changes and higher direct lighting. Direct lighting is amount of sun light on objects, set it to anything you like (unless using real world values). For interior it's some invalid type of lights (buggy game), so better do not increase interior direct light too much. That's all about color manipulations, everything else is not important to describe here.
Performance optimizations described in docs, reflections and ambient occlusion and indirect lighting ([ssao_ssil] category) are the most heavy performance killers.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 5
Joined: 15 Jul 2015, 11:37

Re: How to create ENB

ENBSeries wrote:If you prefer to make it from scratch, then use default files included in to the mod, almost all parameters are set to not modify colors (lighting) at all. If you planning to use depth of field effect, download any enbeffectprepass.fx from Nexus web site and use it (Matso, IndigoNeko did some good shaders). If you want to go the hard way with setting huge hdr values and with edited in Creation Kit weather, then mine default enbeffect.fx post processing and tonemapping shader is okay. Otherwise get that shader from another preset on Nexus site. Ignore shaders of sun sprite, it's extra not really important at the beginning. Default bloom shader enbbloom.fx is fine, use it.
Presets consist of at least two files: enblocal.ini - per user parameters which i don't recommend to share in preset, it's mostly hardware dependent thing; enbseries.ini - contains parameters and effects togglers, this is the core of preset. There is another thing called weather system and it's actually multiple copies of most parameters of enbseries.ini parameters placed in "enbseries" folder in different files and weather system switch between various files based on game WeatherID. I do not recommend to touch weather system, it's complexity is too high for new users and you can always copy preset to every weather if satisfied with result. The important thing in every preset is to set in game (by console command) certain weather, otherwise preset will look wrong. Why? Most game weathers have strange colors, like green ambient color instead of blue, so shadows are green, brightness also varies a lot. Some modders did custom weathers for presets which looks much more realistic, you may try them (search on Nexus). I don't remember which game weather looks good, more or less, may be "fw 10a232".

There are several important decisions need to be made before start changing parameters.
First of all, do you want to work in linear color space as it happens in real life, it's harder to tweak though. Parameter for that is ColorPow under [ENVIRONMENT] category of enbseries.ini (use editor to modify it). When it's value set to 1.0, then color textures are not modified before applying any color operations, it's incorrect and gives wrong colors at some conditions, but simpler to control. Value 2.2 is proper for high quality preset and it means that texture is converted from 2.2 gamma to linear space as in reality. You may use anything in between, some users prefer 1.6-1.7. When value is above 1.0 all colors looks darker and more contrast, especially skin, but proper tweaking of tonemapping is one of solutions, realistic and hard way. Another one is write in enbeffect.fx shader function which restore gamma 2.2 before any computations, just after texture reading (image of scene and bloom both require this , better to apply gamma after mixing bloom and scene). The math for gamma restoration is color.rgb=pow(color.rgb, 1.0/2.2) in case if you set ColorPow=2.2 in enbseries.ini, otherwise (tonemapping only scenario) everything included in my default enbeffect.fx shader.
Second, the ranges of intensities which you will work with. This means that after some brightness everything will be oversaturated/overexposed and below the limit invisible as black. Adaptation parameters control this from enbseries.ini and some of them are in enbeffect.fx at the beginning of the file. Adaptation is the reverse function of screen brightness (not average brightness, but almost), so if you see the sun on the screen, adaptation automatically reduce brightness and sun do not blind your screen at cost of darker other surfaces. At night it let you see enough. Imagine if wrong adaptation is set and it increase brightness at nigh so much that it looks like day, who will like such cheating preset? So, tweak adaptation at first. The best way to do that is to use sun as brightest spot of screen, look at the sky and set value of sun brightness in enbseries.ini to some maximal desired value to make it much brighter than white and nearest clouds must be partially overexposed, this is how human eye normally see things. Modify adaptation accordingly in enbseries.ini and enbeffect.fx. You may ignore adaptation (to use default parameters), then just tweak sun properties. For low limit of minimal adaptation switch to night and set desired minimal ambient color ([ENVIRONMENT] category of enbseries.ini) multiplier and adaptation parameters to stop automatic brightness increase. Do same tests again at day and night by looking on to different objects, for example under shadow of big building, may be it's too bright. This all can be compensated by parameters, but better to have stable predictable results from adaptation instead of tweaking hundred parameters.

Tweaking parameters can be done intuitively, by knowledge and by measuring values from hdr shots. First and last cases are for you i guess. Hdr images are freely available in i-net (.hdr files), you may open them with HDRShop software (set there gamma =1.0 to see linear space), but this way means lot of pain because game weather must be modified accordingly (edit about 80 weathers in CK is time consuming task). So, changing values intuitively. Better to start from modifying sky, because if sky looks properly, you may enable image based lighting (IBL) effect to apply more realistic look to objects. Sky is simple thing, all, you need to care about is time of the day, because clouds at certain moment and angles starts to looks darker than sky gradient. Sky also affect bloom a lot, because sky and sun are brightest light sources. Btw, do not set too high bloom, 0.05-0.1 is more or less okay. Lens fx better to disable at all by setting their amount to 0. Next thing is ambient color. Ambient is simplified form of light from sky, but in games it's flat (skyrim use top to bottom angle dependency, better than flat, but still not perfect). When sky is clear, ambient must be average blue color of sky hemisphere and bottom ambient color is yellow (kinda reflected light of sun). For the sky fully covered by clouds ambient color is gray. When using skylighting effect, ambient color is darkened in some places, may be you prefer to use this effect as basis for your preset. Most players don't like ambient, because they think it's color of shadows and want darker shadows. This is wrong opinion, darker shadows better to simulate via tonemapping code changes and higher direct lighting. Direct lighting is amount of sun light on objects, set it to anything you like (unless using real world values). For interior it's some invalid type of lights (buggy game), so better do not increase interior direct light too much. That's all about color manipulations, everything else is not important to describe here.
Performance optimizations described in docs, reflections and ambient occlusion and indirect lighting ([ssao_ssil] category) are the most heavy performance killers.
Thanks mate,you are king !!!!!!!!
BTW,how can I make my own effects ? And,just to be safe,when I make my own ENB preset,I should download your preset first,then modify it and add other effects ?

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17582
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: How to create ENB for Skyrim

Yes, you need to use my default files and edit them as your own preset, this is simpler and nobody will say that you have stealed his/her work.
To create own shader files you need to learn a bit HLSL and to install NVidia FXComposer version pre 2.0 to check if shaders where compiled successfully. Their editing can be done there or in any text editor with syntax highlighting. Shaders themselves are code of programming language, don't expect that replacing one shader by another will work, it's common mistake of users. Any code changes must be done carefully with understanding what you doing, like any other programming.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

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

Re: How to create ENB for Skyrim

Hi Boris,

Just want to write to thank you for taking the time to write out this 'beginner's guide' to setting up a new ENB preset. I know you hate writing documentation and explaining things ... and so I thank you for this summary :)
_________________
Fallout 4 ENB Video Series | Skyrim ENB Video Series | My YouTube Channel
Intel i7-4700HQ @ 2.4GHz | NVidia GTX780M 4GB | 24GB RAM

Offline
Posts: 5
Joined: 15 Jul 2015, 11:37

Re: How to create ENB for Skyrim

tapioks wrote:Hi Boris,

Just want to write to thank you for taking the time to write out this 'beginner's guide' to setting up a new ENB preset. I know you hate writing documentation and explaining things ... and so I thank you for this summary :)
Yep mate.He's done us a great service :D
Post Reply