-
-
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 #37 from CedricGuillemet/dev-0.8
Imogen 0.8 - codename Unicorn Jabu
- Loading branch information
Showing
106 changed files
with
15,794 additions
and
7,704 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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) | ||
{ | ||
EnableDepthBuffer(evaluation->targetIndex, 1); | ||
return EVAL_OK; | ||
} |
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,12 @@ | ||
#include "Imogen.h" | ||
|
||
typedef struct FurGenerator_t | ||
{ | ||
int hairCount; | ||
float lengthFactor; | ||
} FurGenerator; | ||
|
||
int main(FurGenerator *param, Evaluation *evaluation) | ||
{ | ||
return AllocateComputeBuffer(evaluation->targetIndex, param->hairCount, 4 * 4 *sizeof(float) ); | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "Imogen.h" | ||
|
||
typedef struct SVG_t | ||
{ | ||
char filename[1024]; | ||
float dpi; | ||
} SVG; | ||
|
||
int main(SVG *param, Evaluation *evaluation) | ||
{ | ||
Image image; | ||
image.bits = 0; | ||
if (param->dpi <= 1.f) | ||
param->dpi = 96.f; | ||
|
||
if (strlen(param->filename)) | ||
{ | ||
if (LoadSVG(param->filename, &image, param->dpi) == EVAL_OK) | ||
{ | ||
SetEvaluationImage(evaluation->targetIndex, &image); | ||
} | ||
} | ||
return EVAL_OK; | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#define pi 3.15159 | ||
#define isqrt2 0.707106 | ||
|
||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifdef VERTEX_SHADER | ||
|
||
layout (std140) uniform EvaluationBlock | ||
{ | ||
mat4 viewRot; | ||
mat4 viewProjection; | ||
mat4 viewInverse; | ||
int targetIndex; | ||
int forcedDirty; | ||
int uiPass; | ||
int frameNumber; | ||
vec4 mouse; // x,y, lbut down, rbut down | ||
ivec4 inputIndices[2]; | ||
|
||
vec2 viewport; | ||
} EvaluationParam; | ||
|
||
layout(location = 0)in vec2 inUV; | ||
layout(location = 1)in vec4 inCompute0; | ||
layout(location = 2)in vec4 inCompute1; | ||
layout(location = 3)in vec4 inCompute2; | ||
layout(location = 4)in vec4 inCompute3; | ||
|
||
out vec2 uv; | ||
out vec4 color; | ||
out vec3 normal; | ||
out vec3 up; | ||
void main() | ||
{ | ||
float startWidth = 0.1; | ||
float endWidth = 0.0; | ||
vec4 i1 = mix(inCompute0, inCompute2, inUV.y); | ||
vec4 i2 = mix(inCompute2, inCompute3, inUV.y); | ||
|
||
vec4 bezierPos = mix(i1, i2, inUV.y); | ||
vec4 tgt = normalize(i2 - i1); | ||
|
||
vec3 right = normalize(cross(bezierPos.xyz - EvaluationParam.viewInverse[3].xyz, tgt.xyz)); | ||
up = cross(right, tgt.xyz); | ||
|
||
float width = min(mix(startWidth, endWidth, inUV.y), startWidth * 0.5); | ||
|
||
vec4 pos = bezierPos + vec4(right,0.) * inUV.x * width; | ||
|
||
gl_Position = EvaluationParam.viewProjection * vec4(pos.xyz, 1.0); | ||
|
||
|
||
normal = right; | ||
uv = vec2(inUV.x * 0.5 + 0.5, inUV.y); | ||
color = vec4(inCompute0.a, inCompute1.a, inCompute2.a, 1.); | ||
} | ||
#endif | ||
|
||
#ifdef FRAGMENT_SHADER | ||
layout (location=0) out vec4 co; | ||
in vec2 uv; | ||
in vec4 color; | ||
in vec3 normal; | ||
in vec3 up; | ||
|
||
void main() | ||
{ | ||
/*float u01 = (uv.x * 2.0 - 1.0); | ||
vec3 n = mix(up, normal, abs(u01)); | ||
float dnl = max(dot(normalize(n), normalize(vec3(1.))), 0.) * 0.4 + 0.6; | ||
co = color * dnl; | ||
*/ | ||
co = color; | ||
} | ||
#endif |
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,38 @@ | ||
layout (std140) uniform FurGeneratorBlock | ||
{ | ||
int hairCount; | ||
float lengthFactor; | ||
} FurGeneratorParam; | ||
|
||
|
||
out vec4 outCompute0; // color in w, length in outCompute3.w | ||
out vec4 outCompute1; | ||
out vec4 outCompute2; | ||
out vec4 outCompute3; | ||
|
||
uniform sampler2D Sampler0; | ||
uniform sampler2D Sampler1; | ||
|
||
void main() | ||
{ | ||
float n = float(gl_VertexID); | ||
vec2 uv = vec2(mod(n, 32.0), floor(n/32.0)) / 32.0; | ||
uv *= 10.; | ||
|
||
vec4 color = texture(Sampler0, uv); | ||
float length = texture(Sampler1, uv).x * 2.0; | ||
|
||
float ng = n * 2.9781; | ||
vec4 gp = vec4(uv.x, 0., uv.y, 0.) * 8.0; | ||
gp.xyz += vec3(cos(ng*1.117), 0., sin(ng*0.914)) * 0.2; | ||
outCompute0 = gp; | ||
vec3 nrm = normalize(vec3(0.,1.,0.) + vec3(cos(ng), 0., sin(ng)) * 0.25 ); | ||
outCompute1 = vec4(nrm, 0.); | ||
outCompute2 = gp + vec4(nrm, 0.) * 0.01; | ||
outCompute3 = gp + vec4(nrm, 0.) * 0.02; | ||
|
||
outCompute0.a = color.r; | ||
outCompute1.a = color.g; | ||
outCompute2.a = color.b; | ||
outCompute3.a = length; | ||
} |
Oops, something went wrong.