// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. CCEffect %{ techniques: - passes: - vert: vs frag: fs blendState: targets: - blend: true rasterizerState: cullMode: none properties: texture: { value: white } alphaThreshold: { value: 0.5 } }% CCProgram vs %{ precision highp float; #include #include in vec3 a_position; in vec4 a_color; out vec4 v_color; #if USE_TEXTURE in vec2 a_uv0; out vec2 v_uv0; #endif void main () { vec4 pos = vec4(a_position, 1); #if CC_USE_MODEL pos = cc_matViewProj * cc_matWorld * pos; #else pos = cc_matViewProj * pos; #endif #if USE_TEXTURE v_uv0 = a_uv0; #endif v_color = a_color; gl_Position = pos; } }% CCProgram fs %{ precision highp float; #include #include #include in vec4 v_color; #if USE_TEXTURE in vec2 v_uv0; uniform sampler2D texture; #endif #define LAYERS 6 #define DEPTH .4 #define WIDTH .3 #define SPEED .3 #define DRIFT .2 #define DRIFT_PROBABILITY 0.6 #define iTime cc_time.x void main () { const mat3 p = mat3(13.323122,23.5112,21.71123,21.1212,28.7312,11.9312,21.8112,14.7212,61.3934); vec2 uv = 500./1000. + vec2(1.,1.)*gl_FragCoord.xy / 1000.; vec3 acc = vec3(0.0); float dof = 5.*sin(iTime*.1); for (int i=0;i0.3){ a = acc.r+acc.g+acc.b; } gl_FragColor = vec4(vec3(acc*5.),a); // gl_FragColor = o; } }%