Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
2,208 changes: 2,208 additions & 0 deletions ex_util_gfxt_ext/cgltf_multiple_nodes/assets/meshes/WaterWheel/WaterWheel.gltf

Large diffs are not rendered by default.

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.
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.
137 changes: 137 additions & 0 deletions ex_util_gfxt_ext/cgltf_multiple_nodes/assets/meshes/sphere.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"asset":{
"generator":"Khronos glTF Blender I/O v4.1.63",
"version":"2.0"
},
"scene":0,
"scenes":[
{
"name":"Scene",
"nodes":[
0
]
}
],
"nodes":[
{
"mesh":0,
"name":"Sphere"
}
],
"materials":[
{
"doubleSided":true,
"name":"Material.002",
"pbrMetallicRoughness":{
"baseColorTexture":{
"index":0
},
"metallicFactor":0,
"roughnessFactor":0.5
}
}
],
"meshes":[
{
"name":"Sphere",
"primitives":[
{
"attributes":{
"POSITION":0,
"NORMAL":1,
"TEXCOORD_0":2
},
"indices":3,
"material":0
}
]
}
],
"textures":[
{
"sampler":0,
"source":0
}
],
"images":[
{
"mimeType":"image/png",
"name":"blue-sky",
"uri":"blue-sky.png"
}
],
"accessors":[
{
"bufferView":0,
"componentType":5126,
"count":151,
"max":[
1,
1,
1
],
"min":[
-0.9999999403953552,
-1,
-1
],
"type":"VEC3"
},
{
"bufferView":1,
"componentType":5126,
"count":151,
"type":"VEC3"
},
{
"bufferView":2,
"componentType":5126,
"count":151,
"type":"VEC2"
},
{
"bufferView":3,
"componentType":5123,
"count":672,
"type":"SCALAR"
}
],
"bufferViews":[
{
"buffer":0,
"byteLength":1812,
"byteOffset":0,
"target":34962
},
{
"buffer":0,
"byteLength":1812,
"byteOffset":1812,
"target":34962
},
{
"buffer":0,
"byteLength":1208,
"byteOffset":3624,
"target":34962
},
{
"buffer":0,
"byteLength":1344,
"byteOffset":4832,
"target":34963
}
],
"samplers":[
{
"magFilter":9729,
"minFilter":9987
}
],
"buffers":[
{
"byteLength":6176,
"uri":"sphere.bin"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
TODO(john): Need a description of the .sf format here
*/

pipeline {

raster
{
primitive: TRIANGLES
index_buffer_element_size: UINT32
},

depth
{
func: LESS
},


shader {

vertex {

attributes {

/*
Vertex layout required for this pipeline (for input assembler)

fields:

POSITION: float3
TEXCOORD: float2
TEXCOORD[0 - 12]: float2
COLOR: uint8[4]
NORMAL: float3
TANGENT: float4
JOINT: float4
WEIGHT: float
FLOAT: float
FLOAT2: float2
FLOAT3: float3
FLOAT4: float4
*/

POSITION : a_position
TEXCOORD : a_uv
COLOR : a_color
},

uniforms {
mat4 u_mvp;
},

out {
vec2 uv;
vec3 position;
},

code {
void main() {
gl_Position = u_mvp * vec4(a_position, 1.0);
uv = a_uv;
position = a_position;
}
}
},

fragment {

uniforms {
sampler2D u_base_col_tex;
vec4 u_base_col_fact;
},

out {
vec4 frag_color;
},

code {
void main() {
frag_color = texture(u_base_col_tex, uv); // //
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
TODO(john): Need a description of the .sf format here
*/

pipeline {

raster
{
primitive: TRIANGLES
index_buffer_element_size: UINT32
},

depth
{
func: ALWAYS
},


shader {

vertex {

attributes {

/*
Vertex layout required for this pipeline (for input assembler)

fields:

POSITION: float3
TEXCOORD: float2
TEXCOORD[0 - 12]: float2
COLOR: uint8[4]
NORMAL: float3
TANGENT: float4
JOINT: float4
WEIGHT: float
FLOAT: float
FLOAT2: float2
FLOAT3: float3
FLOAT4: float4
*/

POSITION : a_position
TEXCOORD : a_uv
COLOR : a_color
},

uniforms {
mat4 u_svp;
},

out {
vec2 uv;
},

code {
void main() {
vec4 pos = u_svp * vec4(a_position, 1.0);
uv = a_uv;
gl_Position = pos.xyww;
}
}
},

fragment {

uniforms {
sampler2D u_tex;
},

out {
vec4 frag_color;
},

code {
void main() {
frag_color = texture(u_tex, uv);
}
}
}
}
}
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 ex_util_gfxt_ext/cgltf_multiple_nodes/bin/App
Binary file not shown.
34 changes: 34 additions & 0 deletions ex_util_gfxt_ext/cgltf_multiple_nodes/proc/html5/emcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!bin/sh

rm -rf bin
mkdir bin
cd bin

proj_name=App
proj_root_dir=$(pwd)/../

flags=(
-O3 -w -s WASM=1 -s USE_WEBGL2=1 -s ASYNCIFY -s ALLOW_MEMORY_GROWTH=1 --preload-file ../assets
)

# Include directories
inc=(
-I ../../../third_party/include/ # Gunslinger includes
-I ../external/ # External includes
)

# Source files
src=(
../source/main.c
)

libs=(
)

# Build
emcc ${inc[*]} ${src[*]} ${flags[*]} -o $proj_name.html

cd ..



28 changes: 28 additions & 0 deletions ex_util_gfxt_ext/cgltf_multiple_nodes/proc/linux/gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

rm -rf bin
mkdir bin
cd bin

proj_name=App
proj_root_dir=$(pwd)/../

flags=(
-std=gnu99 -Wl,--no-as-needed -ldl -lGL -lX11 -pthread -lXi
)

# Include directories
inc=(
-I ../../../third_party/include/
-I ../external/
)

# Source files
src=(
../source/main.c
)

# Build
gcc -O3 ${inc[*]} ${src[*]} ${flags[*]} -lm -o ${proj_name}

cd ..
Loading