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.


Topics - Stefan

Pages: 1 2 [3] 4 5 ... 145
41
3D-Tech News Around The Web / Intel Graphics driver v4229 for SNB/IVB
« on: June 05, 2015, 09:36:53 AM »
Fresh drivers for your "old" iGPUs

Download from MS update:

64bit

32bit

Quote
DriverVer=05/26/2015,9.17.10.4229
 %iSNBGM1%  = iSNBM0, PCI\VEN_8086&DEV_0106
 %iSNBGD1%  = iSNBD0, PCI\VEN_8086&DEV_0102
 %iSNBGM2%  = iSNBM0, PCI\VEN_8086&DEV_0116
 %iSNBGD2%  = iSNBD0, PCI\VEN_8086&DEV_0112
 %iSNBGM2P%  = iSNBM0, PCI\VEN_8086&DEV_0126
 %iSNBGD2P% = iSNBD0, PCI\VEN_8086&DEV_0122
 %iSNBGD3%  = iSNBD0, PCI\VEN_8086&DEV_010A
 %iIVBGD0%       = iIVBD0, PCI\VEN_8086&DEV_0162
 %iIVBGM0%       = iIVBM0, PCI\VEN_8086&DEV_0166
 %iIVBGD0SRV%    = iIVBD0, PCI\VEN_8086&DEV_016A
 %iIVBGD0GT1%    = iIVBD0, PCI\VEN_8086&DEV_0152
 %iIVBGM0GT1%    = iIVBM0, PCI\VEN_8086&DEV_0156
 %iIVBGD0SRVGT1% = iIVBD0, PCI\VEN_8086&DEV_015A

42
  Are You Running Out of Video Memory? Detecting Video-Memory Overcommitment using GPUView          

By Louis Bavoil,  Tags : GameWorks, GameWorks Expert Developer

While developing and playing PC games on Windows/WDDM, it is common for stuttering (uneven frame times) to start happening when enabling graphics features or increasing the screen resolution. There are a lot of possible root causes for stuttering; one of the most common is video-memory overcommitment which happens when an application is using more video memory than is physically available on the GPU. In this article, I will describe a method we have been using at NVIDIA to determine whether video-memory overcommittement is happening and is causing any stuttering on Windows Vista, 7, 8 or 8.1. (The method described in this article may not apply to Windows 10/WDDMv2, which has a different memory residency model.)

43
AMD Catalyst™ 15.5 Proprietary Linux x86 Display Driver

Linux Distributions Supported

This version of the AMD Catalyst™ Linux Proprietary Graphics Driver is designed to support the following Linux distributions:
Distributions supported:
    • Red Hat Enterprise Linux Suite 7.0, 6.5, 6.4
    • Ubuntu 12.04.4 LTS, 14.04 LTS
    • SUSE® Linux Enterprise 11 SP3, 12
    • OpenSuSE 13.1
Distribution specific packages are available for:
    • Red Hat Enterprise Linux Suite 7.0, 6.5
    • Ubuntu 12.04.4 LTS, 14.04 LTS
New Features
    • Support for SUSE® Linux Enterprise Desktop 12
Resolved Issues
    • [417630]: Fixes the issue of discrete GPU not being powered off in Power-Saving mode on some PowerXpress AMD GPU + AMD APU platforms
    • [416499]: Fixes minor screen corruption when resuming from S3 caused by display hot plugging
Known Issues
    • [419960]: Vari-Bright on some configurations is not decreasing brightness as expected

44
English forum / Nano Tubes converted
« on: June 03, 2015, 04:36:01 PM »
Nano Tubes converted to GLSL Hacker format

Copy the code and save as nano_tubes_gl2.xml in demo folder of MadShaders.

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

<glsl_hacker>
   
  <window name="win3d01" title="MadShaders - Shadertoy/Nano Tubes"
          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/lslGRH

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;



//

// With tweaks from fernlightning

float rand(vec3 n) {
  n = floor(n);
  return fract(sin((n.x+n.y*1e2+n.z*1e4)*1e-4)*1e5);
}

// .x is distance, .y = colour
vec2 map( vec3 p ) {
    const float RADIUS = 0.25;

    // cylinder
    vec3 f = fract( p ) - 0.5;
    float d = length( f.xy );
        float cr = rand( p );
    float cd = d - cr*RADIUS;

    // end - calc (rand) radius at more stable pos
    p.z -= 0.5;
    float rr = rand( p );
    float rn = d - rr*RADIUS;
    float rm = abs( fract( p.z ) - 0.5 );  // offset so at end of cylinder
       
    float rd = sqrt( rn*rn + rm*rm ); // end with ring

    return (cd < rd) ?  vec2( cd, cr ) : vec2( rd, rr ); // min
}

void main()
{
    vec2 pos = (gl_FragCoord.xy*2.0 - iResolution.xy) / iResolution.y;
    vec3 camPos = vec3(cos(iGlobalTime*0.3), sin(iGlobalTime*0.3), 3.5);
    vec3 camTarget = vec3(0.0, 0.0, .0);

    vec3 camDir = normalize(camTarget-camPos);
    vec3 camUp  = normalize(vec3(0.0, 1.0, 0.0));
    vec3 camSide = cross(camDir, camUp);
    float focus = 1.8;

    vec3 rayDir = normalize(camSide*pos.x + camUp*pos.y + camDir*focus);
    vec3 ray = camPos;
    float m = 0.32;
    vec2 d;
    float total_d = 0.;
    const int MAX_MARCH = 100;
    const float MAX_DISTANCE = 100.0;
    for(int i=0; i<MAX_MARCH; ++i) {
        d = map(ray-vec3(0.,0.,iGlobalTime/2.));
        total_d += d.x;
        ray += rayDir * d.x;
        m += 1.0;
        if(abs(d.x)<0.01) { break; }
        if(total_d>MAX_DISTANCE) { total_d=MAX_DISTANCE; break; }
    }

    float c = (total_d)*0.0001;
    vec4 result = vec4( 1.0-vec3(c, c, c) - vec3(0.025, 0.025, 0.02)*m*0.8, 1.0 );
    gl_FragColor = result*d.y;
}


//

]]></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/Nano Tubes", 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>


45
English forum / The Institute converted
« on: June 03, 2015, 04:24:15 PM »
The Institute converted to GLSL Hacker format

Copy the code and save as the_institute_gl2.xml in demo folder of MadShaders.

Works fine with NVIDIA Maxwell, but fails to compile with my old AMD APU.




46
Version 5.3.5

Release: 6/1/2015
 
  • Full OSD support for Microsoft DirectX 12
  • Redesigned OSD interface
  • Adds ability to change OSD color
  • Fix Grand Theft Auto V incorrect FPS
  • Supports GTX 980 Ti
  • Various other bug fixes

47
3D-Tech News Around The Web / NVIDIA NVFLASH 5.221
« on: June 01, 2015, 06:20:07 PM »
download here

adds support for:

GRID M60 Service Provider   
Tesla M6   
GTX 980 Ti (D17U-20)


Quote
NVIDIA Firmware Update Utility (Version 5.221)
Simplified Version For OEM Only

Save firmware to file:      nvflash [options] --save <filename>
Display version:            nvflash [options] --version [<filename>]
Check for supported EEPROM: nvflash [options] --check
List adapters:              nvflash [options] --list
Write protect EEPROM:       nvflash [options] --protecton
Remove write protect:       nvflash [options] --protectoff

-- Commands and Options --
help        ?                 Display this screen.
save        b <filename>      Read EEPROM and save to <filename>.
compare     k <filename>      Read EEPROM and compare with <filename>.
verify      h <filename>      Verify <filename> matches EEPROM if flashed.
version     v <filename>      Display file version and ~CRC32
                              (if no filename, acts on display adapter).
                             
check       c                 Check for supported EEPROM.
list        a                 List all NVIDIA display adapters found in the
                              system.
                             
protecton   w                 Write protect EEPROM (only on some EEPROM's).
protectoff  r                 Remove EEPROM write protect (only on some
                              EEPROM's).
                             
license       <license file>  Provide a HULK <license file>.
licinfo                       Display HULK license content. HULK is provided
                              by --license option.
                             
ecid                          Display GPU ECID.
lspci                         List all the PCI devices in the system.
setpci        <R.W>[=D[:M]]   Read/Write PCI Config register.
    Format is: <REG.WIDTH>[=DATA[:MASK]]
    Read  operation: <REG.WIDTH>
    Write operation: <REG.WIDTH>=DATA[:MASK]
                             
proggmac      <filename>      Flash the application image to GMAC MCU.
savegmac      <filename>      Read back the GMAC application image and
                              save to <filename>.
                             
listgmac                      List all the GMAC devices in the system
querygmac     [<filename>]    Display the GMAC application version
                              (if no filename, acts on display adapter).
                             
upgradeonly                   Only allow upgrading of firmware based on
                              version.
                             
overridesub 6                 Allow firmware and adapter PCI subsystem ID
                              mismatch.
                             
index       i <index>         Force a specific device index.
pcisegbus   B [<seg#>:]<bus#> Select a specific device by using a specified
                              segment# and bus#. The following format
                              is allowed, <seg#>:<bus#>:<dev#>.<func#>.
                              All numbers are hexadecimal. The segment#
                              can be optional, and has a default value(0)
                              if no input value.The dev# and the func#
                              can be omitted for the --pcisegbus command.
                             
auto        A                 When possible, run without user intervention.
silence     s                 Silence all audio beeps.
beep        !                 Beep to signal updating progress.
nolight     l                 Do not light keyboard LEDs.
override    o <level>         Override safety check level:
   default  unknown EEPROM | NV adapter aborts application.
   level=1  unknown EEPROM acceptable for read operations.
   level=2  unknown NV adapter acceptable for read operations.
   level=3  Combined effect of 1,2 (cannot write to unknown EEPROM or adapter).
                             
log         L <log file>      Create a log file.
nopowerchk  p                 Skip power level check.
offswdriver S                 Turn off automatic switch driver state.

Use a single dash ("-") to use the single letter version of a command.
Use a double dash ("--") to use the longer descriptive version of a command.
Use equals ("=") to specify parameters, with separating commas (",").

-- Sample Usage --
nvflash --index=1 nv30nz.rom

48
English forum / Hyperlepsy converted
« on: June 01, 2015, 05:09:46 PM »
Hyperlepsy converted to GLSL Hacker format

Copy the code and save as Hyperlepsy_gl2.xml

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

<glsl_hacker>
   
  <window name="win3d01" title="MadShaders - Shadertoy/Hyperlepsy"
          width="1024" height="1024"
          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/4lB3WV

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;



//

//Hyperlepsy by nimitz (twitter: @stormoid)

/*
    Mostly about Volumetric field/geometry interaction.
    Tried to provide links for the other individual
    techniques being used whenever possible.

    Runs a bit slower than what I like to go for, but
    I wasn't willing to compromise too much on the look.

    No idea is the VR is working properly, let me know.
*/

//30 Steps looks good here
#define VOLSTEPS 25

//#define SIMPLE_PRIMITIVE

#define ITR 100
#define FAR 20.
#define time iGlobalTime

const vec3 luma = vec3(0.2126, 0.7152, 0.0722);  //BT.709

vec3 rotx(vec3 p, float a){
    float s = sin(a), c = cos(a);
    return vec3(p.x, c*p.y - s*p.z, s*p.y + c*p.z);
}
vec3 roty(vec3 p, float a){
    float s = sin(a), c = cos(a);
    return vec3(c*p.x + s*p.z, p.y, -s*p.x + c*p.z);
}
vec3 rotz(vec3 p, float a){
    float s = sin(a), c = cos(a);
    return vec3(c*p.x - s*p.y, s*p.x + c*p.y, p.z);
}

//You can actually make a cheaper tetrahedron using 3 dot products,
//but the alignments isn't ideal..
float tetr(vec3 p)
{
    const vec2 e = vec2(0.57735, -.57735);
    float d =  dot(p, e.yxx);
    d = max(d, dot(p, e.yyy));
    d = max(d, dot(p, e.xxy));
    d = max(d, dot(p, e.xyx));
    return d;
}

//Some displacement functions
float tri(in float x){return abs(fract(x)-0.5)-.25;}
float trids(in vec3 p)
{   
    return max(tri(p.z),min(tri(p.x),tri(p.y)))*.1;
}

float trids2(in vec3 p)
{   
    return tri((p.x*1.+1.5*tri(p.z+tri(p.y))) )*.02;
}

//See unlisted shader: https://www.shadertoy.com/view/ltBGDD
float expOut(in float t, in float n)
{
    float a = 1. + 1./(exp2(n) - 1.);
    float b = log2(a);
    return a - exp2(-n*t + b);
}

//----------------------------------------------------------------------------------------------------
//Knots from knighty
//http://www.fractalforums.com/new-theories-and-research/not-fractal-but-funny-trefoil-knot-routine/
//----------------------------------------------------------------------------------------------------
#define tau 6.2831853
const float groupRadius = .74;
const float objectRadius = 1.1;
const float RotNumeratorX = 3.;
const float RotNumeratorY = 3.;
const float RotDenominator = 2.;

float twist(in vec3 p)
{
    vec3 q=  p;
    float ra = p.z*RotNumeratorX/RotDenominator;
    float raz = p.z*RotNumeratorY/RotDenominator;
   
    p.xy -= vec2(groupRadius*cos(ra)+objectRadius, groupRadius*sin(raz)+objectRadius);
    p.z += time*2.;
   
    float ctau = 1.5;
    float id = floor(p.z*ctau);
    p.z = fract(p.z*ctau)/ctau-0.33;
    p = rotx(p,id*2.+time*8.);
    float prm = tetr(p);
    float d = prm-0.1;
    d = max(-d, prm-0.2);
   
    return d+trids(p)*2.4  + trids2(p*6.)*0.25;
}

//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------

float map(vec3 p)
{
    p = rotx(p,expOut(sin(time*1.,1.1));
    p = roty(p,-expOut(sin(-time*1.5),1.));
   
    #ifndef SIMPLE_PRIMITIVE
    float r = length(p.xz);
    float a = atan(p.z,p.x);
    float d = 10.;
    for(int i=0;i<2;i++)
    {
        vec3 p = vec3(r, p.y, a+tau*float(i));
        p.x -= objectRadius;
        d = min(d, twist(p));
    }
   
    p *= .85;
    p = rotz(p,2.+time*1.7);
    r = length(p.xz);
    a = atan(p.z,p.x);
    a += 1.2;
    for(int i=0;i<2;i++)
    {
        vec3 p = vec3(r, p.y, a+tau*float(i));
        p.x -= objectRadius;
        d = min(d, twist(p)*(1./.85));
    }
   
    return d;
    #else
    p = rotx(p,time*2.);
    return (length(p)-2.)+trids(p*1.)*4. + trids2(p*3.)*0.3;
    #endif
}

float march(in vec3 ro, in vec3 rd)
{
    float precis = 0.001;
    float h=precis*2.0;
    float d = 0.;
    for( int i=0; i<ITR; i++ )
    {
        if( abs(h)<precis || d>FAR ) break;
        d += h;
        float res = map(ro+rd*d);
        h = res;
    }
    return d;
}

//iq's ubiquitous 3d noise
float noise(in vec3 p)
{
    vec3 ip = floor(p);
    vec3 f = fract(p);
    f = f*f*(3.0-2.0*f);
   
    vec2 uv = (ip.xy+vec2(37.0,17.0)*ip.z) + f.xy;
    vec2 rg = texture2D( iChannel0, (uv+ 0.5)/256.0, -100.0 ).yx;
    return mix(rg.x, rg.y, f.z);
}

float fbm3(in vec3 p)
{
    p*=5.;
    p.x *= .18;
       p.x += time*7.7;
    float a = 0.0;
    float z = .5;
    vec3 d = vec3(0.);
    for( int i=0; i<3; i++ )
    {
        float n = noise(p);
        a += (n-.5)*z;
        z *= .47;
        p *= 2.8;
    }
    return a;
}

float mapV(in vec3 p)
{
    float mp = map(p);
       p = mix(p, p/(-(mp+1.)),.35+(sin(time*2.+sin(time))*0.15));
    return fbm3(p)*clamp(2.3-mp*2.2, 0.65, 1.7);
}

vec4 vmarch(in vec3 ro, in vec3 rd, in float sceneDist)
{
    sceneDist = min(sceneDist, 15.);
    vec4 rz = vec4(0);
    const float smt = 3.;
    float t = 5.5;
    for(int i=0; i<VOLSTEPS; i++)
    {
        if(rz.a > 0.99 || t > sceneDist)break;

        vec3 pos = ro + t*rd;
        float den = mapV(pos);
        vec3 lcol = mix(vec3(.5,1,.9),vec3(.5,.7,1.),noise(pos*1.));
        vec4 col = vec4(lcol*den, den);
        col.a *= 1.1;
        col.rgb *= col.a;
        col *= smoothstep(t-smt, t + smt, sceneDist); //Blend with scene geometry
        rz = rz + col*(1. - rz.a); //front to back blending
       
        t += clamp(.2 - den*0.15, 0.2 ,5.);
    }
    rz = clamp(rz,0.,1.);
    return rz*rz;
}

vec3 lgt = normalize( vec3(.5, 0.8, 0.2) );

//see: https://www.shadertoy.com/view/Xts3WM
vec3 norcurv(in vec3 p, out float curv)
{
    vec2 e = vec2(-1., 1.)*0.009;   
    float t1 = map(p + e.yxx), t2 = map(p + e.xxy);
    float t3 = map(p + e.xyx), t4 = map(p + e.yyy);

    curv = clamp(.002/(e.x*e.x) *(t1 + t2 + t3 + t4 - 4. * map(p)),0.,1.);
    return normalize(e.yxx*t1 + e.xxy*t2 + e.xyx*t3 + e.yyy*t4);
}

struct mtl{float rough; vec3 alb; vec3 f0;};
   
//http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf
vec3 shade(in vec3 pos, in vec3 rd)
{
    float crv;
    vec3 nor = norcurv(pos, crv);
    mtl m;
    m.alb = vec3(.1,0.8,0.;
    m.rough = 0.3;
    m.f0 = vec3(.95, 1., 1.);
   
    float nl = clamp(dot(nor,lgt), 0., 1.);
    vec3 col = vec3(0.);
   
    vec3 lcol = mix(vec3(.5,1,1),vec3(.5,.8,1.),noise(pos*2.));
   
    if (nl > 0.)
    {
        vec3 haf = normalize(lgt - rd);
        float nh = clamp(dot(nor, haf), 0., 1.);
        float nv = clamp(dot(nor, -rd), 0., 1.);
        float lh = clamp(dot(lgt, haf), 0., 1.);
        float a = m.rough*m.rough;
        float a2 = a*a;
        float dnm = nh*nh*(a2 - 1.) + 1.;
        float D = a2/(3.14159*dnm*dnm);
        float k = pow(m.rough + 1., 2.)/8.; //hotness reducing
        float G = (1./(nl*(1. - k) + k))*(1./(nv*(1. - k) + k));
        vec3 F = m.f0 + (1. - m.f0) * exp2((-5.55473*lh - 6.98316) * lh); //"optimization"
        vec3 spec = nl*D*F*G;
        col = lcol*nl*(spec*((crv*vec3(0.1,.5,.)+0.05) + m.alb*(1. - dot(m.f0,luma)));
    }

    return col;
}

vec3 render(in vec3 ro, in vec3 rd)
{   
    vec3 bgcol = mix(vec3(.1,1,.,vec3(.1,.8,1.),noise(rd*2.+time));
    vec3 col = .004/clamp(fbm3(rd*3.*vec3(.5,1.,.3))+.31,0.,1.)*bgcol; //bg
    float rz = march(ro,rd); //march
   
    if ( rz < FAR ) col = shade(ro +rd*rz, rd);
   
    col = pow(clamp(col,0.,1.), vec3(0.416667))*1.055 - 0.055; //gamma
   
    vec4 rez = vmarch(ro,rd,rz); //volumetric stepping
    col.rgb += rez.rgb;
   
    col *= sin(gl_FragCoord.y*350.+time)*0.1+1.;//Scanlines
    col *= sin(gl_FragCoord.x*350.+time)*0.1+1.;
   
    col *= smoothstep(1.4,0.85,length((gl_FragCoord.xy/iResolution.xy*2.-1.)*vec2(.85,1.)));
   
    return col*1.;
}

void main()
{   
    vec2 p = gl_FragCoord.xy/iResolution.xy-0.5;
    p.x*=iResolution.x/iResolution.y;
    vec2 mo = iMouse.xy / iResolution.xy-.5;
    mo = (mo==vec2(-.5))?mo=vec2(0.,0.):mo;
    mo.x *= iResolution.x/iResolution.y;
    mo*=2.;
   
    //camera
    vec3 ro = vec3(0.,0.,10.);
    vec3 rd = normalize(vec3(p,-1.5));
    rd = rotz(rd,-0.5);
    ro = rotx(ro,mo.y), rd = rotx(rd,mo.y);
    ro = roty(ro,mo.x), rd = roty(rd,mo.x);
   
    //shake (only fpor non-vr)
    float dsp = texture2D(iChannel0,vec2(time*10.)).x;
    rd.y += dsp*.02;
    ro.y += dsp*.02;
   
    vec3 col = render(ro, rd);
   
    gl_FragColor = vec4( col, 1.0 );
}

void mainVR(out vec4 gl_FragColor, in vec2 gl_FragCoord, in vec3 fragRayOri, in vec3 fragRayDir)
{
     vec3 ro = fragRayOri + vec3(0., 0., 10.);
    vec3 col = render(ro, fragRayDir);
   
    gl_FragColor = vec4( col, 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/Hyperlepsy", 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>


49
English forum / Sharbat Gula converted
« on: June 01, 2015, 04:55:05 PM »
Sharbat Gula converted to GLSL Hacker format.

Study the fragment shader before you confuse this demo with a photo.

Copy the code and save as Sharbat_Gula_gl2.xml

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

<glsl_hacker>
   
  <window name="win3d01" title="MadShaders - Shadertoy/Sharbat Gula"
          width="1024" height="1024"
          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/XslSRs

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;



//

// https://www.shadertoy.com/view/XslSRs
// By David Hoskins.

// Sharbat Gula. Iconic image from 1984.
// Afghan Girl is an award-winning photograph by journalist Steve McCurry.
// http://en.wikipedia.org/wiki/Afghan_Girl

// Genetic algorithm. Over 1.3M random generations with 64000 chosen iterations
// to home in on the original image.
// Overlapping transparencies of 256 triangles with moving dither.

// On Windows this will only work in the latest Chrome browser (36.0+).
// (Hopefully, anyway)

// Add noise to the triangles to make it a little clearer...
#define ADD_DITHER

// Fade in the dither for a nice effect. It may over stress your computer...
//#define FADE_IN_DITHER

vec3 col = vec3(0.0);
vec2 uv;
const vec2 INV_SCALE  = 1.0 / vec2(509.0, 509.0*450.0/800.0);
vec2 fcoord;

//========================================================================
#ifdef ADD_DITHER
#ifdef FADE_IN_DITHER
vec2 randValues = vec2(0.01, 0.005) * (1.0+smoothstep(3.0, 0.0, iGlobalTime*.5)*20.0);
#else
const vec2 randValues = vec2(0.01, 0.005);
#endif
vec2 Hash2( vec2 x )
{
    float n = dot(x,vec2(1.12313,113.94871)) + iGlobalTime;
    return fract(sin(n)*vec2(3758.5233,2578.1459));
}
#endif

//========================================================================
vec2 unpackCoord(float f)
{
    // Needs a 'modf', but sadly no...
    return vec2(mod(f, 512.0),floor(f / 512.0)) * INV_SCALE;
}

//========================================================================
vec2 unpackColour(float f)
{
    return vec2(mod (f, 256.0),floor(f / 256.0)) / 256.0;
}

//========================================================================
void Tri(float pA, float pB, float pC, float pCol1, float pCol2)
{
    vec2 pos = uv;
    vec2 a = unpackCoord(pA);
    vec2 b = unpackCoord(pB);
    vec2 c = unpackCoord(pC);
#ifdef ADD_DITHER
    pos += Hash2(fcoord.xy) * randValues.x - randValues.y;
#endif

    // Triangle test...
    vec2 as = pos-a;
    vec2 bs = pos-b;
    if  ( (b.x-a.x)*as.y-(b.y-a.y)*as.x > 0.0 &&
          (a.x-c.x)*as.y-(a.y-c.y)*as.x > 0.0 &&
          (c.x-b.x)*bs.y-(c.y-b.y)*bs.x > 0.0)
    {
        vec2 c1 = unpackColour(pCol1);
        vec2 c2 = unpackColour(pCol2);
        if (c2.y > .24-iGlobalTime*.025)
            col = mix (col, vec3(c1.x, c1.y, c2.x), c2.y);
    }
}

//========================================================================
void main()
{
    fcoord = gl_FragCoord;
    uv = gl_FragCoord.xy / iResolution.xy;
   
    // Packed data parameters:
    // Tri( X1/Y1, X2/Y2, X3/y3, RG, BA)
   
    Tri(23490., 94141.,23995., 49878., 12444.);
    Tri(76159., 29968.,31048., 64508., 15285.);
    Tri(87417., 64563.,10556., 6177., 12319.);
    Tri(52228., 28672.,-289., 13265., 7723.);
    Tri(20242., -206.,121180., 42712., 12693.);
    Tri(101054., 35554.,39155., 42192., 12656.);
    Tri(33., -194.,88278., 10921., 10801.);
    Tri(39628., 41723.,107893., 50936., 11349.);
    Tri(63293., 41787.,86907., 64761., 14838.);
    Tri(68248., 25395.,80775., 17556., 10042.);
    Tri(145317., 70073.,83919., 59583., 15281.);
    Tri(90276., 20319.,84365., 31188., 10039.);
    Tri(82813., 59254.,77192., 40898., 14731.);
    Tri(44579., 9424.,24769., 11946., 12101.);
    Tri(75328., 23723.,92304., 16128., 11808.);
    Tri(77644., 111575.,112088., 34770., 10628.);
    Tri(72823., 76953.,98438., 6509., 10252.);
    Tri(53687., 434.,53193., 65022., 15357.);
    Tri(42941., -1.,49609., 47459., 14240.);
    Tri(30837., 16948.,119., 18007., 8777.);
    Tri(94071., 92535.,35195., 60385., 14834.);
    Tri(80182., 139190.,144657., 16476., 9532.);
    Tri(15434., 102451.,37888., 2147., 14339.);
    Tri(46079., 97108.,76173., 2305., 11026.);
    Tri(146527., 88106.,146539., 954., 9219.);
    Tri(55226., 43978.,100802., 54266., 15269.);
    Tri(21312., 33473.,14143., 22945., 14481.);
    Tri(57616., 41221.,94607., 4354., 14851.);
    Tri(3626., -472.,-461., 24531., 10873.);
    Tri(73147., 95233.,80130., 42702., 3561.);
    Tri(61643., 53477.,64247., 46839., 11949.);
    Tri(30976., 37151.,90325., 47102., 15010.);
    Tri(73014., 78193.,81784., 63229., 15354.);
    Tri(15506., 29756.,13436., 16722., 14422.);
    Tri(100618., 98490.,88751., 30957., 14129.);
    Tri(78739., 91883.,82658., 44649., 11633.);
    Tri(119168., 142569.,130280., 16480., 9540.);
    Tri(137451., 136168.,137458., 37266., 12404.);
    Tri(37746., 71052.,17239., 63998., 15340.);
    Tri(16603., 34129.,36175., 51688., 9966.);
    Tri(87200., 132157.,31355., 16966., 15152.);
    Tri(119189., 83534.,119704., 27007., 9109.);
    Tri(18164., 16136.,129808., 63740., 11907.);
    Tri(53110., 79671.,35695., 41905., 15188.);
    Tri(40448., 92221.,64527., 25171., 13103.);
    Tri(106242., 80647.,58143., 63730., 15089.);
    Tri(59721., 63292.,15692., 61395., 14060.);
    Tri(95628., 37049.,81789., 60151., 8616.);
    Tri(22296., 9460.,2299., 52165., 10381.);
    Tri(37503., 68381.,106327., 2576., 15112.);
    Tri(119069., 84363.,137504., 30393., 13182.);
    Tri(25788., 20611.,-286., 33259., 14455.);
    Tri(71817., 24648.,37664., 1551., 14085.);
    Tri(19370., 17839.,16818., 41706., 10009.);
    Tri(115470., 77999.,65703., 24256., 9034.);
    Tri(88898., 17713.,22878., 58869., 15279.);
    Tri(103681., 2108.,3135., 32543., 9969.);
    Tri(86458., 46169.,76228., 3369., 11033.);
    Tri(131912., 76083.,104321., 52989., 15230.);
    Tri(48964., 126316.,42649., 31982., 7993.);
    Tri(127301., 97640.,130904., 48360., 9603.);
    Tri(95403., 23803.,106195., 18582., 12857.);
    Tri(124435., 145780.,124435., 34932., 10009.);
    Tri(84006., 16862.,18406., 3329., 8217.);
    Tri(7252., 74071.,73043., 65269., 14578.);
    Tri(127209., 126534.,126537., 29289., 8815.);
    Tri(119069., 24788.,27392., 61436., 5333.);
    Tri(42245., 22851.,48415., 54526., 14266.);
    Tri(132419., 143109.,27890., 56564., 7854.);
    Tri(42547., 33334.,18168., 13470., 9517.);
    Tri(96616., 118103.,95544., 64504., 15270.);
    Tri(113647., 114162.,62661., 32442., 14328.);
    Tri(32201., -87.,-49., 509., 11529.);
    Tri(69028., 53149.,30139., 1931., 10787.);
    Tri(23757., 121554.,37554., 47051., 4424.);
    Tri(86855., 88894.,18762., 65278., 15050.);
    Tri(141800., 140962.,140967., 56572., 9214.);
    Tri(82100., 69854.,100062., 63738., 2781.);
    Tri(82468., 49670.,77358., 64568., 15214.);
    Tri(67399., 84807.,52019., 47598., 14750.);
    Tri(66937., 22303.,21801., 62716., 9948.);
    Tri(39371., 84933.,-83., 28639., 13915.);
    Tri(75083., 98700.,73021., 9509., 14891.);
    Tri(146943., 146828.,53190., 50160., 9541.);
    Tri(45216., 53941.,74392., 28158., 4145.);
    Tri(125524., 75973.,115563., 256., 14592.);
    Tri(15702., 71565.,73530., 59646., 15291.);
    Tri(286., -196.,30570., 48850., 12729.);
    Tri(99825., 99312.,14000., 1546., 15114.);
    Tri(132027., 146851.,53153., 5775., 13070.);
    Tri(-264., -196.,91000., 58622., 14999.);
    Tri(107327., 130888.,88767., 35791., 8868.);
    Tri(2559., 41455.,131487., 45351., 10585.);
    Tri(41109., 18270.,46815., 3155., 14855.);
    Tri(34159., 79243.,21631., 41186., 12376.);
    Tri(81596., 81594.,115111., 35466., 14205.);
    Tri(8421., 1306.,49878., 16987., 14362.);
    Tri(51629., 33187.,72142., 16764., 15176.);
    Tri(15871., 73648.,-2., 54098., 14270.);
    Tri(109748., 49434.,114366., 546., 10761.);
    Tri(62957., 74212.,79328., 59306., 10171.);
    Tri(92671., 146943.,82904., 29606., 15165.);
    Tri(41119., 33444.,53239., 3357., 10499.);
    Tri(119125., 105681.,95483., 16232., 15160.);
    Tri(19758., 25905.,101063., 5198., 15117.);
    Tri(59947., 146432.,48128., 22123., 9544.);
    Tri(45083., 374.,9082., 1329., 15109.);
    Tri(-245., 318.,67961., 55805., 14997.);
    Tri(22888., 31515.,30845., 291., 12049.);
    Tri(62891., 10146.,53681., 40620., 13213.);
    Tri(101247., 65186.,63152., 2365., 15105.);
    Tri(146812., 82891.,146862., 37118., 15232.);
    Tri(39284., 60805.,38747., 42705., 12696.);
    Tri(35256., 61826.,41387., 57554., 13497.);
    Tri(86256., 83708.,92404., 64969., 15243.);
    Tri(83763., 54646.,117008., 43160., 13451.);
    Tri(33895., 40014.,38458., 20725., 15164.);
    Tri(17776., 16652.,10102., 5673., 14367.);
    Tri(131567., 42823.,95732., 10561., 10008.);
    Tri(45372., 66872.,81070., 33973., 12893.);
    Tri(146766., 146744.,92220., 13382., 7731.);
    Tri(71345., 12588.,105150., 29841., 13383.);
    Tri(87503., 53663.,12791., 2598., 14602.);
    Tri(36862., 95231.,83932., 14633., 10254.);
    Tri(131422., 68862.,62729., 22128., 8555.);
    Tri(-369., 134204.,0., 17559., 9511.);
    Tri(31048., 42813.,26346., 65268., 14521.);
    Tri(100135., 92555.,134468., 51965., 14241.);
    Tri(84154., 66290.,72966., 57844., 11713.);
    Tri(73357., 53125.,140622., 43254., 7812.);
    Tri(111703., 146433.,125446., 3883., 13847.);
    Tri(25869., 30290.,2370., 58297., 2973.);
    Tri(94127., 118191.,114088., 16409., 12049.);
    Tri(2369., 50047.,101683., 53245., 14236.);
    Tri(95495., 81667.,82199., 65277., 15358.);
    Tri(107971., -54.,511., 45312., 15188.);
    Tri(89038., 146860.,57789., 1422., 13843.);
    Tri(107055., 134204.,138795., 18765., 8725.);
    Tri(81838., 63945.,77254., 51454., 13736.);
    Tri(510., 92671.,-375., 30172., 7782.);
    Tri(12114., 82310.,32546., 49132., 12936.);
    Tri(29719., 14458.,26450., 12636., 14866.);
    Tri(53604., 65194.,49832., 6472., 9246.);
    Tri(105712., 14602.,110322., 37746., 9034.);
    Tri(119633., 103735.,37699., 59901., 14506.);
    Tri(88968., 121705.,112842., 64246., 3561.);
    Tri(146532., 146432.,68613., 14131., 8213.);
    Tri(-422., -361.,6245., 22954., 12387.);
    Tri(94989., 63171.,246., 50640., 8347.);
    Tri(91840., 85692.,79571., 49125., 12878.);
    Tri(89395., 48395.,23843., 1053., 15105.);
    Tri(70068., 18938.,121269., 63918., 4092.);
    Tri(85854., 77688.,87413., 65277., 15355.);
    Tri(1166., 10419.,20609., 37874., 7818.);
    Tri(52287., 44099.,40022., 31696., 12705.);
    Tri(128662., 77109.,130289., 262., 15110.);
    Tri(111592., 119142.,103597., 10319., 8464.);
    Tri(96882., 96882.,33647., 21095., 8961.);
    Tri(124861., 373.,-48., 471., 7681.);
    Tri(103639., 96653.,129773., 51454., 13179.);
    Tri(146707., 70228.,30852., 788., 15114.);
    Tri(-343., 48216.,6144., 14735., 10052.);
    Tri(-1., 35272.,-91., 65195., 9952.);
    Tri(142648., 134919.,33134., 49396., 10381.);
    Tri(76659., 88948.,88410., 65018., 15357.);
    Tri(41472., 18829.,55396., 777., 12804.);
    Tri(124740., 93018.,97630., 14926., 8016.);
    Tri(52224., -512.,66703., 2606., 14860.);
    Tri(91688., 77888.,122461., 114., 9245.);
    Tri(101164., 87329.,97149., 24216., 11319.);
    Tri(59325., 63432.,103342., 45054., 9352.);
    Tri(29929., 44845.,102209., 1046., 14081.);
    Tri(33039., 95506.,40130., 64507., 5118.);
    Tri(51584., 87436.,60764., 21663., 8825.);
    Tri(118798., 118798.,26316., 18408., 14412.);
    Tri(94361., 90949.,104701., 263., 15105.);
    Tri(124342., 78081.,116632., 34683., 13993.);
    Tri(79285., 47041.,81850., 65278., 15326.);
    Tri(88897., 70892.,81216., 19830., 13096.);
    Tri(44205., 21715.,43721., 11903., 14643.);
    Tri(86680., 2316.,93336., 10077., 11545.);
    Tri(137825., 53418.,53418., 58826., 11693.);
    Tri(107282., 58246.,126305., 56292., 7871.);
    Tri(122661., 13723.,127807., 4890., 7702.);
    Tri(75546., 75546.,26522., 24137., 12062.);
    Tri(133101., 110643.,133101., 64111., 10532.);
    Tri(133028., 94058.,23491., 2., 15106.);
    Tri(79211., 91503.,94563., 512., 15106.);
    Tri(17103., 108620.,108620., 40164., 10532.);
    Tri(54810., 136268.,135215., 8194., 13591.);
    Tri(143042., 102435.,102437., 18372., 9752.);
    Tri(90946., 99205.,136488., 55294., 13459.);
    Tri(50142., 8077.,9103., 56836., 8369.);
    Tri(33455., -235.,23842., 19033., 15152.);
    Tri(88502., 129965.,144260., 7780., 14882.);
    Tri(89964., 40822.,75658., 59646., 10668.);
    Tri(108953., 138107.,121717., 28279., 11889.);
    Tri(9267., 10254.,4138., 12449., 13359.);
    Tri(91402., 95546.,109243., 258., 15106.);
    Tri(55361., 55361.,35211., 31432., 13271.);
    Tri(56852., 17620.,109743., 2054., 14855.);
    Tri(24262., 108611.,35406., 7170., 15127.);
    Tri(-95., 112111.,115145., 1538., 12033.);
    Tri(146529., 146432.,43520., 65171., 12151.);
    Tri(146545., 127557.,18432., 60., 15106.);
    Tri(29544., 40308.,53016., 31647., 15189.);
    Tri(511., 146942.,115135., 62546., 3049.);
    Tri(45363., 58756.,72039., 44259., 15248.);
    Tri(98230., 138453.,126685., 4637., 7686.);
    Tri(13006., -325.,-285., 28597., 10851.);
    Tri(94404., -237.,11601., 47867., 10652.);
    Tri(89962., 77681.,86392., 65278., 15358.);
    Tri(62625., 62976.,62469., 32948., 8944.);
    Tri(38922., 54339.,63557., 3673., 14857.);
    Tri(80727., 70512.,87386., 27469., 15155.);
    Tri(23693., 8543.,11224., 4143., 10250.);
    Tri(146457., 45074.,115805., 7467., 10767.);
    Tri(41806., 74478.,61658., 40698., 8080.);
    Tri(37888., 10240.,8290., 14249., 15153.);
    Tri(146943., 146852.,12287., 64090., 15007.);
    Tri(108359., 146762.,124162., 15192., 13355.);
    Tri(46576., 70033.,70033., 19255., 11976.);
    Tri(138555., 130805.,88460., 51187., 11674.);
    Tri(139291., 12881.,10323., 21883., 10828.);
    Tri(36271., -66.,31689., 19., 14850.);
    Tri(109280., 127204.,103116., 13730., 8489.);
    Tri(44544., 22736.,142936., 519., 15106.);
    Tri(115502., 143616.,96429., 6206., 15134.);
    Tri(133104., 70206.,70206., 52538., 10089.);
    Tri(37226., 37738.,43868., 62440., 8620.);
    Tri(25122., 11840.,32243., 3379., 8225.);
    Tri(126201., 109292.,100124., 36859., 9552.);
    Tri(63087., 48567.,63087., 50261., 11530.);
    Tri(81956., 77361.,101427., 41255., 15187.);
    Tri(16642., 89814.,54478., 26509., 15178.);
    Tri(51938., 51984.,86817., 47588., 12697.);
    Tri(129269., 75582.,119670., 42480., 11601.);
    Tri(104326., 127327.,73608., 15479., 13869.);
    Tri(26010., 34884.,22593., 38., 10497.);
    Tri(39588., 145710.,130225., 6964., 14862.);
    Tri(42534., 10752.,33926., 5963., 13337.);
    Tri(92354., 65220.,58148., 37323., 11634.);
    Tri(129269., 107785.,118664., 1280., 2853.);
    Tri(137008., 143132.,131354., 21332., 12107.);
    Tri(18210., 24910.,24352., 48891., 15297.);
    Tri(26317., 17752.,25416., 41937., 8363.);
    Tri(146462., 19764.,146935., 23934., 7758.);
    Tri(95193., 115619.,74709., 12036., 8475.);
    Tri(-512., 540.,11264., 1160., 12052.);
    Tri(55086., 106369.,106369., 4138., 8744.);
    Tri(32338., 17990.,25285., 11117., 14395.);
    Tri(77066., 90383.,92918., 65277., 15358.);
    Tri(25937., 10552.,8518., 17729., 15157.);
    Tri(101779., 19098.,101265., 57338., 8110.);
    Tri(75672., 38802.,42387., 17456., 11142.);
    Tri(42306., 121548.,30887., 12367., 13859.);

    gl_FragColor = vec4(min(col*1.35, 1.0), 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/Sharbat Gula", 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>


50
 Heroes of the Storm GeForce Game Ready Driver Released

 With a multitude of new features for desktops and notebooks, in addition to performance optimizations, support for the new $649 GeForce GTX 980 Ti, and Game Ready support for Heroes of the Storm, the new GeForce 353.06 WHQL drivers are a recommended update for all gamers.

Read more >   

51
 Introducing The GeForce GTX 980 Ti. Play The Future


The GeForce GTX 980 Ti is primed and ready for 4K, VR and DirectX 12 experiences, and runs at blistering speeds in today’s demanding DirectX 11 games, like Grand Theft Auto V and The Witcher 3: Wild Hunt.

Read more >   

52
3D-Tech News Around The Web / (DemoScene) Decrunch 2015
« on: May 30, 2015, 09:14:15 PM »
Decrunch 2015 at pouet and demozoo

All about Amiga and C64 - invitation in JS


53
English forum / Old conversion topics merged
« on: May 30, 2015, 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>


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


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

56
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

57
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

58
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

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


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

Pages: 1 2 [3] 4 5 ... 145