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 323

  Forum

Wyldanimal
MODERATORE
Da In Mar 2008
17149 post(s)

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

Tutto su iStripper
October 16, 2022, 5051 risposte
For example
https://www.shadertoy.com/view/WllfzS by gaz

here is my conversion

#version 330
#extension GL_EXT_gpu_shader4 : enable
// added the version and open GL extension
// should be the first line of the shader
/////////////////////////////////////////////////////////////////////////////////


// from ShaderToy.com https://www.shadertoy.com/view/WllfzS
// Adapted for iStripper by WyldAnimal

uniform float u_Elapsed;
uniform vec2 u_WindowSize;

#define iTime u_Elapsed
#define iResolution u_WindowSize

/////////////////////////////////////////////////////////////////////////////////

float Scale;
float map(vec3 p)
{
float s=2.;
for(int i = 0; i < 4; i++) {
p=mod(p-1.,2.)-1.;
float r2=1.2/dot(p,p);
p*=r2;
s*=r2;
}
Scale=log2(s);
p = abs(p)-0.8;
if (p.x < p.z) p.xz = p.zx;
if (p.y < p.z) p.yz = p.zy;
if (p.x < p.y) p.xy = p.yx;
return length(cross(p,normalize(vec3(0,.5,1))))/s-Scale*.0015;
}


/////////////////////////////////////////////////////////////////////////////////
// need to convert this from a void to a function and call it by adding
// a void main(void) { to the end of the shader
// what type of variable will the function return?, it is a color and needs to be a vec4
// change void to vec4
//void MainImage(out vec4 fragColor, in vec2 fragCoord) {
vec4 mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv=(2.*fragCoord-iResolution.xy)/iResolution.y;
vec3 p,
ro=vec3(1.,1.,iTime),
w=normalize(vec3(.1*sin(iTime*.5),.3,1)),
u=normalize(cross(w,vec3(cos(-iTime*.16),sin(-iTime*.16),0))),
rd=mat3(u,cross(u,w),w)*normalize(vec3(uv,2));
float h=0.,d,i;
for(i=1.;i<100.;i++)
{
p=ro+rd*h;
d=map(p);
if(d<.0001)break;
h+=d;
}
//fragColor.xyz=35.*vec3(vec3(.7,.9,.7)*cos(Scale*.3)+(cos(p.xyy)*.5+.5))/i;
fragColor=vec4(35.*vec3(vec3(.7,.9,.7)*cos(Scale*.3)+(cos(p.xyy)*.5+.5))/i,1.0);

/////////////////////////////////////////////////////////////////////////////////
//the function needs to return a value.
//it needs to be a vec4
//we will return the varable fragColor
return fragColor;
}

/////////////////////////////////////////////////////////////////////////////////
void main(void) { // this will be run for every pixel of gl_FragCoord.xy
vec4 fragColor = vec4(1.0); // initialize variable fragColor as a vec4
vec4 cc = mainImage(fragColor, gl_FragCoord.xy); // call function mainImage and assign the return vec4 to cc
gl_FragColor = vec4(cc); // set the pixel to the value of vec4 cc
}

download it here
https://virtuastripper.net/Shaders/WllfzS.fsh

and a Variant here
https://virtuastripper.net/Shaders/WllfzS-B.fsh
Wyldanimal
MODERATORE
Da In Mar 2008
17149 post(s)

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

Tutto su iStripper
October 15, 2022, 5051 risposte
iStripper uses these for the Time and Resolution
u_Elapsed is a float, it is floating point variable ( must use a decimal point with a float, such as 1. or 0. or 3.0 )
it starts counting the time in milliseconds when the shader starts, and continues to count till the shader ends.

u_WindowSize is a vec2 ( it has a width and a height value, or 2 components )
you can use a swizzle to get one or both of them.
u_WindowSize.x gets just the width, this is an int or a single component.
u_WindowSize.y gets just the height, this is an int or a single component.
u_WindowSize.xy gets both, this is a vec2, it has two components
you can also use
u_WindowSize.u in place of u_WindowSize.x
u_WindowSize.v in place of u_WindowSize.y
u_WindowSize.uv in place of u_WindowSize.xy
use care when using swizzles to make sure both sides of an = sign, have the same number of components
this is one of the areas that can cause errors that are next to impossible to hunt down.


this is how we write them in the shader
uniform float u_Elapsed; // The elapsed time in seconds
uniform vec2 u_WindowSize; // Window dimensions in pixels

now that we have the iStripper time and resolution as inputs
we define New variables and assign the iStripper inputs to use
It's easier to use the shader toy names, and NOT edit every place in the shader.

so for the Chess shader, Just define two variables using the shader toy name.

#define iTime u_Elapsed //( varable iTime will get its value from the iStipper variable u_Elapsed )
#define iResolution u_WindowSize //( variable iResolution will get its value from iStripper variable u_WindowSize )

in the shader we can now use
iTime in place of u_Elapsed and
iResolution in place of u_WindowSize

since the shader already is written, using iTime and iResolution variables, you don't have to edit every place where they are used.


Wyldanimal
MODERATORE
Da In Mar 2008
17149 post(s)

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

Tutto su iStripper
October 15, 2022, 5051 risposte
The Shader toy shaders
use these Inputs. Some or all of them.
These must be converted to iStripper compatable inputs.
Not all of these can be converted, so there are some shaders that just can't be used..

Shader Inputs
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iTime; // shader playback time (in seconds)
uniform float iTimeDelta; // render time (in seconds)
uniform int iFrame; // shader playback frame
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)
uniform float iSampleRate; // sound sample rate (i.e., 44100)

iMouse can not be converted, but a pseudo Random function can be used to simulate Mouse input.
The Chess shader, does not use Mouse input.
iDate can't be parsed, but a fake date can be created. You can't grab the current date and time of day.

These are inputs that can't be simulated.
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform float iSampleRate; // sound sample rate (i.e., 44100)

uniform samplerXX iChannel0..3;
these are the input images sent from the scene to the shader, the clip sprite, sprites, etc...
iStripper does NOT support video or sound inputs.


When Possible, it's best to use the Shader toy Names, so that, there is a lot less editing to be done to the shader.