Author Topic: Demo pack X-MAS 15  (Read 7299 times)



0 Members and 1 Guest are viewing this topic.

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4228
    • View Profile
Demo pack X-MAS 15
« on: December 24, 2015, 08:14:45 AM »
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".

« Last Edit: December 27, 2015, 03:08:16 PM by Stefan »

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4228
    • View Profile
Re: Demo pack X-MAS 15
« Reply #1 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;
}
« Last Edit: December 25, 2015, 08:34:06 AM by Stefan »

nuninho1980

  • NewsPosters
  • Full Member
  • *
  • Posts: 140
    • View Profile
Re: Demo pack X-MAS 15
« Reply #2 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.
« Last Edit: December 25, 2015, 03:44:24 PM by nuninho1980 »

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4228
    • View Profile
Re: Demo pack X-MAS 15
« Reply #3 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

nuninho1980

  • NewsPosters
  • Full Member
  • *
  • Posts: 140
    • View Profile
Re: Demo pack X-MAS 15
« Reply #4 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...
« Last Edit: December 25, 2015, 04:40:35 PM by nuninho1980 »

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4228
    • View Profile
Snail fixed
« Reply #5 on: December 25, 2015, 10:09:27 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4228
    • View Profile
River Styx - almost fixed
« Reply #6 on: December 27, 2015, 03:04:36 PM »
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 "="
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.



« Last Edit: December 27, 2015, 03:06:41 PM by Stefan »