Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
71 user(s) are online (46 user(s) are browsing Forums)

Members: 0
Guests: 71

more...

Support us!

Recent OS4 Files
OS4Depot.net

Report message:*
 

Re: Warp3DNova shader bugs thread

Subject: Re: Warp3DNova shader bugs thread
by kas1e on 2020/6/2 9:49:03

@all
Found 4 more shaders , which we can hope share the same issue. At least i hope its the same issue, because it better to create one bug report with 8 shaders, than 8 bug reprots :)

So, there they are:

Shader #6:

https://www.shadertoy.com/view/3dffz7

//width of lines
#define _Width 0.05    

//width of the borders of the lines
#define _Border 0.003    

//frequency of the noise
#define _NoiseFreq 50.0

//strength of the noise
#define _NoiseStr 0.01    

//speed of the "simulation"
#define _Speed 5.0

//portion of the time(from 0 to 1), that will be spent on "growing" the line
//rest of the time will be spent "widening" the line
#define _GT 0.5    

float hashfloat n )
{
    
mod(n691.564);
    return 
fract(sin(n)*43758.5453);
}

float perlin(float x) {
    
float f fract(x);
    
float i floor(x);
    return 
mix(hash(i), hash(i+1.0), smoothstep(0.01.0f));
}

vec2 hash2vec2 p )
{
    
mod(p132.5);
    return 
fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453);
}

float saturate(float x) {
    return 
clamp(x0.01.0);
}

float drawLine(inout vec2 uvinout float drawfloat ifloat f) {
    
float grow saturate(f/_GT);
    
float widen saturate((f-_GT)/(1.0-_GT))*_Width;

    
vec2 norm hash2(vec2(ii*1.1))-0.5;
    
vec2 nnorm normalize(norm);

    
uv -= norm;

    
uv mat2x2(nnorm.xnnorm.y, -nnorm.ynnorm.x) * uv;
    
float per = (perlin((uv.y+i)*_NoiseFreq)-0.5)*_NoiseStr;

    
uv.+= per;

    
float tx uv.- (step(0.0uv.x)-0.5)*widen;

    
float ans draw*smoothstep(_Border+0.003_Borderabs(tx))*step(uv.ymix(-2.02.0grow));
    
draw saturate(draw step(2.0*abs(uv.x), widen));
    
uv.tx per;

    
uv mat2x2(nnorm.x, -nnorm.ynnorm.ynnorm.x) * uv;
    
uv += norm;

    return 
ans;
}

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec2 uv fragCoord/iResolution.xy;
    
uv -= 0.5;
    
uv.*= iResolution.x/iResolution.y;
    
    
float tim = (iTime)*_Speed;
    
float timei floor(tim);
    
float timef fract(tim);

    
float bord 0.0;
    
float draw 1.0;

    
bord += drawLine(uvdrawtimeitimef);

    
timei -= 1.0;

    for(
float i 0.0500.0i++) {
        
bord += drawLine(uvdrawtimei-i1.0);
        if(
draw 0.5) break;
    }
    
    
fragColor vec4(bordbordbord1.0);
}



WIN version:

Resized Image

AOS4 version:

Resized Image


Shader #7:

https://www.shadertoy.com/view/XtVGDR

const float PI 3.14159265358979//Probably enough precision?
const float TAU 2.0 PI;

//Returns how much coord is within a circle centered at circle_pos. [0, 1]
float circle(vec2 circle_posvec2 coord)
{
    
float circ_rad 70.0;
    
float circ_blur 1.0;
    
float dist distance(circle_poscoord);
    return 
smoothstep(circ_rad circ_blurcirc_rad circ_blurdist); 
}

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec4 black vec4(0.00.00.01.0);
    
vec4 white vec4(1.01.01.01.0);
    
    
vec2 center iResolution.xy vec2(0.5);
    
float t iTime;
    
float d 70.0*sin(t/PI); //Distance of each circle from the center. (Can be pos/neg)
    
    
const float MAX_CIRCLES 9.0//Max number of circles.
    
float num_circles MAX_CIRCLES/2.0 MAX_CIRCLES/2.0*cos(t/PI) + 0.01//Current number of circles.
    
float circles 0.0//The total number of circles this pixel is in.
    
    
for (float f 0.0MAX_CIRCLESf++) {
        if (
num_circles) { //Wish I could have non-const number of loop iterations :(
            
float ap f/num_circles TAU//Angular position of each circle, [0, tau]
            
vec2 newCirclePos center d*vec2(cos(ap), sin(ap));
            
circles += circle(newCirclePosfragCoord); //If this pixel is in the new circle, circles increases.
        
}
    }
    
    
circles = (cos(circles*PI)+1.0)/2.0//Smoothly interpolate between odd and even values.
    
fragColor mix(blackwhitecircles);
}



WIN version:

Resized Image

AOS4 version:

Resized Image


Shader #8:

https://www.shadertoy.com/view/wd2fRW

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec2 uv fragCoord/iResolution.xy;
    
uv.*= iResolution.x/iResolution.y;
    
    
vec3 col;
    
vec2 zuu;
    
float prof 20.;
    
    for(
float i=profi>0. ;i--){
        
zuu..5+cos(uv.x*(5.*i)+sin(iTime*1.2)*4.);
        
zuu..5+cos(uv.y*(5.*i)+cos(iTime*1.6)*4.);
        if (
zuu.>.5 ^^  zuu.>.5){
            
col vec3(1./i,1./i,1./i);
        }
    }

    
fragColor vec4(col,1.0);
}



WIN version:

Resized Image

AOS4 version:

Resized Image


Shader #9:

https://www.shadertoy.com/view/Xt23z3

#define ANTI_ALIAS

#define NUM_FACES 4
#define IN_RADIUS 0.25
#define OUT_RADIUS 0.70
#define SCROLL_SPEED -0.9

#define COLOR_1 0.50, 0.90, 0.95
#define COLOR_2 0.95, 0.60, 0.10

float tau atan(1.0) * 8.0;
float pi atan(1.0) * 4.0;
float aaSize 0.0;

vec4 slice(float x0float x1vec2 uv)
{
    
float u = (uv.x0)/(x1 x0);
    
float w = (x1 x0);
    
vec3 col vec3(0);
    
    
//Gradient
    
col mix(vec3(COLOR_1), vec3(COLOR_2), u);
    
    
//Lighting 
    
col *= sqrt(2.0 IN_RADIUS*IN_RADIUS * (1.0 cos(tau float(NUM_FACES))));
    
    
//Edges
    
col *= smoothstep(0.050.10u) * smoothstep(0.950.90u) + 0.5;
    
    
//Checker board
    
uv.+= iTime SCROLL_SPEED//Scrolling
    
    #ifdef ANTI_ALIAS
        
col *= (-1.0 2.0 smoothstep(-0.030.03sin(u*pi*4.0) * cos(uv.y*16.0))) * (1.0/16.0) + 0.7;
    
#else
        
col *= sign(sin(pi 4.0) * cos(uv.16.0)) * (1.0/16.0) + 0.7;
    
#endif
    
    
float clip 0.0;
    
    
#ifdef ANTI_ALIAS
        
clip = (1.0-smoothstep(0.5 aaSize/w0.5 aaSize/wabs(0.5))) * step(x0x1);
    
#else
        
clip float((>= 0.0 && <= 1.0) && (x0 x1));
    
#endif
    
    
return vec4(colclip);
}

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
aaSize 2.0 iResolution.y//Scale anti aliasing with resolution
    
vec2 res iResolution.xy iResolution.y;
    
vec2 uv fragCoord.xy iResolution.y;
    
uv -= res 2.0;
    
uv *= 2.0;
    
    
//Polar coordinates
    
vec2 uvr vec2(length(uv), atan(uv.yuv.x) + pi);
    
uvr.-= OUT_RADIUS;
    
    
vec3 col vec3(0.05);
    
    
//Twisting angle
    
float angle uvr.2.0*iTime sin(uvr.y) * sin(iTime) * pi;
    
    for(
int i 0;NUM_FACES;i++)
    {
        
float x0 IN_RADIUS sin(angle tau * (float(i) / float(NUM_FACES)));
        
float x1 IN_RADIUS sin(angle tau * (float(1) / float(NUM_FACES)));
        
        
vec4 face slice(x0x1uvr);
        
        
col mix(colface.rgbface.a); 
    }
    
    
//col = (abs(uv.x) > 1.0) ? vec3(1) : col;
    
    
fragColor vec4(col1.0);
}



WIN version:

Resized Image

AOS4 version:

Resized Image


Question is : is that the same issue everywhere, or they different ones ? Did anyone can see in code of whose 8 shaders something common maybe ? Just the more info we find, the faster/easy it will be to fix for Hans.

At least shaders 4,6 and 7 (those black and white swapped colors) looks very much the same issue at least visually, but it can be of course different issues, just by some luck it looks like swapped.



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project