Age Verification
This website contains age-restricted material including nudity and explicit content. By entering, you confirm being at least 18 years old or the age of majority in the jurisdiction you are accessing the website from.
I am 18+ or older - Enter
I am under 18 - Exit
Our parental controls page explains how you can easily block access to this site.

最后发帖 - 页数 1448

  论坛

TheEmu
已加入 在 Jul 2012
7424 发布

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

关于iStripper的一切
October 25, 2017, 5119 回复
Although in practice it makes little difference in practice the "correct" version of RadialBlur.fsh would be

//Original taken from "halloween" scene by totem(istripper)
//Adapted by z22 and then by TheEmu.

uniform sampler2D texture0;
varying vec4 gl_TexCoord[];

const float blurSize = 1.5 / 1024.0;

const vec2 blur1 = vec2(+1.1,+0.1)*blurSize;
const vec2 blur2 = vec2(+1.1,-0.1)*blurSize;

void main(void)
{
// Apply a radialy symetric blur using 9 sample points comprising a
// central point, at the current pixel position, with 8 more at the
// corners of an octagon, though not a regular octagon.

vec2 vTexCoord = gl_TexCoord[0].xy;

vec4 c0 = texture2D ( texture0, vTexCoord );

vec4 c1 = texture2D ( texture0, vTexCoord + blur1.xy );
vec4 c2 = texture2D ( texture0, vTexCoord + blur1.yx );

vec4 c3 = texture2D ( texture0, vTexCoord - blur1.xy );
vec4 c4 = texture2D ( texture0, vTexCoord - blur1.yx );

vec4 c5 = texture2D ( texture0, vTexCoord + blur2.xy );
vec4 c6 = texture2D ( texture0, vTexCoord + blur2.yx );

vec4 c7 = texture2D ( texture0, vTexCoord - blur2.xy );
vec4 c8 = texture2D ( texture0, vTexCoord - blur2.yx );

gl_FragColor = ( c0 + c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) / 9.0;

}

The octagon is not a regular one because its vertical and horizontal sides will have a different length (in texture coordinate space) to its diagonal sides. This is further distorted by the different scale factors for the vertical and horizontal axes that apply when going from texture coordinates to screen coordinates. (Texture coordinates run from 0.0 to 1.0 for both X and Y).

To use a regular octagonal spacing in texture space for the sample points change blur1 and blur2 to use cos and sin of 22.5 degrees instead of 1.1 and 0.1 and increase blurSize to compenate for the change in the sample distance from the central point that this introduces, I am now using

const float blurSize = 4.5 / 1024.0;

const vec2 blur1 = vec2(+0.9238,+0.3826)*blurSize;
const vec2 blur1 = vec2(+0.9238,-0.3826)*blurSize;
stefnev1
主持人
已加入 在 Jul 2008
17724 发布