Skip to content

Commit

Permalink
Merge branch '2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
trifox committed Apr 25, 2019
2 parents 5f4b012 + 637caa3 commit 2a556d6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
20 changes: 10 additions & 10 deletions 2018/shadertoy/001-XT-Kali-Underwater-Creature/ShaderMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,22 @@ mat3 rotationMatrix3(vec3 v, float angleDegree)
// util library end

const int Iterations = 25;
const float detail = .025;
const float detail = .02;
const vec3 lightdir = -vec3(0., 1., 0.);

float Scale = inputVector1.x*2.0 -2.0 ;




float objectScale = inputVector5.x *inputVector5.x*2.0;
vec3 objectTranslate = vec3(inputVector1.y*40.0-20.0, inputVector1.z*40.0 - 20.0, inputVector1.w*40.0 - 20.0);

mat3 objectRotation =rotationMatrix3(vec3(0.0, 1.0, 0.0), inputVector5.z*360 - 180.0)* rotationMatrix3(vec3(1.0, 0.0, 0.0), inputVector5.y*360 - 180.0);



vec3 Julias[3] = vec3[3](inputVector2.xyz*6.0 - 3.0, inputVector3.xyz*6.0 - 3.0, inputVector4.xyz*6.0-3.0);
vec3 Julias[3] = vec3[3](inputVector2.xyz*3.0 , inputVector3.xyz*3.0, inputVector4.xyz*3.0);
float RotAngles[3] = float [3](inputVector2.w*360.0, inputVector3.w*360.0, inputVector4.w*360.0);


Expand Down Expand Up @@ -337,7 +338,7 @@ vec3 light(in vec3 p, in vec3 dir) {
vec3 r = reflect(ldir, n);
float spec = max(0., dot(dir, -r));
vec3 colo = color(p);
return (diff*sh + .15*max(0., dot(normalize(dir), -n))*calcAO(p, n))*colo + pow(spec, 30.)*.5*sh;
return (diff*sh + .15*max(0., dot(normalize(dir), -n))*calcAO(p, n))*colo + pow(spec, 30.)*.75*sh;
}


Expand All @@ -352,15 +353,15 @@ vec3 raymarch(in vec3 from, in vec3 dir, vec2 fragCoord)
for (int i = 0; i<70; i++) {
if (d>detail && totdist<150.)
{
p = from + totdist*dir;
p = from + totdist*dir ;
d = de(p);
totdist += d;
totdist += d *0.9;
}

}
// vec3 backg = vec3(.4, .5, .55)*(1. + fragCoord.y / iResolution.y*1.5);
if (d<detail) {
col = light(p - detail*dir, dir);
col = light(p - detail*dir, dir)+0.1;
}
else {
col = vec3(0.0,0.0,0.0);
Expand Down Expand Up @@ -391,8 +392,7 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord)


float de(vec3 p) {
p = objectScale* (p + objectTranslate)* objectRotation;
vec3 pp = p;
p = objectScale* (p + objectTranslate)* objectRotation;
float l;
for (int i = 0; i<Iterations; i++) {
p.xy = abs(p.xy);
Expand All @@ -411,8 +411,8 @@ float de(vec3 p) {
}

}
l = length(p);
return l*pow(-Scale, -float(Iterations)) - .1;
l = length(p);
return l*pow(-Scale, -float(Iterations));
}


Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

# 2018 +

2.1.0 - [2019-04-25]

- fine tune kali xt parameters:
- scale is only negative
- julia is only positive
- lighting and distance estimation adjustments

2.0.1 - [2019-04-25]

- NVIDIA Fix - most recent nvidia cards do not allow dynamic array access, falling back to
Expand Down
Binary file modified release/plugins/SoM-ST-XT-001-Kali-Underwater.dll
Binary file not shown.
Binary file modified release/plugins32bit/SoM-ST-XT-001-Kali-Underwater.dll
Binary file not shown.

0 comments on commit 2a556d6

Please sign in to comment.