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.

最後の投稿 - ページ#1451

  掲示板

TheEmu
Joined in Jul 2012
7424 投稿

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

iStripperに関する全て
October 20, 2017, 5119 アンサー
@Z22 - I am glad to see that you found a solution.

A few ***** points.

Firstly, your latest version of the Spin.fsh shader will not compile on my system. This is because at the start you decalre back as a uniform and later try to update it. Updating uniforms is not allowed. You should delete the initial declaration of back and just declare it as a float when it is assigned its value near the end of the shader.

Secondly in your .scn files you use lower case names for the shaders but the actual file names start with a capital letter. This does not matter for Windows but it does for Macs and your scenes would not work on them. It is good practice to be consistant so that you will not accidently disappoint a Mac user.

Secondly, in the combine.fsh and combine2.fsh shaders you should probably be using

gl_FragColor = mix ( back, front, front.a ) * gl_Color;

mix is a GLSL built in function for mixing things, in this case it uses the opacity of the "front" item to determine how much of each the back and the front to include in the result.

Finaly, I did some playing around with your original version of Spin.fsh. I tidied it up by taking advantage of the fact that your uv and uvA variables were identical and that the two rotations were just equal and opposite. Here is my version - it provides three different ways of calculating the final colour (one being your original method) and you can try each by commenting out the ones you do not want and uncomment the one you do want.

// Main code adapted from https://www.shadertoy.com/view/XlsGWf by whiteskull
// Adapted by z22
// Tweaked by TheEmu.

uniform sampler2D texture0;
uniform sampler2D texture1;

uniform vec2 u_WindowSize;
uniform float u_Elapsed;

void main()
{
// Get normalised coordinates each in range -0.5 to +0.5.

vec2 uv = gl_FragCoord.xy / u_WindowSize.xy - 0.5;

// Get time dependant rotation angle.

float sp = cos(u_Elapsed) * sin(u_Elapsed);
float rot = radians ( sp ); // Original had u_Elapsed * sp

// Get the rotation matricies for + and - rotations.

mat2 m0 = mat2 ( cos(rot), -sin(rot), sin(rot), cos(rot) );
mat2 m1 = mat2 ( cos(rot), sin(rot), -sin(rot), cos(rot) );

// Transfom uv and shift origin.

vec2 uv0 = m0 * uv + 0.5;
vec2 uv1 = m1 * uv + 0.5;

// Get colour contributions from each texture.

vec4 c0 = texture2D ( texture0, uv0 );
vec4 c1 = texture2D ( texture1, uv1 );

// Combine colours. Three ways are suggested, the first two are
//
// gl_FragColor = normalize(c0+c1); // original method
// gl_FragColor = mix ( c0, c1, c1.a ); // alternate method
//
// and the third forces any transparent colour to also be black
// so that it will have no effect on the combined colour.

vec4 c = c0*c0.a + c1*c1.a;
gl_FragColor = clamp ( vec4(normalize(c.rgb),c.a), 0.0, 1.0 );

}
Previous ページ#1451