Skip to content

Commit

Permalink
Merge pull request #51 from CedricGuillemet/dev-0.11
Browse files Browse the repository at this point in the history
dev 0.11
  • Loading branch information
CedricGuillemet authored Mar 31, 2019
2 parents fdf8b54 + 73e0356 commit 8e35282
Show file tree
Hide file tree
Showing 43 changed files with 8,378 additions and 1,931 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Imogen
GPU/CPU Texture Generator

WIP of a GPU Texture generator using dear imgui for UI. Not production ready and a bit messy but really fun to code.
Basically, add GPU and CPU nodes in a graph to manipulate and generate images. Nodes are hardcoded now but a discovery system is planned.
GPU Texture generator using dear imgui for UI. Not production ready and a bit messy but really fun to code.
Basically, add GPU and CPU nodes in a graph to manipulate and generate images.
Currently nodes can be written in GLSL or C or Python.


Expand All @@ -17,6 +17,7 @@ Features:
- edit/change node shaders inside the app
- bake textures to .png, .jpg, .tga, .bmp, .hdr, mp4
- PBR preview
- timeline for parameters animation

Currently implemented nodes
- circle and square generator
Expand Down Expand Up @@ -79,3 +80,5 @@ nanosvg - Mikko Mononen https://github.com/memononen/nanosvg
GLSL-PathTracer - knightcrawler25 https://github.com/knightcrawler25/GLSL-PathTracer

imgui_markdown - Juliette Foucaut https://github.com/juliettef/imgui_markdown

CGLTF - Johannes Kuhlmann https://github.com/jkuhlmann/cgltf
Binary file added Refs/D1lhp6_W0AEfica.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Refs/honey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Refs/honey_pbr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/Imogen.exe
Binary file not shown.
Binary file added bin/Media/Mesh/cartoon_head002/scene.bin
Binary file not shown.
270 changes: 270 additions & 0 deletions bin/Media/Mesh/cartoon_head002/scene.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
{
"accessors": [
{
"bufferView": 1,
"componentType": 5126,
"count": 65532,
"max": [
1.569299578666687,
1.4159302711486816,
0.87469422817230225
],
"min": [
-1.569299578666687,
-1.621997594833374,
-4.0125851631164551
],
"type": "VEC3"
},
{
"bufferView": 1,
"byteOffset": 786384,
"componentType": 5126,
"count": 65532,
"max": [
0.99999606609344482,
0.9999886155128479,
0.99999231100082397
],
"min": [
-0.9999961256980896,
-1,
-0.99999266862869263
],
"type": "VEC3"
},
{
"bufferView": 2,
"componentType": 5126,
"count": 65532,
"max": [
1,
1,
1,
1
],
"min": [
1,
1,
1,
1
],
"type": "VEC4"
},
{
"bufferView": 0,
"componentType": 5125,
"count": 335421,
"max": [
65531
],
"min": [
0
],
"type": "SCALAR"
},
{
"bufferView": 1,
"byteOffset": 1572768,
"componentType": 5126,
"count": 37450,
"max": [
1.5645266771316528,
1.4146754741668701,
0.87469422817230225
],
"min": [
-1.569299578666687,
-1.6220142841339111,
-4.0125851631164551
],
"type": "VEC3"
},
{
"bufferView": 1,
"byteOffset": 2022168,
"componentType": 5126,
"count": 37450,
"max": [
0.99999558925628662,
0.99993050098419189,
0.99991405010223389
],
"min": [
-0.99999552965164185,
-0.99990594387054443,
-0.99985039234161377
],
"type": "VEC3"
},
{
"bufferView": 2,
"byteOffset": 1048512,
"componentType": 5126,
"count": 37450,
"max": [
1,
1,
1,
1
],
"min": [
1,
1,
1,
1
],
"type": "VEC4"
},
{
"bufferView": 0,
"byteOffset": 1341684,
"componentType": 5125,
"count": 137967,
"max": [
37449
],
"min": [
0
],
"type": "SCALAR"
}
],
"asset": {
"extras": {
"author": "DeMoon (https://sketchfab.com/demoon)",
"license": "CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/)",
"source": "https://sketchfab.com/models/4769e1ab43824dfb98a5da736988b718",
"title": "Cartoon Head002"
},
"generator": "Sketchfab-3.20.7",
"version": "2.0"
},
"bufferViews": [
{
"buffer": 0,
"byteLength": 1893552,
"byteOffset": 0,
"name": "floatBufferViews",
"target": 34963
},
{
"buffer": 0,
"byteLength": 2471568,
"byteOffset": 1893552,
"byteStride": 12,
"name": "floatBufferViews",
"target": 34962
},
{
"buffer": 0,
"byteLength": 1647712,
"byteOffset": 4365120,
"byteStride": 16,
"name": "floatBufferViews",
"target": 34962
}
],
"buffers": [
{
"byteLength": 6012832,
"uri": "scene.bin"
}
],
"materials": [
{
"doubleSided": true,
"emissiveFactor": [
0,
0,
0
],
"name": "material_0",
"pbrMetallicRoughness": {
"baseColorFactor": [
1,
1,
1,
1
],
"metallicFactor": 0,
"roughnessFactor": 0.59999999999999998
}
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"COLOR_0": 2,
"NORMAL": 1,
"POSITION": 0
},
"indices": 3,
"material": 0,
"mode": 4
}
]
},
{
"primitives": [
{
"attributes": {
"COLOR_0": 6,
"NORMAL": 5,
"POSITION": 4
},
"indices": 7,
"material": 0,
"mode": 4
}
]
}
],
"nodes": [
{
"children": [
1
],
"name": "RootNode (gltf orientation matrix)",
"rotation": [
-0.70710678118654746,
-0,
-0,
0.70710678118654757
]
},
{
"children": [
2
],
"name": "RootNode (model correction matrix)"
},
{
"children": [
3,
4
],
"name": "Cartoon Head002.OBJ.cleaner.materialmerger.gles"
},
{
"mesh": 0,
"name": ""
},
{
"mesh": 1,
"name": ""
}
],
"scene": 0,
"scenes": [
{
"name": "OSG_Scene",
"nodes": [
0
]
}
]
}

55 changes: 55 additions & 0 deletions bin/Nodes/C/GLTFRead.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include "Imogen.h"

typedef struct GLTFRead_t
{
char filename[1024];
} GLTFRead;

typedef struct JobData_t
{
char filename[1024];
int targetIndex;
void *context;
void *scene;
} JobData;

int UploadMeshJob(JobData *data)
{
SetEvaluationScene(data->context, data->targetIndex, data->scene);
SetProcessing(data->context, data->targetIndex, 0);
return EVAL_OK;
}

int ReadJob(JobData *data)
{
if (ReadGLTF(data->context, data->filename, &data->scene) == EVAL_OK)
{
JobData dataUp = *data;
JobMain(data->context, UploadMeshJob, &dataUp, sizeof(JobData));
}
else
SetProcessing(data->context, data->targetIndex, 0);
return EVAL_OK;
}

int main(GLTFRead *param, Evaluation *evaluation, void *context)
{
int i;

EnableDepthBuffer(context, evaluation->targetIndex, 1);
EnableFrameClear(context, evaluation->targetIndex, 1);
SetVertexSpace(context, evaluation->targetIndex, vertexSpace_World);

if (strlen(param->filename))
{
SetProcessing(context, evaluation->targetIndex, 1);
JobData data;
strcpy(data.filename, param->filename);
data.targetIndex = evaluation->targetIndex;
data.context = context;
ReadJob(&data);
//Job(context, ReadJob, &data, sizeof(JobData));
}

return EVAL_OK;
}
Loading

0 comments on commit 8e35282

Please sign in to comment.