Demo pack X-MAS 15

Started by Stefan, December 24, 2015, 08:14:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stefan

Download from here

updates:
Snail - fixed
Arlo - fixed
River Styx - almost fixed

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".


Stefan

#1
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.

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;
}

nuninho1980

#2
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.

Stefan

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

#define AA 1

nuninho1980

#4
Quote from: 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

#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...

Stefan

Please download again Snail - fixed

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.





Stefan

#6
River Styx - almost fixed

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

Pixel shader error: C0000: syntax error, unexpected '=', expecting ',' or ';' at token "="
// 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.