JanWillem32

Registered Person


Be a part of Date: Oct 2010

Location: The Netherlands

Posts: 1,083

Code:

// (C) 2014 Jan-Willem Krans (janwillem32 <at> hotmail.com)
// This file is a part of Video pixel shader pack.
// This program is free software program; you may redistribute it and/or modify it underneath the phrases of the GNU Basic Public License as revealed by the Free Software program Basis, model 2.
// This program is distributed within the hope that will probably be helpful, however WITHOUT ANY WARRANTY; with out even the implied guarantee of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Basic Public License for extra particulars.
// It's best to have acquired a duplicate of the GNU Basic Public License together with this program; if not, write to the Free Software program Basis, Inc., 51 Franklin Avenue, Fifth Flooring, Boston, MA 02110-1301 USA.

// prototype side-by-side to red-cyan anaglyph 3D stereoscopic view with compensated Lanczos2 resizing
// This shader must be run as a display house pixel shader.
// This shader requires compiling with ps_2_0, however larger is healthier, see http://en.wikipedia.org/wiki/Pixel_shader to search for what PS model your video card helps.
// For this shader to work appropriately, the video width in pixels on display must be an excellent quantity.

sampler s0;
float2 c0;
float2 c1;
float4 c2;
static const float PI = acos(-1.);
static const float4 wset = float4(1.25, .25, .75, 1.75)*PI;
static const float4 wsets = wset*.5;
static const float4 wp = sin(wset)*sin(wsets)/(wset*wsets);
static const float2 wc = (1.-dot(1., wp))*float2(.75, .25);// compensate truncated window issue by bilinear factoring on the 2 nearest samples
static const float4 w = wp+float4(0., wc, 0.);

float4 essential(float2 tex : TEXCOORD0) : COLOR
{
	if(any(float4(tex, -tex) < float4(c2.xy, -c2.zw))) return tex2D(s0, tex);// discard if exterior video rect
	else {
		float ox = (tex.x-c2.x)*c0.x-.5;// video-relative x place

		// detect half of the even or odd coordinates
		ox = ox*.5+.25;// the 2 photos are half-width, compensate for that
		float n = frac(ox);
		float dx = (n > .5)? -c1.x : c1.x;// even y constructive, odd y destructive
		float pixeloffset = n-ox;// spherical half-pixel offsets down

		// modify the x coordinate of the supply place to the proper facet of the video picture utilizing the pixel offset we simply calculated
		tex.x += pixeloffset*c1.x;
		float heart = .5*(c2.z-c2.x);
		float texr = tex.x+center-c1.x;// modify the pixel offset to the video body on the best facet of the video information

		// resolve place information and restrict the outer samples to the lively video rectangle
		float2 outeroffsets = float2(-dx, dx+dx);
		float4 outerpositions = float2(tex.x, texr).xxyy+outeroffsets.xyxy;
		float4 limits = float3(c2.xz, heart).xzzy+(c1.xx*float2(.5, -.5)).xyxy;
		float4 clampedouterpositions = clamp(outerpositions, limits.xxzz, limits.yyww);

		// pattern from the left and proper photos and solely pass-trough the purple channel for the left, and the inexperienced and blue channels for the best view
		float3 Q0 = float3(tex2D(s0, float2(clampedouterpositions.x, tex.y)).r, tex2D(s0, float2(clampedouterpositions.z, tex.y)).gb);
		float3 Q1 = float3(tex2D(s0, tex).r, tex2D(s0, float2(texr, tex.y)).gb);
		float3 Q2 = float3(tex2D(s0, float2(tex.x+dx, tex.y)).r, tex2D(s0, float2(texr+dx, tex.y)).gb);
		float3 Q3 = float3(tex2D(s0, float2(clampedouterpositions.y, tex.y)).r, tex2D(s0, float2(clampedouterpositions.w, tex.y)).gb);
		return (w.x*Q0+w.y*Q1+w.z*Q2+w.w*Q3).rgbb;}// interpolate and output
}

Code:

// (C) 2014 Jan-Willem Krans (janwillem32 <at> hotmail.com)
// This file is a part of Video pixel shader pack.
// This program is free software program; you may redistribute it and/or modify it underneath the phrases of the GNU Basic Public License as revealed by the Free Software program Basis, model 2.
// This program is distributed within the hope that will probably be helpful, however WITHOUT ANY WARRANTY; with out even the implied guarantee of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Basic Public License for extra particulars.
// It's best to have acquired a duplicate of the GNU Basic Public License together with this program; if not, write to the Free Software program Basis, Inc., 51 Franklin Avenue, Fifth Flooring, Boston, MA 02110-1301 USA.

// prototype top-and-bottom to red-cyan anaglyph 3D stereoscopic view with compensated Lanczos2 resizing
// This shader must be run as a display house pixel shader.
// This shader requires compiling with ps_2_0, however larger is healthier, see http://en.wikipedia.org/wiki/Pixel_shader to search for what PS model your video card helps.
// For this shader to work appropriately, the video top in pixels on display must be an excellent quantity.

sampler s0;
float2 c0;
float2 c1;
float4 c2;
static const float PI = acos(-1.);
static const float4 wset = float4(1.25, .25, .75, 1.75)*PI;
static const float4 wsets = wset*.5;
static const float4 wp = sin(wset)*sin(wsets)/(wset*wsets);
static const float2 wc = (1.-dot(1., wp))*float2(.75, .25);// compensate truncated window issue by bilinear factoring on the 2 nearest samples
static const float4 w = wp+float4(0., wc, 0.);

float4 essential(float2 tex : TEXCOORD0) : COLOR
{
	if(any(float4(tex, -tex) < float4(c2.xy, -c2.zw))) return tex2D(s0, tex);// discard if exterior video rect
	else {
		float oy = (tex.y-c2.y)*c0.y-.5;// video-relative y place

		// detect half of the even or odd coordinates
		oy = oy*.5+.25;// the 2 photos are half-width, compensate for that
		float n = frac(oy);
		float dy = (n > .5)? -c1.y : c1.y;// even y constructive, odd y destructive
		float pixeloffset = n-oy;// spherical half-pixel offsets down

		// modify the y coordinate of the supply place to the proper facet of the video picture utilizing the pixel offset we simply calculated
		tex.y += pixeloffset*c1.y;
		float heart = .5*(c2.w-c2.y);
		float texr = tex.y+center-c1.y;// modify the pixel offset to the video body on the underside facet of the video information

		// resolve place information and restrict the outer samples to the lively video rectangle
		float2 outeroffsets = float2(-dy, dy+dy);
		float4 outerpositions = float2(tex.y, texr).xxyy+outeroffsets.xyxy;
		float4 limits = float3(c2.yw, heart).xzzy+(c1.yy*float2(.5, -.5)).xyxy;
		float4 clampedouterpositions = clamp(outerpositions, limits.xxzz, limits.yyww);

		// pattern from the left and proper photos and solely pass-trough the purple channel for the left, and the inexperienced and blue channels for the best view
		float3 Q0 = float3(tex2D(s0, float2(tex.x, clampedouterpositions.x)).r, tex2D(s0, float2(tex.x, clampedouterpositions.z)).gb);
		float3 Q1 = float3(tex2D(s0, tex).r, tex2D(s0, float2(tex.x, texr)).gb);
		float3 Q2 = float3(tex2D(s0, float2(tex.x, tex.y+dy)).r, tex2D(s0, float2(tex.x, texr+dy)).gb);
		float3 Q3 = float3(tex2D(s0, float2(tex.x, clampedouterpositions.y)).r, tex2D(s0, float2(tex.x, clampedouterpositions.w)).gb);
		return (w.x*Q0+w.y*Q1+w.z*Q2+w.w*Q3).rgbb;}// interpolate and output
}

Code:

// (C) 2014 Jan-Willem Krans (janwillem32 <at> hotmail.com)
// This file is a part of Video pixel shader pack.
// This program is free software program; you may redistribute it and/or modify it underneath the phrases of the GNU Basic Public License as revealed by the Free Software program Basis, model 2.
// This program is distributed within the hope that will probably be helpful, however WITHOUT ANY WARRANTY; with out even the implied guarantee of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Basic Public License for extra particulars.
// It's best to have acquired a duplicate of the GNU Basic Public License together with this program; if not, write to the Free Software program Basis, Inc., 51 Franklin Avenue, Fifth Flooring, Boston, MA 02110-1301 USA.

// prototype fundamental fullscreen side-by-side to red-cyan anaglyph 3D stereoscopic view with compensated Lanczos2 resizing
// This shader must be run as a display house pixel shader.
// This shader requires compiling with ps_2_0, however larger is healthier, see http://en.wikipedia.org/wiki/Pixel_shader to search for what PS model your video card helps.
// For this shader to work appropriately, the video width in pixels on display must be an excellent quantity.

sampler s0;
float2 c0;
float2 c1;
static const float PI = acos(-1.);
static const float4 wset = float4(1.25, .25, .75, 1.75)*PI;
static const float4 wsets = wset*.5;
static const float4 wp = sin(wset)*sin(wsets)/(wset*wsets);
static const float2 wc = (1.-dot(1., wp))*float2(.75, .25);// compensate truncated window issue by bilinear factoring on the 2 nearest samples
static const float4 w = wp+float4(0., wc, 0.);

float4 essential(float2 tex : TEXCOORD0) : COLOR
{
	float ox = tex.x*c0.x-.5;// video-relative x place

	// detect half of the even or odd coordinates
	ox = ox*.5+.25;// the 2 photos are half-width, compensate for that
	float n = frac(ox);
	float dx = (n > .5)? -c1.x : c1.x;// even x constructive, odd x destructive
	float pixeloffset = n-ox;// spherical half-pixel offsets down

	// modify the x coordinate of the supply place to the proper facet of the video picture utilizing the pixel offset we simply calculated
	tex.x += pixeloffset*c1.x;
	float heart = .5;
	float texr = tex.x+center-c1.x;// modify the pixel offset to the video body on the best facet of the video information

	// pattern from the left and proper photos and solely pass-trough the purple channel for the left, and the inexperienced and blue channels for the best view
	float3 Q0 = float3(tex2D(s0, float2(tex.x-dx, tex.y)).r, tex2D(s0, float2(texr-dx, tex.y)).gb);
	float3 Q1 = float3(tex2D(s0, tex).r, tex2D(s0, float2(texr, tex.y)).gb);
	float3 Q2 = float3(tex2D(s0, float2(tex.x+dx, tex.y)).r, tex2D(s0, float2(texr+dx, tex.y)).gb);
	float3 Q3 = float3(tex2D(s0, float2(tex.x+dx+dx, tex.y)).r, tex2D(s0, float2(texr+dx+dx, tex.y)).gb);
	return (w.x*Q0+w.y*Q1+w.z*Q2+w.w*Q3).rgbb;// interpolate and output
}

Code:

// (C) 2014 Jan-Willem Krans (janwillem32 <at> hotmail.com)
// This file is a part of Video pixel shader pack.
// This program is free software program; you may redistribute it and/or modify it underneath the phrases of the GNU Basic Public License as revealed by the Free Software program Basis, model 2.
// This program is distributed within the hope that will probably be helpful, however WITHOUT ANY WARRANTY; with out even the implied guarantee of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Basic Public License for extra particulars.
// It's best to have acquired a duplicate of the GNU Basic Public License together with this program; if not, write to the Free Software program Basis, Inc., 51 Franklin Avenue, Fifth Flooring, Boston, MA 02110-1301 USA.

// prototype fundamental fullscreen top-and-bottom to red-cyan anaglyph 3D stereoscopic view with compensated Lanczos2 resizing
// This shader must be run as a display house pixel shader.
// This shader requires compiling with ps_2_0, however larger is healthier, see http://en.wikipedia.org/wiki/Pixel_shader to search for what PS model your video card helps.
// For this shader to work appropriately, the video top in pixels on display must be an excellent quantity.

sampler s0;
float2 c0;
float2 c1;
static const float PI = acos(-1.);
static const float4 wset = float4(1.25, .25, .75, 1.75)*PI;
static const float4 wsets = wset*.5;
static const float4 wp = sin(wset)*sin(wsets)/(wset*wsets);
static const float2 wc = (1.-dot(1., wp))*float2(.75, .25);// compensate truncated window issue by bilinear factoring on the 2 nearest samples
static const float4 w = wp+float4(0., wc, 0.);

float4 essential(float2 tex : TEXCOORD0) : COLOR
{
	float oy = tex.y*c0.y-.5;// video-relative y place

	// detect half of the even or odd coordinates
	oy = oy*.5+.25;// the 2 photos are half-width, compensate for that
	float n = frac(oy);
	float dy = (n > .5)? -c1.y : c1.y;// even y constructive, odd y destructive
	float pixeloffset = n-oy;// spherical half-pixel offsets down

	// modify the y coordinate of the supply place to the proper facet of the video picture utilizing the pixel offset we simply calculated
	tex.y += pixeloffset*c1.y;
	float heart = .5;
	float texr = tex.y+center-c1.y;// modify the pixel offset to the video body on the underside facet of the video information

	// pattern from the left and proper photos and solely pass-trough the purple channel for the left, and the inexperienced and blue channels for the best view
	float3 Q0 = float3(tex2D(s0, float2(tex.x, tex.y-dy)).r, tex2D(s0, float2(tex.x, texr-dy)).gb);
	float3 Q1 = float3(tex2D(s0, tex).r, tex2D(s0, float2(tex.x, texr)).gb);
	float3 Q2 = float3(tex2D(s0, float2(tex.x, tex.y+dy)).r, tex2D(s0, float2(tex.x, texr+dy)).gb);
	float3 Q3 = float3(tex2D(s0, float2(tex.x, tex.y+dy+dy)).r, tex2D(s0, float2(tex.x, texr+dy+dy)).gb);
	return (w.x*Q0+w.y*Q1+w.z*Q2+w.w*Q3).rgbb;// interpolate and output
}

The rest?

See also  Jacob Sartorius (Instagram Star) Bio, Age, Height, Weight, Net Worth, Girlfriend

improvement folder, containing MPC-HC experimental tester builds, pixel shaders and extra:

__________________development folder, containing MPC-HC experimental tester builds, pixel shaders and extra: http://www.mediafire.com/?xwsoo403c53hv

Leave a Reply

Your email address will not be published.