Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Stefan

Pages: [1] 2 3 ... 152
1
English forum / 38911 BASIC BYTES FREE converted
« on: Today at 02:37:12 PM »
38911 BASIC Bytes free converted to GLSL Hacker format

The original resolution of the C64 was 320x200, but that looks too crappy nowadays.

Copy the code and save as 38911_basic_bytes_free_gl2.xml

Code: [Select]
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<glsl_hacker>
   
  <window name="win3d01" title="MadShaders - Shadertoy/38911 BASIC Bytes free"
          width="640" height="400"
          gl_version_major="2" gl_version_minor="1" />
         
         
<gpu_program name="shadertoy_prog" >
    <raw_data_vs><![CDATA[     
void main()
{   
    gl_TexCoord[0] = gl_MultiTexCoord0;
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;       
}
  ]]></raw_data_vs>
 
    <raw_data_ps><![CDATA[     

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

uniform float     iGlobalTime;     // shader playback time (in seconds)
uniform vec4      iMouse;          // mouse pixel coords. xy: current (if MLB down), zw: click
//uniform sampler2D iChannel0;
uniform vec3      iResolution;     // viewport resolution (in pixels)



//

//-------------------------------------------------------------------------
// general utilities

float dtoa(float d, float amount)
{
    return clamp(1.0 / (clamp(d, 1.0/amount, 1.0)*amount), 0.,1.);
}

// returns 0.0 or 1.0
float extractBit(float fv, float bitIndex)
{
    fv = floor(fv / pow(2., bitIndex));// shift right bitIndex and remove unwanted bits to the right
    fv /= 2.;// shift one more to put our value into decimal portion
    fv = fract(fv);// our value is now isolated. fv is now exactly 0.0 or approx.0.5
    return sign(fv);
}

// not exactly perfectly perfect, but darn close
float pointRectDist(vec2 p, vec2 rectTL, vec2 rectBR)
{
  float dx = max(max(rectTL.x - p.x, 0.), p.x - rectBR.x);
  float dy = max(max(rectTL.y - p.y, 0.), p.y - rectBR.y);
  return max(dx, dy);
}


// warps (0,0)-(1,1) coords
vec2 tvWarp(vec2 uv) {
    uv = (uv - 0.5) * 2.0;// uv is now -1 to 1
    uv *= 1.1;
    uv.x *= 1.0 + pow((abs(uv.y) / 4.0), 2.5);
    uv.y *= 1.0 + pow((abs(uv.x) / 3.5), 2.5);
    uv = (uv / 2.0) + 0.5;// back to 0-1 coords
    uv = uv * 0.92 + 0.04;
    return uv;
}

vec2 getuv(vec2 gl_FragCoord, vec2 newTL, vec2 newSize, out float distanceToVisibleArea, out float vignetteAmt)
{
    vec2 ret = vec2(gl_FragCoord.x / iResolution.x, (iResolution.y - gl_FragCoord.y) / iResolution.y);// ret is now 0-1 in both dimensions
   
    // warp
    ret = tvWarp(ret / 2.) * 2.;// scale it by 2.
    distanceToVisibleArea = pointRectDist(ret, vec2(0.0), vec2(1.));

    // vignette
    vec2 vignetteCenter = vec2(0.5, 0.7);
    vignetteAmt = 1.0 - distance(ret, vignetteCenter);
    vignetteAmt = pow(vignetteAmt, 0.4);// strength
   
    ret *= newSize;// scale up to new dimensions
    float aspect = iResolution.x / iResolution.y;
    ret.x *= aspect;// orig aspect ratio
    float newWidth = newSize.x * aspect;
    return ret + vec2(newTL.x - (newWidth - newSize.x) / 2.0, newTL.y);
}



//-------------------------------------------------------------------------
// font drawing code ...

const int g_glyphCount = 38;
void getGlyphAtIndex(int gi, out vec4 scan0123, out vec4 scan4567)
{
    if(gi==0){scan0123=vec4(0x18,0x3C,0x66,0x7E);scan4567=vec4(0x66,0x66,0x66,0x00);return;}
    if(gi==1){scan0123=vec4(0x7C,0x66,0x66,0x7C);scan4567=vec4(0x66,0x66,0x7C,0x00);return;}
    if(gi==2){scan0123=vec4(0x3C,0x66,0x60,0x60);scan4567=vec4(0x60,0x66,0x3C,0x00);return;}
    if(gi==3){scan0123=vec4(0x78,0x6C,0x66,0x66);scan4567=vec4(0x66,0x6C,0x78,0x00);return;}
    if(gi==4){scan0123=vec4(0x7E,0x60,0x60,0x78);scan4567=vec4(0x60,0x60,0x7E,0x00);return;}
    if(gi==5){scan0123=vec4(0x7E,0x60,0x60,0x78);scan4567=vec4(0x60,0x60,0x60,0x00);return;}
    if(gi==6){scan0123=vec4(0x3C,0x66,0x60,0x6E);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==7){scan0123=vec4(0x66,0x66,0x66,0x7E);scan4567=vec4(0x66,0x66,0x66,0x00);return;}
    if(gi==8){scan0123=vec4(0x3C,0x18,0x18,0x18);scan4567=vec4(0x18,0x18,0x3C,0x00);return;}
    if(gi==9){scan0123=vec4(0x1E,0x0C,0x0C,0x0C);scan4567=vec4(0x0C,0x6C,0x38,0x00);return;}
    if(gi==10){scan0123=vec4(0x66,0x6C,0x78,0x70);scan4567=vec4(0x78,0x6C,0x66,0x00);return;}
    if(gi==11){scan0123=vec4(0x60,0x60,0x60,0x60);scan4567=vec4(0x60,0x60,0x7E,0x00);return;}
    if(gi==12){scan0123=vec4(0x63,0x77,0x7F,0x6B);scan4567=vec4(0x63,0x63,0x63,0x00);return;}
    if(gi==13){scan0123=vec4(0x66,0x76,0x7E,0x6E);scan4567=vec4(0x66,0x66,0x66,0x00);return;}
    if(gi==14){scan0123=vec4(0x3C,0x66,0x66,0x66);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==15){scan0123=vec4(0x7C,0x66,0x66,0x66);scan4567=vec4(0x7C,0x60,0x60,0x00);return;}
    if(gi==16){scan0123=vec4(0x3C,0x66,0x66,0x66);scan4567=vec4(0x66,0x3C,0x0E,0x00);return;}
    if(gi==17){scan0123=vec4(0x7C,0x66,0x66,0x7C);scan4567=vec4(0x78,0x6C,0x66,0x00);return;}
    if(gi==18){scan0123=vec4(0x3C,0x66,0x60,0x3C);scan4567=vec4(0x06,0x66,0x3C,0x00);return;}
    if(gi==19){scan0123=vec4(0x7E,0x18,0x18,0x18);scan4567=vec4(0x18,0x18,0x18,0x00);return;}
    if(gi==20){scan0123=vec4(0x66,0x66,0x66,0x66);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==21){scan0123=vec4(0x66,0x66,0x66,0x66);scan4567=vec4(0x66,0x3C,0x18,0x00);return;}
    if(gi==22){scan0123=vec4(0x63,0x63,0x63,0x6B);scan4567=vec4(0x7F,0x77,0x63,0x00);return;}
    if(gi==23){scan0123=vec4(0x66,0x66,0x3C,0x18);scan4567=vec4(0x3C,0x66,0x66,0x00);return;}
    if(gi==24){scan0123=vec4(0x66,0x66,0x66,0x3C);scan4567=vec4(0x18,0x18,0x18,0x00);return;}
    if(gi==25){scan0123=vec4(0x7E,0x06,0x0C,0x18);scan4567=vec4(0x30,0x60,0x7E,0x00);return;}
    if(gi==26){scan0123=vec4(0x3C,0x66,0x6E,0x76);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==27){scan0123=vec4(0x18,0x18,0x38,0x18);scan4567=vec4(0x18,0x18,0x7E,0x00);return;}
    if(gi==28){scan0123=vec4(0x3C,0x66,0x06,0x0C);scan4567=vec4(0x30,0x60,0x7E,0x00);return;}
    if(gi==29){scan0123=vec4(0x3C,0x66,0x06,0x1C);scan4567=vec4(0x06,0x66,0x3C,0x00);return;}
    if(gi==30){scan0123=vec4(0x06,0x0E,0x1E,0x66);scan4567=vec4(0x7F,0x06,0x06,0x00);return;}
    if(gi==31){scan0123=vec4(0x7E,0x60,0x7C,0x06);scan4567=vec4(0x06,0x66,0x3C,0x00);return;}
    if(gi==32){scan0123=vec4(0x3C,0x66,0x60,0x7C);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==33){scan0123=vec4(0x7E,0x66,0x0C,0x18);scan4567=vec4(0x18,0x18,0x18,0x00);return;}
    if(gi==34){scan0123=vec4(0x3C,0x66,0x66,0x3C);scan4567=vec4(0x66,0x66,0x3C,0x00);return;}
    if(gi==35){scan0123=vec4(0x3C,0x66,0x66,0x3E);scan4567=vec4(0x06,0x66,0x3C,0x00);return;}
    if(gi==36){scan0123=vec4(0x00,0x00,0x00,0x00);scan4567=vec4(0x00,0x18,0x18,0x00);return;}
    if(gi==37){scan0123=vec4(0x00,0x66,0x3C,0xFF);scan4567=vec4(0x3C,0x66,0x00,0x00);return;}   
    scan0123 = vec4(0.);scan4567 = vec4(0.);
}

// stringIndex lets you use the same pos for a string of chars, just incrementing stringIndex.
// this is pretty fast, but is binary. a prettier version might return a distance function but will suffer perf problems because of the complex geometry.
vec4 drawCharacter(vec4 inpColor, vec4 glyphColor, vec2 uv, vec2 pos, vec2 charSize, float stringIndex, int glyphIndex)
{
    vec2 element = floor(((uv - pos) / (charSize / 8.)));// convert uv to pixel indices
    element.x -= stringIndex * 8.0;
    element.x = floor(7.0 - element.x);// flip X. maybe my encoding method is wrong?
    // bounds check; most of the time uv will not land on the character so important to optimize this.
    if(element.y < 0. || element.y > 7.) return inpColor;
    if(element.x < 0. || element.x > 7.) return inpColor;

    vec4 scan0123;
    vec4 scan4567;
    getGlyphAtIndex(glyphIndex, scan0123, scan4567);
   
    int scanLineI = int(element.y);
    float scanLine;
   
    if(scanLineI == 0) scanLine = scan0123[0];
    else if(scanLineI == 1) scanLine = scan0123[1];
    else if(scanLineI == 2) scanLine = scan0123[2];
    else if(scanLineI == 3) scanLine = scan0123[3];
    else if(scanLineI == 4) scanLine = scan4567[0];
    else if(scanLineI == 5) scanLine = scan4567[1];
    else if(scanLineI == 6) scanLine = scan4567[2];
    else if(scanLineI == 7) scanLine = scan4567[3];

    float a = extractBit(scanLine, element.x);
    return vec4(mix(inpColor.rgb, glyphColor.rgb, a * glyphColor.a), inpColor.a);
}




//-------------------------------------------------------------------------
vec4 hardRect(vec4 inpColor, vec4 rectColor, vec2 uv, vec2 tl, vec2 br)
{
    if(uv.x < tl.x)
        return inpColor;
    if(uv.x > br.x)
        return inpColor;
    if(uv.y < tl.y)
        return inpColor;
    if(uv.y > br.y)
        return inpColor;
    return rectColor;
}


float nsin(float x)
{
    return (sin(x) + 1.0) / 2.;
}


void main()
{
    float distanceToVisibleArea;
    float vignetteAmt;
    vec2 uv = getuv(gl_FragCoord, vec2(1.08,-0.1), vec2(2.6), distanceToVisibleArea, vignetteAmt);

    vec4 darkBlue = vec4(0.21,0.16,0.47,1.0);
    vec4 lightBlue = vec4(0.42,0.37,0.71,1.0);

    // main background
    gl_FragColor = darkBlue;
   
    // border
    vec2 charAreaTL = vec2(0.6, 0.3);
    if(uv.x < charAreaTL.x)
        gl_FragColor = lightBlue;
    if(uv.y < charAreaTL.y)
        gl_FragColor = lightBlue;

    // ready.
    vec4 charColor = lightBlue;
    vec2 charSize = vec2(0.2);
    charSize.x *= 0.936;// c64 aspect ratio
    vec2 stringPos = charAreaTL + vec2(0, 1.0 * charSize.y);// line 1
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 4., 37);// *
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 5., 37);// *
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 6., 37);// *
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 7., 37);// *

    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 9., 2);// C
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 10., 14);// O
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 11., 12);// M
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 12., 12);// M
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 13., 14);// O
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 14., 3);// D
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 15., 14);// O
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 16., 17);// R
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 17., 4);// E

    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 19., 32);// 6
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 20., 30);// 4
   
    stringPos = charAreaTL + vec2(0, 3.0 * charSize.y);// line 3
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 1., 32);// 6
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 2., 30);// 4
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 3., 10);// K
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 5., 17);// R
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 6., 0);// A
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 7., 12);// M

    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 9., 18);// S
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 10., 24);// Y
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 11., 18);// S
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 12., 19);// T
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 13., 4);// E
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 14., 12);// M
   
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 17., 29);// 3
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 18., 34);// 8
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 19., 35);// 9
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 20., 27);// 1
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 21., 27);// 1
   
    stringPos = charAreaTL + vec2(0, 5.0 * charSize.y);// line 5
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 0., 17);// R
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 1., 4);// E
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 2., 0);// A
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 3., 3);// D
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 4., 24);// Y
    gl_FragColor = drawCharacter(gl_FragColor, charColor, uv, stringPos, charSize, 5., 36);// .
   
    if(mod(iGlobalTime, 1.) < 0.5)
    {
        vec2 tl = vec2(stringPos.x, stringPos.y + charSize.y);
        gl_FragColor = hardRect(gl_FragColor, charColor, uv, tl, tl + charSize);
    }

   
    // black out warped area
    gl_FragColor = vec4(mix(vec3(0.), gl_FragColor.rgb, dtoa(distanceToVisibleArea, 200.)), 1.0);
       
    gl_FragColor.rgb *= vignetteAmt;

    //Draws the horizontal scan lines across the screen
    float scanLineFX = nsin(uv.y * 500.);
    scanLineFX = clamp(pow(scanLineFX, 4.0), 0.3, 1.0);
    gl_FragColor.rgb *= 1.0 + scanLineFX;
    gl_FragColor.rgb = clamp(gl_FragColor.rgb, 0.0, 1.0);

    //gl_FragColor = gridOverlay(gl_FragColor, uv);
}



//

]]></raw_data_ps>

</gpu_program>

 
    <script name="init_scene" run_mode="INIT" >
        <raw_data><![CDATA[   

app_dir = gh_utils.get_scripting_libs_dir()         
dofile(app_dir .. "lua/Moon3D_v2.lua")

moon3d.init(2, 1)
moon3d.graphics.vsync(0)

bmfont = moon3d.font.create("trebuchet_20px.fnt", "data/")
bmfont_texture = moon3d.font.getTexture(bmfont)
moon3d.madshaders.setBmFontData(bmfont, bmfont_texture)

winW, winH = moon3d.window.getSize()

quad = moon3d.graphics.newQuad(winW, winH)
shadertoy_prog = moon3d.graphics.getGpuProgram("shadertoy_prog")

-- tex0 = moon3d.image.load2d("./data/tex16.png")

moon3d.madshaders.resetBenchmarkData()

        ]]></raw_data>
    </script>

 
    <script name="update_scene" run_mode="FRAME" >
        <raw_data><![CDATA[   

moon3d.startFrame(0, 0, 0, 1)

local global_time = moon3d.getTime()

moon3d.madshaders.updateBenchmarkData(global_time)

moon3d.camera.bindOrtho()

moon3d.graphics.bindGpuProgram(shadertoy_prog)
moon3d.madshaders.updateShadertoyCommonParams(shadertoy_prog, global_time)
--moon3d.madshaders.setShadertoyTexture(shadertoy_prog, tex0, 0)
moon3d.graphics.draw(quad)

moon3d.madshaders.displayBenchmarkInfoV2("Shadertoy/38911 BASIC Bytes free", global_time, 1, 1, 1, 1)

moon3d.endFrame()

        ]]></raw_data>
    </script>
   

    <script name="resize_scene" run_mode="SIZE" >
        <raw_data><![CDATA[   

moon3d.window.resize()
winW, winH = moon3d.window.getSize()
moon3d.graphics.resizeQuad(quad, winW, winH)

        ]]></raw_data>
    </script>
 
</glsl_hacker>



2
English forum / EvilSeed converted
« on: Today at 01:55:38 PM »
EvilSeed @ Shadertoy converted to GLSL Hacker format

My first try with conversion and for no reason a big screenshot :P

Copy the code and save as evilseed_gl2.xml

Code: [Select]
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<glsl_hacker>
   
  <window name="win3d01" title="MadShaders - Shadertoy/EvilSeed"
          width="800" height="400"
          gl_version_major="2" gl_version_minor="1" />
         
         
<gpu_program name="shadertoy_prog" >
    <raw_data_vs><![CDATA[     
void main()
{   
    gl_TexCoord[0] = gl_MultiTexCoord0;
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;       
}
  ]]></raw_data_vs>
 
    <raw_data_ps><![CDATA[     

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

 
uniform vec3      iResolution;     // viewport resolution (in pixels)
uniform float     iGlobalTime;     // shader playback time (in seconds)
uniform vec4      iMouse;          // mouse pixel coords. xy: current (if MLB down), zw: click
uniform sampler2D iChannel0;
uniform vec3 iChannelResolution0;



const float pi = 3.14159;

mat3 xrot(float t)
{
    return mat3(1.0, 0.0, 0.0,
                0.0, cos(t), -sin(t),
                0.0, sin(t), cos(t));
}

mat3 yrot(float t)
{
    return mat3(cos(t), 0.0, -sin(t),
                0.0, 1.0, 0.0,
                sin(t), 0.0, cos(t));
}

mat3 zrot(float t)
{
    return mat3(cos(t), -sin(t), 0.0,
                sin(t), cos(t), 0.0,
                0.0, 0.0, 1.0);
}

float btime = 1.0;
float bspeed = 10.0;

float map(vec3 pos)
{
    float dir = 1.0;
    vec3 id = floor(pos);
    pos.y += sin(iGlobalTime+id.x*10.0+id.z*10.0);
    pos = fract(pos) * 2.0 - 1.0;
    pos *= yrot(iGlobalTime*btime*4.0*dir);
    float s = length(pos.xz);
    float k = atan(pos.z, pos.x);
    float mr = 0.9;
    float r = mix(0.8, 1.0, 0.5 + 0.5 * sin(s/mr*dir*bspeed+k*10.0));
    float p = mr * r;
    float e = 1.0 - s/p;
    vec3 c = vec3(pos.x, clamp(pos.y,-0.02*e, 0.02*e), pos.z);
    return min(max(length(c-pos), s-p), s-0.1);
}

vec3 normal(vec3 p)
{
    vec3 o = vec3(0.01, 0.0, 0.0);
    return normalize(vec3(map(p+o.xyy) - map(p-o.xyy),
                          map(p+o.yxy) - map(p-o.yxy),
                          map(p+o.yyx) - map(p-o.yyx)));
}

float trace(vec3 o, vec3 r)
{
     float t = 0.0;
    for (int i = 0; i < 16; ++i) {
         vec3 p = o + r * t;
        float d = map(p);
        t += d * 0.5;
    }
    return t;
}

float pshade(vec3 p)
{
    vec3 id = floor(p);
    p.y += sin(iGlobalTime+id.x*10.0+id.z*10.0);
    p = fract(p) * 2.0 - 1.0;
    p *= yrot(iGlobalTime*btime*4.0+length(p.xz)*4.0);
    p += id;
    float ac = texture2D(iChannel0, vec2(p.y,p.z)).x;
    float bc = texture2D(iChannel0, vec2(p.x,p.z)).x;
    float cc = texture2D(iChannel0, vec2(p.x,p.y)).x;
    float s = ((ac + bc + cc) / 3.0) * 2.0 - 1.0;
    return s;
}

vec4 surf(vec3 r, vec3 w, vec3 sn, float t)
{
    float prod = max(dot(sn,-r), 0.0);
    float off = 0.5 + 0.5 * sin(pshade(w)*pi*5.0);
    float ao = map(w) * 20.0;
    float fog = prod / (1.0 + t * t + off + ao);
    return vec4(vec3(fog),off);
}

vec3 shade(vec3 r, float time)
{
    r *= xrot(iGlobalTime) * zrot(time);
   
    vec3 o = vec3(0.0, 0.0, 0.0);
    o.z += time;
   
    float t = trace(o, r);
    vec3 w = o + r * t;
    vec3 sn = normal(w);
   
    vec4 ac = surf(r, w, sn, t);
   
    vec3 from = vec3(0.8, 0.2, 0.1);
    vec3 to = vec3(1.0, 1.0, 1.0);
   
    float fx = 1.0 - ac.w;
   
    vec3 mixed = ac.xyz * mix(from, to, fx);
   
    return mixed;
}

void main()
{
    vec2 uv = gl_FragCoord.xy / iResolution.xy;
    uv = uv * 2.0 - 1.0;
    uv.x *= iResolution.x / iResolution.y;
   
    vec3 r = normalize(vec3(uv, 1.0 - dot(uv,uv) * 0.33));

    btime = 2.0;
    bspeed = 10.0;
    vec3 sa = shade(r, iGlobalTime);
   
    float of = 0.01;
   
    btime = 4.0;
    bspeed = 20.0;
    vec3 sb = shade(r, iGlobalTime+of);

    btime = 6.0;
    bspeed = 20.0;
    vec3 sc = shade(r, iGlobalTime+of*2.0);
   
    vec3 f = sa * 0.2 + sb * 0.5 + sc * 0.3;
   
    gl_FragColor = vec4(f,1.0);
}
]]></raw_data_ps>

</gpu_program>

 
    <script name="init_scene" run_mode="INIT" >
        <raw_data><![CDATA[   

app_dir = gh_utils.get_scripting_libs_dir()         
dofile(app_dir .. "lua/Moon3D_v2.lua")

moon3d.init(2, 1)
moon3d.graphics.vsync(0)

bmfont = moon3d.font.create("trebuchet_20px.fnt", "data/")
bmfont_texture = moon3d.font.getTexture(bmfont)
moon3d.madshaders.setBmFontData(bmfont, bmfont_texture)

winW, winH = moon3d.window.getSize()

quad = moon3d.graphics.newQuad(winW, winH)
shadertoy_prog = moon3d.graphics.getGpuProgram("shadertoy_prog")

-- tex0 = moon3d.image.load2d("./data/tex16.png")

moon3d.madshaders.resetBenchmarkData()

        ]]></raw_data>
    </script>

 
    <script name="update_scene" run_mode="FRAME" >
        <raw_data><![CDATA[   

moon3d.startFrame(0, 0, 0, 1)

local global_time = moon3d.getTime()

moon3d.madshaders.updateBenchmarkData(global_time)

moon3d.camera.bindOrtho()

moon3d.graphics.bindGpuProgram(shadertoy_prog)
moon3d.madshaders.updateShadertoyCommonParams(shadertoy_prog, global_time)
--moon3d.madshaders.setShadertoyTexture(shadertoy_prog, tex0, 0)
moon3d.graphics.draw(quad)

moon3d.madshaders.displayBenchmarkInfoV2("Shadertoy/EvilSeed", global_time, 1, 1, 1, 1)

moon3d.endFrame()

        ]]></raw_data>
    </script>
   

    <script name="resize_scene" run_mode="SIZE" >
        <raw_data><![CDATA[   

moon3d.window.resize()
winW, winH = moon3d.window.getSize()
moon3d.graphics.resizeQuad(quad, winW, winH)

        ]]></raw_data>
    </script>
 
</glsl_hacker>


3
The Android M release:  improving the fundamentals

For the M release, we focused on improving the core user experience of Android, from fixing thousands of bugs, to making some big changes to the fundamentals of the platform
...
The M Developer Preview includes an updated SDK with tools, system images for testing on the official Android emulator, and system images for testing on Nexus 5, Nexus 6, Nexus 9, and Nexus Player devices. We are excited to expand the program and give you more time to ensure your apps support M when it launches this fall. 


4
3D-Tech News Around The Web / (WebGL) Star Wars BB8 Droid
« on: May 28, 2015, 06:36:08 PM »
Great use of WebGL to show just how the real Star Wars BB8 Droid works

[via]

Quote
BB-8 is an astromech droid that appears on Star Wars Episode VII - The Force Awakens. It has a ball shaped body and a domed head that resembles that of the R2 series droids, whose most popular unit is R2-D2. BB-8's body rolls independently from the head, which always stays near the vertical axis of the droid.

5
3D-Tech News Around The Web / NVIDIA AndroidWorks 1R1
« on: May 28, 2015, 06:30:52 PM »
NVIDIA AndroidWorks installs all software tools required to develop for Android and reduces the complex process of configuring an Android development system down to a single click. With a full suite of developer tools, AndroidWorks is a professional grade solution designed to provide the best development platform for all Android devices - not only Tegra powered devices.

AndroidWorks 1R1 supports your 32-bit and 64-bit Android application development needs, including the latest Android SDK (24.2.0), NDK (r10d), and NVIDIA Nsight Tegra, Visual Studio Edition 3.0. This latest Nsight Tegra release allows for seamless GDB and JDB remote debugging to all Android devices capable of native application debugging, supporting all Android ABIs – ARM v7, ARM v8, x86. In addition, this release prepares you for development for the latest NVIDIA® SHIELD™ tablet OTA 3.0 and the all-new NVIDIA® SHIELD™ Android TV powered by NVIDIA® Tegra® X1 processor. Full NVIDIA SHIELD support requires latest software updates to enable debugging support. Install the latest Android OTA system updates prior to using the device with AndroidWorks 1R1.

For important information about this release, see the AndroidWorks 1R1 Release Notes.
Archived versions available here.   

 More Information

6
3D-Tech News Around The Web / Catzilla 1.4 released
« on: May 27, 2015, 08:13:38 PM »
Quote
Catzilla 1.4   

Created on 2015-05-26,

 Application:
  • Correct detection of the latest graphics cards and processors:
- NVIDIA GeForce GTX 870 and 880 (GM204)
 - AMD Radeon R9 285
 - NVIDIA GeForce GTX 970 and GTX 980
 - NVIDIA GeForce GTX 960 and GM206
 - NVIDIA GeForce GTX TITAN X
  • Fixed reporting of memory clock on Haswell-E/EN/EP/EX
  • Improved DDR4 support
  • Enhanced support of CPUs with more than 256 logical cores
  • Enhanced reporting of memory timings and other features for Skylake
  • Many more games for "Check Game" option

7
3D-Tech News Around The Web / TechPowerUp GPU-Z v0.8.3
« on: May 27, 2015, 07:07:53 PM »
GPU-Z is a lightweight utility designed to provide you with all information about your graphics card and GPU. 

 Version History 0.8.3
  • Added VGA BIOS UEFI support indicator
  • Added support for NVIDIA GTX 980 Ti, GTX 965M, GTX 950M, NVS315, GT 750 (GK106)
  • Added support for AMD Fiji, Radeon R2/R3 Graphics (Mullins APU)
  • Added support for various Intel Broadwell SKUs
  • Fixed missing NVIDIA PerfCap sensor in some cases
  • Added support for HBM memory
  • Fixed GT200B die size
  • Fixed some NV42 specs
  • Improved OpenCl detection code

30b.png

8
3D-Tech News Around The Web / MSI Afterburner 4.1.1 Final
« on: May 27, 2015, 05:09:26 PM »
Quote
MSI Afterburner 4.1.1 Official Download
- Guru3D and MSI have been working hard on AfterBurner, today we release an updated this revision of Afterburner, this application successfully secured the leading position on graphics card utilities.
...
Prior to installation please be sure to uninstall your old version of AfterBurner. For Version 4.1.0 AfterBurner received a complete overhaul. That way you can select new skins.

3 year old remote server still works fine.


9
Game Performance: Geometry Instancing

...Rendering a lot of meshes is desired to create a beautiful scene like a forest, a cheering crowd or an army, but doing so is quite costly and reduces the frame rate. Fortunately this is possible using a simple technique called Geometry Instancing.

Submitting draw calls causes OpenGL to queue commands to be sent to the GPU, this has an expensive overhead which may affect performance. This overhead grows when changing states such as alpha blending function, active shader, textures and buffers.
Geometry Instancing is a technique that combines multiple draws of the same mesh into a single draw call, resulting in reduced overhead and potentially increased performance. This works even when different transformations are required.
Geometry instancing can be used in 2D games for rendering a large number of sprites, or in 3D for things like particles, characters and environment.
...
If you are drawing the same mesh multiple times in a frame make sure to implement Geometry Instancing in your pipeline! This can greatly reduce overhead and improve performance.

10
One of the new features in Unity 5.1 is a new unified OpenGL rendering backend.
...Until now, we had a separate renderer for OpenGL ES 2.0, one for OpenGL ES 3.0 (that shared a good deal, but not all, code with ES 2.0) and then a completely different one for the desktop OpenGL (that was stuck in the OpenGL 2.1 feature set). This, of course, meant a lot of duplicate work to get new features in, various bugs that may or may not happen on all renderer versions etc.
So, in order to get some sense into this, and in order to make it easier to add features in the future, we created a unified GL renderer. It can operate in various different feature levels, depending on the available hardware...

11
Blender 2.75 Testbuild Now Available

The Blender Foundation has released the first testbuild of Blender 2.75 and is asking everyone to help test it.

We are finishing work on a massive 2.75 release. A first testbuild is available now! Please help testing it and report issues to the bug tracker.
Among new features are AMD OpenCL rendering and stereo/multiview support!

12
3D-Tech News Around The Web / (Demoscene) Simulaatio 2015
« on: May 25, 2015, 02:54:38 PM »
Simulaatio 2015

On Android use RAR and Firefox Nightly to run the JavaScript demos.




13
3D-Tech News Around The Web / (Shadertoy) Round-up May 2015
« on: May 24, 2015, 06:03:50 PM »
My personal favorites this month.
All running on Nexus 4 , AMD Zacate APU and NVIDIA Maxwell

PBR_Test
Hyper dodecahedron
Anti menger sphere sponge
38911 BASIC Bytes free
Emerging redux
Evil seed
Magnetismic

and the oldie Fractal land [via]




15
Heat snakes - fun with diffusion shaders!

"A WebGL diffusion simulation with added visual touches."

[via]



Mobile devices are currently not supported


16
Test Driver for HDMI Display Detection Issues

In an ongoing effort to resolve HDMI display detection some users are experiencing, we are releasing a set of test drivers for Sandybridge, Ivybridge, Haswell, and Broadwell based graphics to gather feedback from the Intel Communities on resolving these issues. Some users have been able to resolve this issue by changing the display cable however, this may not solve the issue in all cases. These test drivers provide another option to address this issue.

These test drivers are exactly that, test drivers, and only for testing the HDMI display detection issues. Please be aware that these drivers should not be used on mission critical systems and that we recommend a restore point be created on your system before installing these test drivers.

These test drivers can be installed by extracting the zip file and running the setup.exe file or by using the "Have Disk" method to install.

According to the license agreement, these test drivers are provided "as is" and are not supported by Intel Technical Support or any other department at Intel.

Issues related or due to these drivers are not supported by Intel® Technical Support. However, we at Intel appreciate your feedback in this matter.  Please post all feedback to this thread.

All versions of this test driver can be downloaded here: http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=24955 

17
Renders a few frames on AMD Zacate APU, then runs out of memory (i guess) and GPU resets.




On my NVIDIA rig i had to rollback GeForce driver to a version using CUDA 6.x
Check out CUDA 7.0 unsupported and deprecated features


18
3D-Tech News Around The Web / NVIDIA GeForce Hotfix driver 353.00
« on: May 23, 2015, 05:59:42 AM »
Quote
GeForce Hotfix driver 353.00

This is a GeForce Hot Fix driver, version 353.00 that addresses the following issues:
 
  • Fixes a regression that prevented overclocking the GPU on some GeForce Notebooks
Click the appropriate link to download.
32 bit Notebook
64 bit Notebook
 
NOTE: This hotfix driver is only for GeForce Notebooks. There are no changes pertinent to desktop GPUs.

Yet it contains installers for all GPUs

Note: this driver causes a bootlopp under Vista.

Don't try it unless you know how to boot in safe mode and use system restore points.

19
Birdie 2015

Outline 2015

qbparty 2015


I would have tested more JavaScript demos on my smartphone, if there were live versions instead of archives.


20
Introducing HBM, a new type of memory chip with low power consumption, ultra-wide communication lanes and a revolutionary new stacked configuration. HBM’s vertical stacking and fast information transfer open the door for truly exciting performance in innovative form factors. And GPU applications are just the start – look for HBM’s superior power efficiency and space savings to spark industry-wide innovation.


Pages: [1] 2 3 ... 152