正在查看: Kreate v1.5.0 应用的 BlackCherryCosmos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Kreate v1.5.0 应用的 BlackCherryCosmos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mikepenz.hypnoticcanvas.shaders;
import com.mikepenz.hypnoticcanvas.RuntimeEffect;
import com.mikepenz.hypnoticcanvas.shaders.Shader;
import kotlin.Metadata;
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u000f\bÇ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003R\u0014\u0010\u0004\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007R\u0014\u0010\b\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\u0007R\u0014\u0010\n\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\u0007R\u0014\u0010\f\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u0007R\u0014\u0010\u000e\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u000f\u0010\u0007R\u0014\u0010\u0010\u001a\u00020\u00058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0007R\u0014\u0010\u0012\u001a\u00020\u0005X\u0096D¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0007¨\u0006\u0014"}, d2 = {"Lcom/mikepenz/hypnoticcanvas/shaders/BlackCherryCosmos;", "Lcom/mikepenz/hypnoticcanvas/shaders/Shader;", "<init>", "()V", "name", "", "getName", "()Ljava/lang/String;", "authorName", "getAuthorName", "authorUrl", "getAuthorUrl", "credit", "getCredit", "license", "getLicense", "licenseUrl", "getLicenseUrl", "sksl", "getSksl", "hypnoticcanvas-shaders_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
public final class BlackCherryCosmos implements Shader {
public static final int $stable = 0;
public static final BlackCherryCosmos INSTANCE = new BlackCherryCosmos();
private static final String sksl = "\nuniform float uTime;\nuniform vec3 uResolution;\n\nconst float formuparam2 = 1.0;\nconst float cloud = 0.1;\nconst float iterations = 5.0;\nconst float volsteps = 4.0;\nconst float zoom = 5.0;\nconst float tile = 0.85;\n\nconst float stepsize = 0.390;\nconst float speed2 = 0.10;\n \nconst float speedz = 0.0;\nconst float brightness = 0.15;\nconst float darkmatter = 0.600;\nconst float distfading = 0.560;\nconst float saturation = 0.900;\nconst float transverseSpeed = zoom*2.0;\n \nfloat triangle(float x, float a)\n{\n float output2 = 2.0*abs( 2.0* ( (x/a) - floor( (x/a) + 0.5) ) ) - 1.0;\n return output2;\n}\n\nfloat field(in vec3 p) {\n\t\n\tfloat strength = 7. + .03 * log(1.e-6 + fract(sin(uTime) * 4373.11));\n\tfloat accum = 0.;\n\tfloat prev = 0.;\n\tfloat tw = 0.;\n\t\n\tfor (int i = 0; i < 6; ++i) {\n\t\tfloat mag = dot(p, p);\n\t\tp = abs(p) / mag + vec3(-.5, -.8 + 0.1*sin(uTime*0.2 + 2.0), -1.1+0.3*cos(uTime*0.15));\n\t\tfloat w = exp(-float(i) / 7.);\n\t\taccum += w * exp(-strength * pow(abs(mag - prev), 2.3));\n\t\ttw += w;\n\t\tprev = mag;\n\t}\n\treturn max(0., 5. * accum / tw - .7);\n}\n\nvec4 main( vec2 fragCoord )\n{\n vec2 uv2 = 2. * fragCoord.xy / uResolution.xy - 1.;\n\tvec2 uvs = uv2 * uResolution.xy / max(uResolution.x, uResolution.y);\n\n\tfloat time2 = uTime;\n \n float speed = speed2;\n //speed = 0.005 * cos(time2*0.02 + 3.1415926/4.0);\n speed = 0.00005 * speedz * time2;\n \n\t//speed = 0.0;\n\n float formuparam = formuparam2;\n\n\t//get coords and direction\n\tvec2 uv = uvs;\n\t\t \n\t//mouse rotation\n\tfloat a_xz = 0.9;\n\tfloat a_yz = -.6;\n\tfloat a_xy = 0.9 + uTime*0.04;\n\t\n\tmat2 rot_xz = mat2(cos(a_xz),sin(a_xz),-sin(a_xz),cos(a_xz));\n\tmat2 rot_yz = mat2(cos(a_yz),sin(a_yz),-sin(a_yz),cos(a_yz));\t\n\tmat2 rot_xy = mat2(cos(a_xy),sin(a_xy),-sin(a_xy),cos(a_xy));\n\t\n\tfloat v2 =1.0;\n\t\n\tvec3 dir=vec3(uv*zoom,1.);\n \n\tvec3 from=vec3(0.0, 0.0,0.0);\n \n // from.x -= 5.0*(mouse.x-0.5);\n // from.y -= 5.0*(mouse.y-0.5);\n \n from.x -= 5.0*(1.0-0.5);\n from.y -= 5.0*(1.0-0.5);\n \n\tvec3 forward = vec3(0.,0.,1.);\n \n\tfrom.x += transverseSpeed*(1.0)*cos(0.01*uTime) + 0.001*uTime;\n\t\tfrom.y += transverseSpeed*(1.0)*sin(0.01*uTime) +0.001*uTime;\n\t\n\tfrom.z += 0.003*uTime;\n\t\n\tdir.xy*=rot_xy;\n\tforward.xy *= rot_xy;\n\n\tdir.xz*=rot_xz;\n\tforward.xz *= rot_xz;\n\t\n\tdir.yz*= rot_yz;\n\tforward.yz *= rot_yz;\n\t \n\tfrom.xy*=-rot_xy;\n\tfrom.xz*=rot_xz;\n\tfrom.yz*= rot_yz;\n\t \n\t//zoom\n\tfloat zooom = (time2-3311.)*speed;\n\tfrom += forward* zooom;\n\tfloat sampleShift = mod( zooom, stepsize );\n\t \n\tfloat zoffset = -sampleShift;\n\tsampleShift /= stepsize; // make from 0 to 1\n\n\t//volumetric rendering\n\tfloat s=0.24;\n\tfloat s3 = s + stepsize/2.0;\n\tvec3 v=vec3(0.);\n\tfloat t3 = 0.0;\n\t\n\tvec3 backCol2 = vec3(0.);\n\tfor (int r=0; r<20; r++) {\n\t\tif (r > int(volsteps)) {break;}\n\t\tvec3 p2=from+(s+zoffset)*dir;// + vec3(0.,0.,zoffset);\n\t\tvec3 p3=(from+(s3+zoffset)*dir )* (1.9/zoom);// + vec3(0.,0.,zoffset);\n\t\t\n\t\tp2 = abs(vec3(tile)-mod(p2,vec3(tile*2.))); // tiling fold\n\t\tp3 = abs(vec3(tile)-mod(p3,vec3(tile*2.))); // tiling fold\n\t\t\n\t\tt3 = field(p3);\n\t\t\n\t\tfloat pa,a=pa=0.;\n\t\tfor (int i=0; i<20; i++) {\n\t\t\tif (i > int(iterations)) {break;}\n\t\t\tp2=abs(p2)/dot(p2,p2)-formuparam; // the magic formula\n\t\t\t//p=abs(p)/max(dot(p,p),0.005)-formuparam; // another interesting way to reduce noise\n\t\t\tfloat D = abs(length(p2)-pa); // absolute sum of average change\n\t\t\t\n\t\t\tif (i > 2)\n\t\t\t{\n\t\t\t a += i > 7 ? min( 12., D) : D;\n\t\t\t}\n pa=length(p2);\n\t\t}\n\t\t\n\t\t//float dm=max(0.,darkmatter-a*a*.001); //dark matter\n\t\ta*=a*a; // add contrast\n\t\t//if (r>3) fade*=1.-dm; // dark matter, don't render near\n\t\t// brightens stuff up a bit\n\t\tfloat s1 = s+zoffset;\n\t\t// need closed form expression for this, now that we shift samples\n\t\tfloat fade = pow(distfading,max(0.,float(r)-sampleShift));\n\t\t\n\t\t//t3 += fade;\n\t\t\n\t\tv+=fade;\n //backCol2 -= fade;\n\n\t\t// fade out samples as they approach the camera\n\t\tif( r == 0 )\n\t\t\tfade *= (1. - (sampleShift));\n\t\t// fade in samples as they approach from the distance\n\t\tif( r == int(volsteps)-1 )\n\t\t\tfade *= sampleShift;\n\t\tv+=vec3(s1,s1*s1,s1*s1*s1*s1)*a*brightness*fade; // coloring based on distance\n\t\t\n\t\tbackCol2 += mix(.4, 1., v2) * vec3(1.8 * t3 * t3 * t3, 1.4 * t3 * t3, t3) * fade;\n\n\t\ts+=stepsize;\n\t\ts3 += stepsize;\n }\n\t\t \n\tv=mix(vec3(length(v)),v,saturation); //color adjust\n\t\n\tvec4 forCol2 = vec4(v*.01,1.);\n\t\n\tbackCol2 *= cloud;\n\tbackCol2.b *= 1.8;\n\tbackCol2.r *= 0.55;\n\t\n\tbackCol2.b = 0.5*mix(backCol2.g, backCol2.b, 0.8);\n\tbackCol2.g = -0.5;\n\n\tbackCol2.bg = mix(backCol2.gb, backCol2.bg, 0.5*(cos(uTime*0.01) + 1.0));\n\treturn forCol2 + vec4(backCol2, 1.0);\n}\n\n ";
private BlackCherryCosmos() {
}
@Override
public void applyUniforms(RuntimeEffect runtimeEffect, float f, float f2, float f3) {
Shader.DefaultImpls.applyUniforms(this, runtimeEffect, f, f2, f3);
}
@Override
public float getSpeedModifier() {
return Shader.DefaultImpls.getSpeedModifier(this);
}
@Override
public String getName() {
return "BlackCherryCosmos2";
}
@Override
public String getAuthorName() {
return "axiomcrux";
}
@Override
public String getAuthorUrl() {
return "https://editor.isf.video/u/axiomcrux";
}
@Override
public String getCredit() {
return "https://editor.isf.video/shaders/612cb473f4fe08001a0a6281";
}
@Override
public String getLicense() {
return "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License";
}
@Override
public String getLicenseUrl() {
return "https://isf.video/";
}
@Override
public String getSksl() {
return sksl;
}
}