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.

Scorsos mensajes - Pagina 281

  Forum

Wyldanimal
MODERATORE
Da In Mar 2008
17197 post(s)

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

Tutto su iStripper
January 12, 2023, 5061 risposte
Is there a way to include two textures into one sprite's fragment shader?

Have a look at this post.
https://www.istripper.com/forum/thread/27449/137?post=750264

I use two Sources and Combine them in one Shader.
Sources can be Images, Shaders, clips



in the scene file
sprite {
size: 1920, 1080
pos: 0, 0
source: Sweet,0 // combine 0
source: Stage,1 // combine 1
shader: fragment, Shaders/Combine-Exclude/combine2.fsh
blend: false
}

in the shader

#version 140

#extension GL_ARB_compatibility : enable
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
// get inputs from scene
// if an input is missing it will default to 1.0
uniform float zeroPercent;
uniform float onePercent;
uniform float mixPercent;

uniform sampler2D texture0;
uniform sampler2D texture1;
varying vec4 gl_TexCoord[];


void main(void)
{
vec4 vTexCoord = gl_TexCoord[0];
float mixP = 0.0;
float oneP = 0.0;
float zeroP = 0.0;

highp vec4 zero = texture2D(texture0,vTexCoord.xy); // input zero 0
highp vec4 one = texture2D(texture1, vTexCoord.xy); // input one 1

// test all the inputs, if 0. then set to 1.0
if (mixPercent == 0.) {mixP = 1.0;} else { mixP = mixPercent;
}
if (onePercent == 0.) {oneP = 1.0;} else { oneP = onePercent;
}
if (zeroPercent == 0.) {zeroP = 1.0;} else { zeroP = zeroPercent;
}

// combine the inputs using the percentage values
gl_FragColor = ((mixP * ( (zeroP * zero) + (mixP * one)) ) * gl_Color);
gl_FragColor.a = (one.a * zero.a); // make the alpha the combined apha of both input channels

}