Jump to content

Enb with 3 LUTs for exterior, interior and night


idle

Recommended Posts

There are codes for your enbeffect.txt, which allows the use of 3 individual LUTs (enbpalettes, a table of colors enb used as replacement), as described in the title:

 

http://enbseries.enbdev.com/forum/viewtopic.php?f=7&t=4394&start=20    (page 3)

 

http://skyrimshot.blog.fc2.com/blog-entry-78.html   (japanese, use some translator)

 

Both are the same thing, written a bit differently.

Now I've followed the descriptions as closely as I could (hope the translator didn't mess anything up), but the color correction wouldn't work with either of both codes. I think it pretty much broke and I was seeing vanilla skyrim colors.

 

I know this is probably not the best place to ask for enb questions, but has anyone gotten it to work so far?

Link to comment
  • 2 weeks later...
  • 11 months later...

==============================

--Edited to correct math error in DNI LUT code--

 

Code for enbeffect.fx is best viewed in Notepad++

with language set to C++

==============================

 

 

Here you go. This works for Skyrim LE, Fallout 3, Fallout: New Vegas, and I think Oblivion (not tested this yet). It won't work on Skyrim SE or Fallout 4 (different DX-type is used).

 

This goes into the textures section of your enbeffect.fx file. Just copy this and paste it in. Notice the naming convention (ResourceName). This is important so don't overlook it.

 

texture2D texs5 < string ResourceName="enbpalette__.tga"; >;    //	 ENB interior palette (Added.)
texture2D texs6 < string ResourceName="enbpalette_.tga"; >;     //	 ENB night palette (Added.)
texture2D texs7;                                                //	 ENB day palette (Default palette texture slot.)
/*
PALETTE-TYPE
	"texture2D texs7;" is the "slot" used by the default palette/CLuT texture, which can be a .BMP, .PNG, or .TGA file type.
	The palette should be uncompressed and of a 24-bit depth, with or without an alpha channel.

	NOTE: .BMP files have supported alpha channels since Windows 95.

	"texture2D texs5;" and "texture2D texs6;" were added for use with my triple-palette code. Unlike "texture2D texs7;"
	the file-type for these two "slots" have to be specified.

	Accordingly, all of "slots" can use any of the three supported file types for ENB palettes, or any combination thereof.
*/

You'll notice I'm using .tga files. But you can also use .bmp or .png files, too. It's all in the PALETTE-TYPE note.

 

Next, you need the samplers, which are immediately below the textures. Paste these in where required:

 

sampler2D _s5 = sampler_state {
  Texture = <texs5>;
  MinFilter = LINEAR;
  MagFilter = LINEAR;
  MipFilter = NONE;
  AddressU = Clamp;
  AddressV = Clamp;
  SRGBTexture = FALSE;
  MaxMipLevel = 0;
  MipMapLodBias = 0;
};

sampler2D _s6 = sampler_state {
  Texture = <texs6>;
  MinFilter = LINEAR;
  MagFilter = LINEAR;
  MipFilter = NONE;
  AddressU = Clamp;
  AddressV = Clamp;
  SRGBTexture = FALSE;
  MaxMipLevel = 0;
  MipMapLodBias = 0;
};

Finally, scroll down to your E_CC_PALETTE section. If you want to use triple palettes (256x256), then replace the default palette code with this:

 

#ifdef E_CC_PALETTE
	float3 paletted;
	float3 paletten;
	float3 palettei;

	color.rgb					=	saturate( color.rgb );

	float3 brightness			=	Adaptation.xyz;

	brightness					=	( brightness / ( brightness+1.0 ) );
	brightness					=	max(brightness.x, max( brightness.y, brightness.z ) );

	float4 uvsrc				=	0.0;

	uvsrc.y						=	brightness.r; 
	uvsrc.x						=	color.r;
    
	palettei.r					=	tex2Dlod( _s5, uvsrc ).r;
	paletten.r					=	tex2Dlod( _s6, uvsrc ).r;
	paletted.r					=	tex2Dlod( _s7, uvsrc ).r;

	uvsrc.y						=	brightness.g;
	uvsrc.x						=	color.g;
 
	palettei.g					=	tex2Dlod( _s5, uvsrc ).g;
	paletten.g					=	tex2Dlod( _s6, uvsrc ).g;
	paletted.g					=	tex2Dlod( _s7, uvsrc ).g;

	uvsrc.y						=	brightness.b;
	uvsrc.x						=	color.b;

	palettei.b					= 	tex2Dlod( _s5, uvsrc ).b;
	paletten.b					=	tex2Dlod( _s6, uvsrc ).b;
	paletted.b					=	tex2Dlod( _s7, uvsrc ).b;

	color.rgb					=	lerp( lerp( paletten, paletted, ENightDayFactor ), palettei, EInteriorFactor );
#endif	// E_CC_PALETTE

With the above, you can add adjusters to the red, green, and blue channels if you want. You can also add palette mixer control, too.

 

And if you want to use triple CLuTs (LUTs), then replace the E_CC_PALETTE section with the below, instead.

 

#ifdef E_CC_PALETTE
	float3 CLuTD1;		// CLuT for Days
	float3 CLuTD2;

	float3 CLuTN1;		// CLuT for Nights
	float3 CLuTN2;

	float3 CLuTI1;		// CLuT for Interiors
	float3 CLuTI2;

	float3 CLuTA1;		// CLuT Averages
	float3 CLuTA2;

/*
	CLuT size in pixels. Default is 256 x 16 (1 pixel per 0.00390625 inches x 1 pixel per 0.0625 inches).
	A good alternative size is 4096 x 64 (0.000244141, 0.015625). A larger CLuT will affect scene manipulation
	carried out in an external program such as Raw Therapee or Adobe Lightroom. A large CLuT that is tuned
	with an image in such software will preserve the changes more accurately, thus making it easier to preserve
	changes to the scene details and colors.
*/
	
	float2 CLuT_pSize =	float2(0.00390625, 0.0625);		//(0.000244141, 0.015625);
	
	color.rgb			=	saturate(color.rgb);
	color.b				*=	15;

	float4 CLuT_UV 		=	0;

	CLuT_UV.w			=	floor(color.b);
	CLuT_UV.xy			=	color.rg * 15 * CLuT_pSize + 0.5 * CLuT_pSize ;
	CLuT_UV.x			+=	CLuT_UV.w * CLuT_pSize.y;

	CLuTD1.rgb			=	tex2Dlod(_s7, CLuT_UV.xyzz).rgb;
	CLuTD2.rgb			=	tex2Dlod(_s7, CLuT_UV.xyzz + float4(CLuT_pSize.y, 0, 0, 0)).rgb;

	CLuTN1.rgb			=	tex2Dlod(_s6, CLuT_UV.xyzz).rgb;
	CLuTN2.rgb			=	tex2Dlod(_s6, CLuT_UV.xyzz + float4(CLuT_pSize.y, 0, 0, 0)).rgb;

	CLuTI1.rgb			=	tex2Dlod(_s5, CLuT_UV.xyzz).rgb;
	CLuTI2.rgb			=	tex2Dlod(_s5, CLuT_UV.xyzz + float4(CLuT_pSize.y, 0, 0, 0)).rgb;

	CLuTA1.rgb			=	lerp( lerp(CLuTN1.rgb, CLuTD1.rgb, ENightDayFactor), CLuTI1.rgb, EInteriorFactor);
	CLuTA2.rgb			=	lerp( lerp(CLuTN2.rgb, CLuTD2.rgb, ENightDayFactor), CLuTI2.rgb, EInteriorFactor);

	color.rgb			=	lerp(CLuTA1.rgb, CLuTA2.rgb, color.b - CLuT_UV.w);
#endif	// E_CC_PALETTE

That's about it. You can grab a CLuT (or LUT) over at ENB forum. Link is here.

 

Link to comment
  • 6 months later...
On 2/19/2018 at 6:12 PM, Visitant_G said:

==============================

--Edited to correct math error in DNI LUT code--

 

Code for enbeffect.fx is best viewed in Notepad++

with language set to C++

==============================

 

 

Here you go. This works for Skyrim LE, Fallout 3, Fallout: New Vegas, and I think Oblivion (not tested this yet). It won't work on Skyrim SE or Fallout 4 (different DX-type is used).

 

This goes into the textures section of your enbeffect.fx file. Just copy this and paste it in. Notice the naming convention (ResourceName). This is important so don't overlook it.

*snip*

On 2/19/2018 at 6:12 PM, Visitant_G said:

 

That's about it. You can grab a CLuT (or LUT) over at ENB forum. Link is here.

 

 

You're so amazing, thank you so much! I have a question (apologies for bumping this thread, but people probably want to know the above information anyways, and this was the only thread I could find of this topic - that was replied to, anyways), if you can answer it. If not, no worries!

 

I'm working on an ENB that is perfect for taking character screenshots, and basically makes the characters look 'next-gen', but isn't so freaking dark like a lot I find on Nexus. I'm almost there. I discovered LUTs and am able to edit screenshots in Photoshop using adjustment layers, which is fantastic. My issue is the LUT selection is not showing up in game. It shows up for SnapDragon, since the code is already there... But I can't make it work on my own ENB. This is driving me insane. I've even downloaded other ENBs that incorporate LUTs, but those aren't showing up either. I reinstalled my ENB but it did nothing. Literally just Snapdragon is able to use them. I did have a good modification of Snapdragon, but what I have now is much, much more realistic and hides a lot of the jagged edges on faces.

 

Any ideas on how to fix this? Is there a special code I need on top of the above? I've been working with ENBs a little while, but it's mostly self taught; meaning, I literally just read it and make adjustments that make sense. I'm no pro. But I'm smart, so any suggestions you have, please fill me in (again, if you're able or have the time).

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use