-
-
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 #51 from CedricGuillemet/dev-0.11
dev 0.11
- Loading branch information
Showing
43 changed files
with
8,378 additions
and
1,931 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 | ||
] | ||
} | ||
] | ||
} | ||
|
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,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; | ||
} |
Oops, something went wrong.