Geeks3D Forums

GeeXLab => GeeXLab - english forum => Topic started by: Stefan on December 24, 2015, 08:14:45 AM

Title: Demo pack X-MAS 15
Post by: Stefan on December 24, 2015, 08:14:45 AM
Download from here (https://goo.gl/DGndXu)

updates:
Snail - fixed (https://goo.gl/1GEWht)
Arlo - fixed (https://goo.gl/K3GcAi)
River Styx - almost fixed (https://goo.gl/KrKg4t)

Package contains new textures 17-20 from Shadertoy and a cubemap from Humus (used by "Crystal Skull").
Copy missing textures from code sample pack or MadShaders' data folder.
Demos tagged WIP don't work properly for misc. reasons.

Highlights are some [SIG15] submissions and most excellent shader "Snail" (https://www.shadertoy.com/view/ld3Gz2).

(https://farm6.staticflickr.com/5700/23969973755_5c0b1c72a4_o.png)
Title: Re: Demo pack X-MAS 15
Post by: Stefan on December 25, 2015, 08:30:25 AM
Note: the background in "Snail" is messed up in GeeXLab for some reason.

In some other shaders before (e.g. "River Styx") i noticed that GeeXLab dislikes code lines with colons and questionmarks.

Code: [Select]
vec3 background( in vec3 d )
{
    // cheap cubemap
    vec3 n = abs(d);
    vec2 uv = (n.x>n.y && n.x>n.z) ? d.yz/d.x:
              (n.y>n.x && n.y>n.z) ? d.zx/d.y:
                                     d.xy/d.z;
   
    vec3  col = vec3( 0.0 );
    for( int i=0; i<200; i++ )
    {
        float h = float(i)/200.0;
        float an = 31.0*6.2831*h;
        vec2  of = vec2( cos(an), sin(an) ) * h;

        vec3 tmp = texture2D( iChannel2, uv*0.25 + 0.0075*of, 4.0 ).yxz;
        col = smax( col, tmp, 0.5 );
    }
   
   
    return pow(col,vec3(3.5,3.0,6.0))*0.2;
}
Title: Re: Demo pack X-MAS 15
Post by: nuninho1980 on December 25, 2015, 03:42:49 PM
NOTICE!!!
"Snail" sample, "ShaderToy" online is 7x faster than GeekLab or GLSLHacker!?!! Why?? Because of bad code for GeekLab or GLSLHacker?

EVGA GeForce GTX 780 Ti Classified 358.50WHQL (HQ) running Win 10 x64 - "Snail" sample:
online: ~28 fps at 1024x768 fullscreen
GeekLab or GLSLHacker: 4 fps at max windowed in 1024x768 desktop.
Title: Re: Demo pack X-MAS 15
Post by: Stefan on December 25, 2015, 04:13:08 PM
As you can read in overlay, i activated 4xAA in pixel shader.

If you like it fast and ugly, then revert the code to the original

Code: [Select]
#define AA 1
Title: Re: Demo pack X-MAS 15
Post by: nuninho1980 on December 25, 2015, 04:29:40 PM
As you can read in overlay, i activated 4xAA in pixel shader.

If you like it fast and ugly, then revert the code to the original

Code: [Select]
#define AA 1
Thank ;)

1xAA or 0xAA: 65 fps - woww!?!! :)
4xAA: 4 fps
At max windowed in desktop 1024x768.

Why from 0xAA to 4xAA impacts insanely performance?? But it is BAD optimized... But  65 fps at 0xAA to ~30 or ~40 fps at 4xAA - it's normal...
Title: Snail fixed
Post by: Stefan on December 25, 2015, 10:09:27 PM
Please download again Snail - fixed (https://goo.gl/1GEWht)

I fixed the background by adding
gh_gpu_program.uniform1i(shadertoy_prog, "iChannel2", 2);
to "update_scene"
Usually this is redundant, but in this case it showed the backbuffer.

Also i made the overlays more clearly.

(https://farm6.staticflickr.com/5770/23343166153_6b72d1c730_o.png)


Title: River Styx - almost fixed
Post by: Stefan on December 27, 2015, 03:04:36 PM
River Styx - almost fixed (https://goo.gl/KrKg4t)

Works fine now on AMD and NVIDIA, fails to render on Intel.

Pixel shader error: C0000: syntax error, unexpected '=', expecting ',' or ';' at token "="
Code: [Select]
// Home in on the surface by dividing by two and split...
(mapDE(rO + halfwayT*rD) < 0.) ? t.x = halfwayT:t.y = halfwayT;
has been fixed by replacing questionmark and colon with commas.
I have no idea why the original code compiles at shadertoy.com, but fails in GeeXLab.



(https://farm2.staticflickr.com/1453/23920600531_44d1b6349e_o.png)