-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from CedricGuillemet/dev-0.6.0
start of 0.6.0 branch
- Loading branch information
Showing
232 changed files
with
32,511 additions
and
978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "Imogen.h" | ||
|
||
int main(void *param, Evaluation *evaluation) | ||
{ | ||
SetEvaluationSize(evaluation->targetIndex, 512, 64); | ||
return EVAL_OK; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
vec4 GetRamp(float v, vec4 arr[8]) | ||
{ | ||
for (int i = 0;i<(arr.length()-1);i++) | ||
{ | ||
if (v >= arr[i].w && v <= arr[i+1].w) | ||
{ | ||
// linear | ||
float t = (v-arr[i].w)/(arr[i+1].w-arr[i].w); | ||
// smooth | ||
//float t = smoothstep(arr[i].w, arr[i+1].w, v); | ||
return sqrt(mix(arr[i]*arr[i], arr[i+1]*arr[i+1], t)); | ||
} | ||
} | ||
|
||
return vec4(0.0); | ||
} | ||
|
||
layout (std140) uniform GradientBuilderBlock | ||
{ | ||
vec4 ramp[8]; | ||
} GradientBuilderParam; | ||
|
||
vec4 GradientBuilder() | ||
{ | ||
return vec4(GetRamp(vUV.x, GradientBuilderParam.ramp).xyz, 1.0); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
layout (std140) uniform NGonBlock | ||
{ | ||
int sides; | ||
float radius; | ||
float t; | ||
}; | ||
|
||
vec4 NGon() | ||
{ | ||
vec2 p = vUV - vec2(0.5); | ||
|
||
vec2 d = vec2(0.0, 1.0); | ||
float ng = 0.0; | ||
float col = 0.0; | ||
|
||
for(int i = 0;i<sides;i++) | ||
{ | ||
vec2 rd = Rotate2D(d, ng); | ||
ng += 3.14159*2.0 / float(sides); | ||
float d = smoothstep(mix(-radius, 0.0, t), 0.001, dot(p,rd)-radius); | ||
col = max(col, d); | ||
} | ||
col = 1.0 - col; | ||
return vec4(col); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
layout (std140) uniform TileBlock | ||
{ | ||
vec2 offset0; | ||
vec2 offset1; | ||
vec2 overlap; | ||
float scale; | ||
} TileParam; | ||
|
||
vec4 GetTile0(vec2 uv) | ||
{ | ||
if (uv.x > 1.0 || uv.y > 1.0 || uv.x <0.0 || uv.y<0.0) | ||
return vec4(0.0); | ||
|
||
return texture(Sampler0, uv); | ||
} | ||
|
||
vec2 GetOffset(vec2 uv) | ||
{ | ||
float o = float(int(floor(uv.y))&1) * TileParam.offset0.x; | ||
return vec2(o,0.); | ||
} | ||
|
||
vec4 GetTile(vec2 uv) | ||
{ | ||
vec2 cellSize = vec2(1.0) - TileParam.overlap; | ||
|
||
vec4 c = vec4(0.0); | ||
|
||
for (int y = -1;y<2;y++) | ||
{ | ||
for (int x = -1;x<2;x++) | ||
{ | ||
vec2 cell0 = uv - (fract(uv/cellSize) + vec2(float(x), float(y))) * cellSize; | ||
vec2 cell1 = (floor(uv/cellSize) + vec2(float(x), float(y)));// * cellSize; | ||
vec4 multiplier = vec4(1.0); | ||
if (EvaluationParam.inputIndices[0].y > -1.) | ||
multiplier = texture(Sampler1, cell0/TileParam.scale); | ||
c += GetTile0(uv - cell0 + GetOffset(cell1)) * multiplier; | ||
} | ||
} | ||
|
||
return c; | ||
} | ||
|
||
vec4 Tile() | ||
{ | ||
vec2 nuv = vUV * TileParam.scale; | ||
return GetTile(nuv); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
layout (std140) uniform WarpBlock | ||
{ | ||
float strength; | ||
int mode; | ||
} WarpParam; | ||
|
||
vec4 Warp() | ||
{ | ||
vec4 texOffset = texture(Sampler1, vUV); | ||
vec2 nuv = vUV; | ||
if (WarpParam.mode == 0) | ||
nuv += (texOffset.xy-0.5) * WarpParam.strength; | ||
else | ||
nuv += vec2(cos(texOffset.x * PI * 2.0), sin(texOffset.x * PI * 2.0)) * WarpParam.strength; | ||
vec4 tex = texture(Sampler0, nuv); | ||
|
||
return tex; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import imo | ||
|
||
def test(a, b, e): | ||
res = imo.add(a,b) | ||
res2 = imo.add2(a, b) | ||
#e = imo.accessor_api() | ||
print ("result = {}".format(res)) | ||
print ("result2 = {}".format(res2)) | ||
print ("target is {}".format(e["target"])) | ||
print ("inputs is {}".format(e["inputs"])) | ||
img = imo.GetImage() | ||
print (img) | ||
imo.SaveImage(img) | ||
print (imo.add) | ||
#help(imo) | ||
return 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifdef VERTEX_SHADER | ||
|
||
layout(location = 0)in vec2 inUV; | ||
out vec2 vUV; | ||
|
||
void main() | ||
{ | ||
gl_Position = vec4(inUV.xy*2.0 - 1.0,0.5,1.0); vUV = inUV; | ||
} | ||
|
||
#endif | ||
|
||
#ifdef FRAGMENT_SHADER | ||
|
||
uniform float time; | ||
#define PI 3.1415926 | ||
layout(location = 0) out vec4 outPixDiffuse; | ||
in vec2 vUV; | ||
|
||
void main() | ||
{ | ||
// base of shader by FabriceNeyret2 https://www.shadertoy.com/view/XlfBW7 | ||
vec2 U = vUV*2.5-1.25; | ||
U.x = asin( U.x / cos( U.y = asin(U.y) )) - time; | ||
U = 6.* sin(8.*U); | ||
outPixDiffuse = vec4(0.5,0.0,0.0,1.0); | ||
outPixDiffuse.r = max(outPixDiffuse.r, outPixDiffuse.r+U.x/U.x); | ||
outPixDiffuse.gb += U.x*U.y; | ||
} | ||
|
||
#endif |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.