Problem with Interior seperation to HD6 keypres Color Tweaks

share shaders here
Post Reply
  • Author
  • Message
Offline
User avatar
*blah-blah-blah maniac*
Posts: 1938
Joined: 05 Mar 2012, 02:08

Problem with Interior seperation to HD6 keypres Color Tweaks

Hey there to anyone who reads this :P

I don't know if this is the right section to but this question/troubleshooting at. But it is related to a effect file so, half right maybe.

Anyway I've been trying to apply the new Interior seperation to all HD6 different effects/commands. And have done so with everything ecxept for the different blooms and the key press COLOR_TWEAKS and DARKER_NIGHTS.


I have no coding knowledge what so ever (if Oblivion sripting doesn't count :P which I hardly think ;) )

Here's my try at adding the interior seperation. Will include original coding and my altered one. So if you see anything that looks out of place or "what the f**k is that doing there" anywhere let me know. thank you in advance :)

My altered coding;

Code: Select all

//	keypress 1,2:	  night, day, interior		night, day, interior
	float4 uctbrt1 	= float4( 1.0, 1.0, 1.0,		1.0, 1.0, 1.0); 	// Brightness Night, Day, Interior (Alters before contrast adjustment)
	float4 uctbrt2	= float4( 1.0, 1.0, 1.0,		1.0, 1.0, 1.0 ); 	// Brightness Night, Day, Interior (Alters after contrast adjustment)
	float4 uctcon 	= float4( 1.0, 1.0, 1.0,		1.0, 1.0, 1.0 ); 	// Contrast Night, Day, Interior
	float4 uctsat	= float4( 1.0, 1.0, 1.0,		1.0, 1.0, 1.0 ); 	// Saturation Night, Day, Interior (Remember if using HD6_COLORSAT_DAYNIGHT that will also be desaturating the night)
	
	//		keypress 4: Saturation
	
	
	#ifdef HD6_DARKER_NIGHTS
		float4 darkenby1 = float4( 0.0, 0.0, 0.0,		0.0, 0.0, 0.0 );
	#endif




	// HD6 - Alter Brightness using keyboard during gameplay
		
		float4 tuctbrt1 = uctbrt1;
		float4 tuctbrt2 = uctbrt2;
		float4 tuctcon  = uctcon;
		float4 tuctsat  = uctsat;
		
		#ifdef HD6_DARKER_NIGHTS
			tuctbrt1 -= darkenby1;
		#endif
				
		float h1 = lerp(-1,1,tempF1.x); // Increases speed it changes by when pressing key		
		h1 = lerp( h1, 1, hnd ); // Removes affect during day	
		h1 = h1 - (h1 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
		float hbs = lerp( EBloomAmount/2, EBloomAmount, h1); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker
		
		float h2 = lerp(-1,1,tempF1.y); // Increases speed it changes by when pressing key
		h2 = lerp( 1, h2, hnd ); // Removes affect during night
		h2 = h2 - (h2 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
		hbs = lerp( (hbs/2)-1, hbs, h2); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker

		float h3 = lerp(-1,1,tempF1.z); // Increases speed it changes by when pressing key
		h3 = lerp( 1, h3, ji ); // Removes affect during interior
		h3 = h3 - (h3 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
		hbs = lerp( (hbs/2)-1, hbs, h3); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker


		hbs = max(0,hbs);
		hbs = min(2,hbs); // should be able to go above 1, but not 2
		
		vhnd = lerp(-2,hnd,h2);
		vhnd = max(0,vhnd); // do not go below 0;
		vhnd = min(1,vhnd); // not above 1, just incase people like surface of sun

		vji = lerp(-2,ji,h3);
		vji = max(0,vji); // do not go below 0;
		vji = min(1,vji); // not above 1, just incase people like surface of sun

		cdhnd=bchnd=vhnd;
		//cdhnd=0;
		//bchnd=0;
		//vhnd=0;

		cdji=bcji=vji;
		//cdji=0;
		//bcji=0;
		//vji=0;
		
		#ifdef HD6_COLOR_TWEAKS

			float2 uctbrt1t = 	float2( lerp( tuctbrt1.x, 	tuctbrt1.z, 	h1), lerp( 	tuctbrt1.y, 	tuctbrt1.w, 	h2), lerp( 	tuctbrt1.q, 	tuctbrt1.e,	h3 ), );
			float2 uctbrt2t = 	float2( lerp( tuctbrt2.x, 	tuctbrt2.z,	h1), lerp( 	tuctbrt2.y, 	tuctbrt2.w, 	h2), lerp( 	tuctbrt2.q, 	tuctbrt2.e,	h3 ), );			
			float2 uctcont  =	float2( lerp( tuctcon.x, 	tuctcon.z, 	h1), lerp( 	tuctcon.y, 	tuctcon.w, 	h2), lerp( 	tuctcon.q, 	tuctcon.e,	h3 ), );
			float2 uctsatt  =	float2( lerp( tuctsat.x, 	tuctsat.z, 	h1), lerp( 	tuctsat.y, 	tuctsat.w, 	h2), lerp( 	tuctsat.q, 	tuctsat.e,	h3 ), );

		#endif

Original coding;

Code: Select all

	// Darker Nights ( Night Keypress 1+Pageup/down, Night, Day )
	// Only uses these values if "#define HD6_DARKER_NIGHTS" does not have '//' infront
	
	//		keypress 1,2:	  night, day		night, day
	float4 uctbrt1 	= float4( 1.0, 1.0, 		1.0, 1.0 ); 	// Brightness Night, Day (Alters before contrast adjustment)
	float4 uctbrt2	= float4( 1.0, 1.0, 		1.0, 1.0 ); 	// Brightness Night, Day (Alters after contrast adjustment)
	float4 uctcon 	= float4( 1.0, 1.0, 		1.0, 1.0 ); 	// Contrast Night, Day, v11.2: 1.0, 0.97, 0.85
	float4 uctsat	= float4( 1.0, 1.0, 		1.0, 1.0 ); 	// Saturation Night, Day (Remember if using HD6_COLORSAT_DAYNIGHT that will also be desaturating the night)
	
	//		keypress 4: Saturation
	
	
	#ifdef HD6_DARKER_NIGHTS
		float4 darkenby1 = float4( 0.0, 0.0, 		0.0, 0.0 );
	#endif




// HD6 - You can play with the night/day value here, not that its advisable to :-D
	// Visualize this with 'debug triangle' further down
	float hnd = ENightDayFactor;
	//hnd-=0.4;
	//hnd = hnd - (0.5-hnd);
	//hnd = max(hnd,0);
	//hnd = min(hnd,1);
	//hnd=1;
	
	float2 hndtweak = float2( 1.0 , 1.0 );
	float vhnd = hnd; // effects vignette stregth;
	float bchnd = hnd; // effects hd6 bloom crisp
	float cdhnd = hnd; // effects hd6 colorsat daynight
	
	// Some caves are seen as daytime, so I set key 3 to force nightime
	// This doesnt work very well >_<
	hnd = tempF1.z < 1 ? 0 : hnd;
	hndtweak.x = tempF1.z < 1 ? hndtweak.y : hndtweak.x; // Dont ask, I have no idea why I need this lol
	
	
	// HD6 - Alter Brightness using keyboard during gameplay
		
		float4 tuctbrt1 = uctbrt1;
		float4 tuctbrt2 = uctbrt2;
		float4 tuctcon  = uctcon;
		float4 tuctsat  = uctsat;
		
		#ifdef HD6_DARKER_NIGHTS
			tuctbrt1 -= darkenby1;
		#endif
				
		float h1 = lerp(-1,1,tempF1.x); // Increases speed it changes by when pressing key		
		h1 = lerp( h1, 1, hnd ); // Removes affect during day		
		h1 = h1 - (h1 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
		//float hbs = EBloomAmount;
		float hbs = lerp( EBloomAmount/2, EBloomAmount, h1); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker
		
		float h2 = lerp(-1,1,tempF1.y); // Increases speed it changes by when pressing key
		h2 = lerp( 1, h2, hnd ); // Removes affect during night
		h2 = h2 - (h2 % 0.1); // Changes it so incriments are in steps, remove this if you want smooth changes when pressing keys
		hbs = lerp( (hbs/2)-1, hbs, h2); // Reduce bloom as it gets darker, otherwise it just gets hazier, higher number reduces bloom more as it gets darker
		hbs = max(0,hbs);
		hbs = min(2,hbs); // should be able to go above 1, but not 2
		
		vhnd = lerp(-2,hnd,h2);
		vhnd = max(0,vhnd); // do not go below 0;
		vhnd = min(1,vhnd); // not above 1, just incase people like surface of sun

		cdhnd=bchnd=vhnd;
		//cdhnd=0;
		//bchnd=0;
		//vhnd=0;
		
		#ifdef HD6_COLOR_TWEAKS

			float2 uctbrt1t = 	float2( lerp( tuctbrt1.x, 	tuctbrt1.z, h1), lerp( tuctbrt1.y, 	tuctbrt1.w, h2) );
			float2 uctbrt2t = 	float2( lerp( tuctbrt2.x, 	tuctbrt2.z,	h1), lerp( tuctbrt2.y, 	tuctbrt2.w, h2) );			
			float2 uctcont  =	float2( lerp( tuctcon.x, 	tuctcon.z, 	h1), lerp( tuctcon.y, 	tuctcon.w, h2) );
			float2 uctsatt  =	float2( lerp( tuctsat.x, 	tuctsat.z, 	h1), lerp( tuctsat.y, 	tuctsat.w, h2) );
		#endif

Offline
User avatar
Posts: 79
Joined: 30 May 2012, 03:58
Location: Denver Colorado

Re: Problem with Interior seperation to HD6 keypres Color Tw

I would try posting this in the sections marked "other" or "Bugs"

Offline
User avatar
Posts: 25
Joined: 07 Aug 2012, 19:20

Re: Problem with Interior seperation to HD6 keypres Color Tw

Do you still need a solution for this? :)
Personally, first thing what I did - got rid of that keypress. I don't even know how it works. So, if it doesn't matter for you, here is a my color tweak part:
First part -

Code: Select all

//					 	 interior / night / day
float3 uctbrt1 		 = float3( 1.00, 1.00, 1.00 ); 		// Brightness	
float3 uctbrt2	 	 = float3( 1.00, 1.00, 1.00 ); 		// Brightness	
float3 uctcon 		  = float3( 1.00, 1.00, 1.00 ); 		// Contrast		
float3 uctsat		   = float3( 1.00, 1.00, 1.00 ); 		// Saturation	

#ifdef HD6_DARKER_NIGHTS
	float3 darkenby1 = float3( 0.0, 0.0, 0.0 );
#endif
Delete this two parts -

Code: Select all

	// HD6 - Alter Brightness using keyboard during gameplay
		
		float4 tuctbrt1 = uctbrt1;
		float4 tuctbrt2 = uctbrt2;
		float4 tuctcon  = uctcon;
		float4 tuctsat  = uctsat;

Code: Select all

		#ifdef HD6_COLOR_TWEAKS
			//float2 uctbrt1t = 	float2( lerp( tuctbrt1.x, 	tuctbrt1.y, h1), tuctbrt1.z );
			//float2 uctbrt2t = 	float2( lerp( tuctbrt2.x, 	tuctbrt2.y,	h1), tuctbrt2.y );			
			//float2 uctcont  =	float2( lerp( tuctcon.x, 	tuctcon.y, 	h1), tuctcon.z );
			//float2 uctsatt  =	float2( lerp( tuctsat.x, 	tuctsat.y, 	h1), tuctsat.z );
			float2 uctbrt1t = 	float2( lerp( tuctbrt1.x, 	tuctbrt1.z, h1), lerp( tuctbrt1.y, 	tuctbrt1.w, h2) );
			float2 uctbrt2t = 	float2( lerp( tuctbrt2.x, 	tuctbrt2.z,	h1), lerp( tuctbrt2.y, 	tuctbrt2.w, h2) );			
			float2 uctcont  =	float2( lerp( tuctcon.x, 	tuctcon.z, 	h1), lerp( tuctcon.y, 	tuctcon.w, h2) );
			float2 uctsatt  =	float2( lerp( tuctsat.x, 	tuctsat.z, 	h1), lerp( tuctsat.y, 	tuctsat.w, h2) );
		#endif
This part must be replaced -

Code: Select all

	#ifdef HD6_COLOR_TWEAKS
		float ctbrt1 = lerp(uctbrt1.x, (lerp(uctbrt1.y, uctbrt1.z, ENightDayFactor)), EInteriorFactor);
		float ctbrt2 = lerp(uctbrt2.x, (lerp(uctbrt2.y, uctbrt2.z, ENightDayFactor)), EInteriorFactor);
		float ctcon =  lerp(uctcon.x, (lerp(uctcon.y, uctcon.z, ENightDayFactor)), EInteriorFactor);
		float ctsat = lerp(uctsat.x, (lerp(uctsat.y, uctsat.z, ENightDayFactor)), EInteriorFactor);
		
		float3 ctLumCoeff = float3(0.2125, 0.7154, 0.0721);				
		float3 ctAvgLumin = float3(0.5, 0.5, 0.5);
		float3 ctbrtColor = color.rgb * ctbrt1;

		float3 ctintensity = dot(ctbrtColor, ctLumCoeff);
		float3 ctsatColor = lerp(ctintensity, ctbrtColor, ctsat); 
		float3 cconColor = lerp(ctAvgLumin, ctsatColor, ctcon);
		
		color.xyz = cconColor * ctbrt2;
		// --JawZ-- added Interior seperation
		float3 cbalance = lerp(rgbi, ( lerp (rgbn,rgbd, hnd) ), ji);
		color.xyz=cbalance.xyz * color.xyz;
	#endif
I am sorry, I don't know English good and can't explain how to fix your code. And of course I have no coding knowledge either :lol:

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

Re: Problem with Interior seperation to HD6 keypres Color Tw

@CaptainSkullsaber;

As I stated in my initial post, didn't know if this was the right place for this. So if Boris want's to move this to the right place I won't mind at all. or if he wants me to delete or whatever.


@Tonaran;

It wasn't for me. I never use the keypress function either. Don't see the point in it. But some people I've spoken with or seen comments about, do use it so I thought I would try to implement it.

Any new coding of any kind is always appreciated :) And thanks again for showing the interior seperation coding :)

Ok then I know what to replace atleast :) Thanks for the input ;)

It's fine, no english wiz here either :P
Post Reply