-
Notifications
You must be signed in to change notification settings - Fork 12
Migrates to v0.14 #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c230cee
first pass
nicoabie 59ed4a9
remove local cimgui
nicoabie 4ca2c9d
add readme for tools
nicoabie 31cbc98
make lua work again
nicoabie b2c0e42
feedback update shaders bindings
nicoabie 7533a1e
Fixing graphics binding offset issue, disabled Lua for web builds
Interrupt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ zig-cache | |
| .zig-cache | ||
| zig-out | ||
| .DS_Store | ||
| tools/sokol-shdc | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.13.0 | ||
| 0.14.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| .{ | ||
| .name = "system-sdk", | ||
| .name = .system_sdk, | ||
| .version = "0.1.0", | ||
| .paths = .{ | ||
| "build.zig", | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -211,7 +211,7 @@ pub const BufferView = extern struct { | |
| size: usize, | ||
| stride: usize, // 0 == automatically determined by accessor | ||
| view_type: BufferViewType, | ||
| data: ?*anyopaque, // overrides buffer.data if present, filled by extensions | ||
| override_data: ?*anyopaque, // overrides buffer.data if present, filled by extensions | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new zig v0.14 didn't like that variable and function having the same name |
||
| has_meshopt_compression: Bool32, | ||
| meshopt_compression: MeshoptCompression, | ||
| extras: Extras, | ||
|
|
||
This file contains hidden or 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
86 changes: 86 additions & 0 deletions
86
assets/shaders/built/basic-lighting/basic-lighting_emissive_glsl300es_fragment.glsl
This file contains hidden or 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,86 @@ | ||
| #version 300 es | ||
| precision mediump float; | ||
| precision highp int; | ||
|
|
||
| uniform highp vec4 fs_params[41]; | ||
| uniform highp sampler2D tex_smp; | ||
| uniform highp sampler2D tex_emissive_smp; | ||
|
|
||
| in highp vec2 uv; | ||
| in highp vec4 color; | ||
| in highp vec4 position; | ||
| in highp vec3 normal; | ||
| layout(location = 0) out highp vec4 frag_color; | ||
| in highp vec4 tangent; | ||
|
|
||
| highp float sqr(highp float x) | ||
| { | ||
| return x * x; | ||
| } | ||
|
|
||
| highp float attenuate_light(highp float _distance, highp float radius, highp float max_intensity, highp float falloff) | ||
| { | ||
| highp float _30 = _distance / radius; | ||
| if (_30 >= 1.0) | ||
| { | ||
| return 0.0; | ||
| } | ||
| highp float param = _30; | ||
| highp float param_1 = 1.0 - sqr(param); | ||
| return (max_intensity * sqr(param_1)) / (falloff * _30 + 1.0); | ||
| } | ||
|
|
||
| highp float calcFogFactor(highp float distance_to_eye) | ||
| { | ||
| return clamp(((distance_to_eye - fs_params[39].x) / (fs_params[39].y - fs_params[39].x)) * fs_params[40].w, 0.0, 1.0); | ||
| } | ||
|
|
||
| void main() | ||
| { | ||
| highp vec4 _113 = texture(tex_smp, uv) * color; | ||
| highp vec4 c = _113; | ||
| highp vec4 lit_color = fs_params[3]; | ||
| if (_113.w <= fs_params[2].x) | ||
| { | ||
| discard; | ||
| } | ||
| for (int i = 0; i < int(fs_params[6].x); i++) | ||
| { | ||
| int _145 = i * 2; | ||
| highp vec3 _168 = fs_params[_145 * 1 + 7].xyz - position.xyz; | ||
| highp float param = length(_168); | ||
| highp float param_1 = fs_params[_145 * 1 + 7].w; | ||
| highp float param_2 = 1.0; | ||
| highp float param_3 = 1.0; | ||
| highp vec4 _198 = lit_color; | ||
| highp vec3 _200 = _198.xyz + ((fs_params[(_145 + 1) * 1 + 7].xyz * max(dot(normalize(_168), normal), 0.0)) * attenuate_light(param, param_1, param_2, param_3)); | ||
| highp vec4 _329 = _198; | ||
| _329.x = _200.x; | ||
| _329.y = _200.y; | ||
| _329.z = _200.z; | ||
| lit_color = _329; | ||
| } | ||
| highp vec4 _239 = lit_color; | ||
| highp vec3 _241 = _239.xyz + (fs_params[5].xyz * (max(dot(vec4(fs_params[4].x, fs_params[4].y, fs_params[4].z, 0.0), vec4(normal, 0.0)), 0.0) * fs_params[4].w)); | ||
| highp vec4 _335 = _239; | ||
| _335.x = _241.x; | ||
| _335.y = _241.y; | ||
| _335.z = _241.z; | ||
| lit_color = _335; | ||
| highp vec4 _250 = c * _335; | ||
| highp vec4 _257 = texture(tex_emissive_smp, uv); | ||
| highp vec3 _275 = (_250.xyz * (1.0 - min((_257.x + _257.y) + _257.z, 1.0))) + _257.xyz; | ||
| highp vec4 _344 = _250; | ||
| _344.x = _275.x; | ||
| _344.y = _275.y; | ||
| _344.z = _275.z; | ||
| highp vec3 _296 = (_344.xyz * (1.0 - fs_params[1].w)) + (fs_params[1].xyz * fs_params[1].w); | ||
| highp vec4 _350 = _344; | ||
| _350.x = _296.x; | ||
| _350.y = _296.y; | ||
| _350.z = _296.z; | ||
| c = _350; | ||
| highp float param_4 = length(fs_params[0] - position); | ||
| frag_color = vec4(mix(c.xyz, fs_params[40].xyz, vec3(calcFogFactor(param_4))), 1.0); | ||
| } | ||
|
|
86 changes: 86 additions & 0 deletions
86
assets/shaders/built/basic-lighting/basic-lighting_emissive_glsl300es_fs.glsl
This file contains hidden or 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,86 @@ | ||
| #version 300 es | ||
| precision mediump float; | ||
| precision highp int; | ||
|
|
||
| uniform highp vec4 fs_params[41]; | ||
| uniform highp sampler2D tex_smp; | ||
| uniform highp sampler2D tex_emissive_smp; | ||
|
|
||
| in highp vec2 uv; | ||
| in highp vec4 color; | ||
| in highp vec4 position; | ||
| in highp vec3 normal; | ||
| layout(location = 0) out highp vec4 frag_color; | ||
| in highp vec4 tangent; | ||
|
|
||
| highp float sqr(highp float x) | ||
| { | ||
| return x * x; | ||
| } | ||
|
|
||
| highp float attenuate_light(highp float _distance, highp float radius, highp float max_intensity, highp float falloff) | ||
| { | ||
| highp float _30 = _distance / radius; | ||
| if (_30 >= 1.0) | ||
| { | ||
| return 0.0; | ||
| } | ||
| highp float param = _30; | ||
| highp float param_1 = 1.0 - sqr(param); | ||
| return (max_intensity * sqr(param_1)) / (falloff * _30 + 1.0); | ||
| } | ||
|
|
||
| highp float calcFogFactor(highp float distance_to_eye) | ||
| { | ||
| return clamp(((distance_to_eye - fs_params[39].x) / (fs_params[39].y - fs_params[39].x)) * fs_params[40].w, 0.0, 1.0); | ||
| } | ||
|
|
||
| void main() | ||
| { | ||
| highp vec4 _113 = texture(tex_smp, uv) * color; | ||
| highp vec4 c = _113; | ||
| highp vec4 lit_color = fs_params[3]; | ||
| if (_113.w <= fs_params[2].x) | ||
| { | ||
| discard; | ||
| } | ||
| for (int i = 0; i < int(fs_params[6].x); i++) | ||
| { | ||
| int _145 = i * 2; | ||
| highp vec3 _168 = fs_params[_145 * 1 + 7].xyz - position.xyz; | ||
| highp float param = length(_168); | ||
| highp float param_1 = fs_params[_145 * 1 + 7].w; | ||
| highp float param_2 = 1.0; | ||
| highp float param_3 = 1.0; | ||
| highp vec4 _198 = lit_color; | ||
| highp vec3 _200 = _198.xyz + ((fs_params[(_145 + 1) * 1 + 7].xyz * max(dot(normalize(_168), normal), 0.0)) * attenuate_light(param, param_1, param_2, param_3)); | ||
| highp vec4 _329 = _198; | ||
| _329.x = _200.x; | ||
| _329.y = _200.y; | ||
| _329.z = _200.z; | ||
| lit_color = _329; | ||
| } | ||
| highp vec4 _239 = lit_color; | ||
| highp vec3 _241 = _239.xyz + (fs_params[5].xyz * (max(dot(vec4(fs_params[4].x, fs_params[4].y, fs_params[4].z, 0.0), vec4(normal, 0.0)), 0.0) * fs_params[4].w)); | ||
| highp vec4 _335 = _239; | ||
| _335.x = _241.x; | ||
| _335.y = _241.y; | ||
| _335.z = _241.z; | ||
| lit_color = _335; | ||
| highp vec4 _250 = c * _335; | ||
| highp vec4 _257 = texture(tex_emissive_smp, uv); | ||
| highp vec3 _275 = (_250.xyz * (1.0 - min((_257.x + _257.y) + _257.z, 1.0))) + _257.xyz; | ||
| highp vec4 _344 = _250; | ||
| _344.x = _275.x; | ||
| _344.y = _275.y; | ||
| _344.z = _275.z; | ||
| highp vec3 _296 = (_344.xyz * (1.0 - fs_params[1].w)) + (fs_params[1].xyz * fs_params[1].w); | ||
| highp vec4 _350 = _344; | ||
| _350.x = _296.x; | ||
| _350.y = _296.y; | ||
| _350.z = _296.z; | ||
| c = _350; | ||
| highp float param_4 = length(fs_params[0] - position); | ||
| frag_color = vec4(mix(c.xyz, fs_params[40].xyz, vec3(calcFogFactor(param_4))), 1.0); | ||
| } | ||
|
|
25 changes: 25 additions & 0 deletions
25
assets/shaders/built/basic-lighting/basic-lighting_emissive_glsl300es_vertex.glsl
This file contains hidden or 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,25 @@ | ||
| #version 300 es | ||
|
|
||
| uniform vec4 vs_params[10]; | ||
| out vec4 color; | ||
| layout(location = 1) in vec4 color0; | ||
| out vec2 uv; | ||
| layout(location = 2) in vec2 texcoord0; | ||
| out vec3 normal; | ||
| layout(location = 3) in vec3 normals; | ||
| out vec4 tangent; | ||
| layout(location = 4) in vec4 tangents; | ||
| out vec4 position; | ||
| layout(location = 0) in vec4 pos; | ||
|
|
||
| void main() | ||
| { | ||
| color = color0 * vs_params[8]; | ||
| uv = texcoord0 + vs_params[9].xy; | ||
| mat4 _40 = mat4(vs_params[4], vs_params[5], vs_params[6], vs_params[7]); | ||
| normal = normalize(_40 * vec4(normals, 0.0)).xyz; | ||
| tangent = tangents; | ||
| position = _40 * pos; | ||
| gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * position; | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addSharedLibrary is deprecated