crated zuck game content and creating hello-window
This commit is contained in:
parent
6bf5b3516f
commit
2e4f7d98e4
68
CLAUDE.md
68
CLAUDE.md
|
|
@ -103,39 +103,67 @@ The shader compilation system automatically discovers `.hlsl` files in `engine/*
|
|||
- Shader development: Add HLSL files to module `shaders/` directories, run `cookShaders.py`
|
||||
- Asset pipeline: Assets go in `projects/content/` and use `.cook` extensions for processed assets
|
||||
|
||||
## Bug Tracking with git-bug
|
||||
## Issue Tracking with git-bug
|
||||
|
||||
This project uses git-bug for distributed bug tracking. Bug data is stored directly in the git repository.
|
||||
This project uses git-bug for distributed issue tracking. Bug data is stored directly in the git repository. While named "git-bug", it can track all types of development work including bugs, features, tasks, and documentation.
|
||||
|
||||
### Common Commands
|
||||
|
||||
- `git bug bug` - List all bugs
|
||||
- `git bug bug new -t "title" -m "message"` - Create a new bug with title and message
|
||||
- `git bug bug show <id>` - Display bug details
|
||||
- `git bug bug comment <id>` - Add a comment to a bug
|
||||
- `git bug bug status <id>` - Display bug status
|
||||
- `git bug bug label new <id> <label>` - Add a label to a bug
|
||||
- `git bug bug label rm <id> <label>` - Remove a label from a bug
|
||||
- `git bug bug label <id>` - Display labels for a bug
|
||||
- `git bug bug status:open` - List only open bugs
|
||||
- `git bug pull` - Pull bug updates from remote
|
||||
- `git bug push` - Push bug updates to remote
|
||||
- `git bug bug` - List all issues
|
||||
- `git bug bug new -t "title" -m "message"` - Create a new issue with title and message
|
||||
- `git bug bug show <id>` - Display issue details
|
||||
- `git bug bug comment <id>` - Add a comment to an issue
|
||||
- `git bug bug status <id>` - Display issue status
|
||||
- `git bug bug label new <id> <label>` - Add a label to an issue
|
||||
- `git bug bug label rm <id> <label>` - Remove a label from an issue
|
||||
- `git bug bug label <id>` - Display labels for an issue
|
||||
- `git bug bug status:open` - List only open issues
|
||||
- `git bug pull` - Pull issue updates from remote
|
||||
- `git bug push` - Push issue updates to remote
|
||||
|
||||
### Workflow
|
||||
|
||||
- Bugs are stored in the repository and sync with `git bug pull`/`git bug push`
|
||||
- Bug IDs can be abbreviated to the first few characters
|
||||
- Use labels to categorize bugs by component (e.g., `core`, `rendering`, `physics`, `build-system`)
|
||||
- Issues are stored in the repository and sync with `git bug pull`/`git bug push`
|
||||
- Issue IDs can be abbreviated to the first few characters
|
||||
- Use labels to categorize issues by both type and component
|
||||
- Use `--non-interactive` flag for scripting
|
||||
- Keep bug descriptions factual - describe what happens, not speculation about why
|
||||
- Keep issue descriptions factual and clear
|
||||
|
||||
### Standard Labels
|
||||
|
||||
Use these standard labels to categorize bugs:
|
||||
Use these standard labels to categorize issues:
|
||||
|
||||
- **Component labels**: `core`, `rendering`, `physics`, `build-system`, `platform`, `assets`, `audio`, `ui`
|
||||
- **Type labels**:
|
||||
- **Component labels**: `core`, `rendering`, `physics`, `build-system`, `platform`, `assets`, `audio`, `ui`, `documentation`
|
||||
- **Issue type labels**:
|
||||
- `bug` - Defects, errors, or incorrect behavior
|
||||
- `feature` - New functionality to implement
|
||||
- `enhancement` - Improvements to existing features
|
||||
- `task` - General development work items
|
||||
- `documentation` - Documentation improvements or additions
|
||||
- `question` - Design decisions or technical discussions
|
||||
- `refactoring` - Code cleanup and restructuring
|
||||
- **Problem type labels** (for bugs):
|
||||
- `memory` - Memory allocation, leaks, or performance issues
|
||||
- `threading` - Job system, parallelization, race conditions, or deadlocks
|
||||
- `crash` - Application crashes or critical failures
|
||||
- `build` - Build system or compilation issues
|
||||
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
# Create a feature request
|
||||
git bug bug new -t "Add procedural terrain generation" -m "Implement heightmap-based terrain system"
|
||||
git bug bug label new <id> feature rendering
|
||||
|
||||
# Create a task
|
||||
git bug bug new -t "Update to Zig 0.15" -m "Migrate codebase to latest Zig version"
|
||||
git bug bug label new <id> task build-system
|
||||
|
||||
# Create a documentation issue
|
||||
git bug bug new -t "Document shader pipeline" -m "Add comprehensive guide for shader development workflow"
|
||||
git bug bug label new <id> documentation rendering
|
||||
|
||||
# Create a bug report
|
||||
git bug bug new -t "Memory leak in asset loader" -m "Assets not freed when unloading scenes"
|
||||
git bug bug label new <id> bug assets memory
|
||||
```
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
.fontcache/
|
||||
Saved/
|
||||
|
|
@ -12,24 +12,24 @@ pub fn build(b: *std.Build) void {
|
|||
});
|
||||
|
||||
// blbuild.addDependencyInstalls(b, .ReleaseFast); //.ReleaseFast);
|
||||
const exileMain = blbuild.program(.{
|
||||
.name = "exileMain",
|
||||
const zuck = blbuild.program(.{
|
||||
.name = "zuck",
|
||||
.desc = "A tiny shooter made with this engine.",
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.root_source_file = b.path("zuck/main.zig"),
|
||||
});
|
||||
|
||||
exileMain.setModuleEnabled("imgui", true);
|
||||
exileMain.setModuleEnabled("audio", true);
|
||||
exileMain.setModuleEnabled("physics", true);
|
||||
exileMain.setModuleEnabled("ui", true);
|
||||
exileMain.setModuleEnabled("sys", true);
|
||||
exileMain.setModuleEnabled("net", true);
|
||||
zuck.setModuleEnabled("imgui", true);
|
||||
zuck.setModuleEnabled("audio", true);
|
||||
zuck.setModuleEnabled("physics", true);
|
||||
zuck.setModuleEnabled("ui", true);
|
||||
zuck.setModuleEnabled("sys", true);
|
||||
zuck.setModuleEnabled("net", true);
|
||||
zuck.addExtraModule("gameExtras");
|
||||
|
||||
{
|
||||
const exileGame = exileMain.addDynamicModule("exileGame", b.path("src/exileGame.zig"));
|
||||
|
||||
_ = exileGame.compileInstall();
|
||||
const zuckGame = zuck.addDynamicModule("zuckGame", b.path("zuck/game.zig"));
|
||||
_ = zuckGame.compileInstall();
|
||||
}
|
||||
|
||||
_ = exileMain.compileInstall();
|
||||
_ = zuck.compileInstall();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
.SpirvReflect = .{ .path = "../lib/spirv-reflect-zig" },
|
||||
|
||||
.gameExtras = .{.path = "../extras/gameExtras"},
|
||||
.videoplayer = .{.path = "../extras/videoplayer"},
|
||||
.doomplayer = .{.path = "../extras/doomplayer"},
|
||||
.bsp = .{.path = "../extras/bsp"},
|
||||
|
||||
.zphysics = .{.path = "../lib/zphysics"},
|
||||
.spng = .{ .path = "../lib/spng" },
|
||||
|
|
@ -34,4 +31,5 @@
|
|||
.paths = .{
|
||||
"",
|
||||
},
|
||||
.fingerprint = 0x14099f73bcfb78d8,
|
||||
}
|
||||
|
|
|
|||
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.
|
|
@ -0,0 +1,25 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
float4 out_var_SV_Target1 [[color(1)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _20 = float4(in.in_var_TEXCOORD0 * 4.0, 1.0);
|
||||
out.out_var_SV_Target0 = _20;
|
||||
out.out_var_SV_Target1 = _20;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float4x4 Model;
|
||||
float4 Color;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float4x4 ViewProjection;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float3 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_Scene& scene [[buffer(1)]], uint gl_InstanceIndex [[instance_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.out_var_TEXCOORD0 = scene._m0[gl_InstanceIndex].Color.xyz;
|
||||
out.gl_Position = Uniforms.ViewProjection * (scene._m0[gl_InstanceIndex].Model * float4(in.in_var_TEXCOORD0, 1.0));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
out.out_var_SV_Target0 = float4(1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float4 viewPos;
|
||||
float4 lightPosition;
|
||||
float4 directionalLight;
|
||||
float4 directionalLightColor;
|
||||
float2 screenSize;
|
||||
float lightPower;
|
||||
float time;
|
||||
};
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float4x4 Model;
|
||||
uint textureMode;
|
||||
int animation;
|
||||
uint flags;
|
||||
float float0;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
constant float4 _92 = {};
|
||||
constant float3 _94 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
float4 out_var_SV_Target1 [[color(1)]];
|
||||
float4 out_var_SV_Target2 [[color(2)]];
|
||||
float4 out_var_SV_Target3 [[color(3)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
float3 in_var_TEXCOORD1 [[user(locn1)]];
|
||||
float3 in_var_TEXCOORD2 [[user(locn2)]];
|
||||
float4 in_var_TEXCOORD3 [[user(locn3)]];
|
||||
uint in_var_TEXCOORD4 [[user(locn4)]];
|
||||
float3 in_var_TEXCOORD5 [[user(locn5)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_Scene& scene [[buffer(1)]], texture2d<float> Texture0 [[texture(0)]], texture2d<float> Texture1 [[texture(1)]], texture2d<float> Texture2 [[texture(2)]], texture2d<float> DirectionalShadowDepthMap [[texture(3)]], sampler Sampler0 [[sampler(0)]], sampler Sampler1 [[sampler(1)]], sampler Sampler2 [[sampler(2)]], sampler DirectionalShadowSampler [[sampler(3)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
int _104 = int(scene._m0[in.in_var_TEXCOORD4].textureMode);
|
||||
int _105 = _104 & 240;
|
||||
float4 _139;
|
||||
if (_105 == 16)
|
||||
{
|
||||
float3 _126 = float3(Texture0.sample(Sampler0, in.in_var_TEXCOORD0).x, Texture1.sample(Sampler1, in.in_var_TEXCOORD0).x, Texture2.sample(Sampler2, in.in_var_TEXCOORD0).x) + float3(-0.0625, -0.5, -0.5);
|
||||
_139 = float4(dot(_126, float3(1.164000034332275390625, 0.0, 1.7929999828338623046875)), dot(_126, float3(1.164000034332275390625, -0.212999999523162841796875, -0.53299999237060546875)), dot(_126, float3(1.164000034332275390625, 2.111999988555908203125, 0.0)), 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
float4 _138;
|
||||
if (_105 == 0)
|
||||
{
|
||||
_138 = Texture0.sample(Sampler0, in.in_var_TEXCOORD0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_138 = _92;
|
||||
}
|
||||
_139 = _138;
|
||||
}
|
||||
float4 _145;
|
||||
if ((_104 & 1) == 1)
|
||||
{
|
||||
_145 = powr(_139, float4(2.2000000476837158203125));
|
||||
}
|
||||
else
|
||||
{
|
||||
_145 = _139;
|
||||
}
|
||||
if (_145.w < 0.00999999977648258209228515625)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
float3 _155 = float3(0.800000011920928955078125, 0.800000011920928955078125, 0.5) * Uniforms.lightPower;
|
||||
float3 _202;
|
||||
do
|
||||
{
|
||||
float3 _159 = Uniforms.lightPosition.xyz - in.in_var_TEXCOORD1;
|
||||
float _160 = length(_159);
|
||||
float _161 = _160 * _160;
|
||||
float _167;
|
||||
if (_160 > 2.0)
|
||||
{
|
||||
_167 = 0.5 / _161;
|
||||
}
|
||||
else
|
||||
{
|
||||
_167 = 1.0 / _161;
|
||||
}
|
||||
float _172;
|
||||
if (_160 > 4.0)
|
||||
{
|
||||
_172 = _167 * 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
_172 = _167;
|
||||
}
|
||||
float _174 = (_160 > 15.0) ? 0.0 : _172;
|
||||
float _176 = (_174 > 1.0) ? 1.0 : _174;
|
||||
if (length(in.in_var_TEXCOORD2) < 0.100000001490116119384765625)
|
||||
{
|
||||
_202 = (in.in_var_TEXCOORD1 * _155) * _176;
|
||||
break;
|
||||
}
|
||||
float3 _183 = fast::normalize(_159);
|
||||
_202 = ((_155 * precise::max(dot(_183, in.in_var_TEXCOORD2), 0.0)) * _176) + (((_155 * powr(precise::max(dot(in.in_var_TEXCOORD2, fast::normalize(_183 + fast::normalize(in.in_var_TEXCOORD1 - Uniforms.viewPos.xyz))), 0.0), 30.0)) * 2.0) * _176);
|
||||
break;
|
||||
} while(false);
|
||||
float3 _219 = ((in.in_var_TEXCOORD3.xyz / float3(in.in_var_TEXCOORD3.w)) * 0.5) + float3(0.5);
|
||||
float3 _221;
|
||||
_221.x = _219.x;
|
||||
float2 _222 = _221.xy;
|
||||
_222.y = -_219.y;
|
||||
float _229;
|
||||
int _232;
|
||||
int _234;
|
||||
_229 = 0.0;
|
||||
_232 = 0;
|
||||
_234 = -2;
|
||||
float _230;
|
||||
int _233;
|
||||
for (; _234 <= 2; _229 = _230, _232 = _233, _234++)
|
||||
{
|
||||
_233 = _232;
|
||||
_230 = _229;
|
||||
for (int _243 = -2; _243 <= 2; )
|
||||
{
|
||||
_233++;
|
||||
_230 += float((in.in_var_TEXCOORD3.z - 0.0030000000260770320892333984375) > DirectionalShadowDepthMap.sample(DirectionalShadowSampler, (_222 + float2(float(_243) * 0.000244140625, float(_234) * 0.000244140625))).x);
|
||||
_243++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
float3 _272;
|
||||
if ((_104 & 2) > 0)
|
||||
{
|
||||
_272 = powr(_145.xyz, float3(0.4545454680919647216796875));
|
||||
}
|
||||
else
|
||||
{
|
||||
_272 = _145.xyz * ((float3(0.100000001490116119384765625) + _202) + ((Uniforms.directionalLightColor.xyz * precise::max(dot(Uniforms.directionalLight.xyz, in.in_var_TEXCOORD2), 0.0)) * (1.0 - (_229 / float(_232)))));
|
||||
}
|
||||
float4 _289;
|
||||
if (_272.x > 1.0)
|
||||
{
|
||||
float4 _288 = float4(0.0);
|
||||
_288.x = _272.x;
|
||||
_289 = _288;
|
||||
}
|
||||
else
|
||||
{
|
||||
_289 = float4(0.0);
|
||||
}
|
||||
float4 _294;
|
||||
if (_272.y > 1.0)
|
||||
{
|
||||
float4 _293 = _289;
|
||||
_293.y = _272.y;
|
||||
_294 = _293;
|
||||
}
|
||||
else
|
||||
{
|
||||
_294 = _289;
|
||||
}
|
||||
float4 _299;
|
||||
if (_272.z > 1.0)
|
||||
{
|
||||
float4 _298 = _294;
|
||||
_298.z = _272.z;
|
||||
_299 = _298;
|
||||
}
|
||||
else
|
||||
{
|
||||
_299 = _294;
|
||||
}
|
||||
out.out_var_SV_Target0 = float4(_272, _145.w);
|
||||
out.out_var_SV_Target1 = _299;
|
||||
out.out_var_SV_Target2 = float4(in.in_var_TEXCOORD1, 1.0);
|
||||
out.out_var_SV_Target3 = float4(in.in_var_TEXCOORD5, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float4x4 Model;
|
||||
uint textureMode;
|
||||
int animation;
|
||||
uint flags;
|
||||
float float0;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
struct BoneTransform
|
||||
{
|
||||
float4x4 final;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_BoneTransform
|
||||
{
|
||||
BoneTransform _m0[1];
|
||||
};
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float4x4 ViewProjection;
|
||||
float4x4 NoTranslateView;
|
||||
float4x4 ViewTransform;
|
||||
float4x4 ShadowMapProjection;
|
||||
float4 cameraPosition;
|
||||
float time;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float3 out_var_TEXCOORD1 [[user(locn1)]];
|
||||
float3 out_var_TEXCOORD2 [[user(locn2)]];
|
||||
float4 out_var_TEXCOORD3 [[user(locn3)]];
|
||||
uint out_var_TEXCOORD4 [[user(locn4)]];
|
||||
float3 out_var_TEXCOORD5 [[user(locn5)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
float3 in_var_TEXCOORD1 [[attribute(1)]];
|
||||
float2 in_var_TEXCOORD3 [[attribute(3)]];
|
||||
uint in_var_TEXCOORD4 [[attribute(4)]];
|
||||
uint in_var_TEXCOORD5 [[attribute(5)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_Scene& scene [[buffer(1)]], const device type_StructuredBuffer_BoneTransform& animationBuffer [[buffer(2)]], uint gl_InstanceIndex [[instance_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float3 _111;
|
||||
if (scene._m0[gl_InstanceIndex].animation != (-1))
|
||||
{
|
||||
float3 _83;
|
||||
_83 = float3(0.0);
|
||||
for (int _86 = 0; _86 < 4; )
|
||||
{
|
||||
uint _92 = (8u * uint(_86)) & 31u;
|
||||
_83 += ((animationBuffer._m0[uint(scene._m0[gl_InstanceIndex].animation) + ((in.in_var_TEXCOORD4 >> _92) & 255u)].final * float4(in.in_var_TEXCOORD0, 1.0)).xyz * (float((in.in_var_TEXCOORD5 >> _92) & 255u) * 0.0039215688593685626983642578125));
|
||||
_86++;
|
||||
continue;
|
||||
}
|
||||
_111 = _83;
|
||||
}
|
||||
else
|
||||
{
|
||||
_111 = in.in_var_TEXCOORD0;
|
||||
}
|
||||
float4 _115 = float4(_111, 1.0);
|
||||
float3 _207;
|
||||
float3 _208;
|
||||
float3 _209;
|
||||
float4 _210;
|
||||
float4 _211;
|
||||
if (int(scene._m0[gl_InstanceIndex].flags & 4u) > 0)
|
||||
{
|
||||
float3 _127 = (scene._m0[gl_InstanceIndex].Model * float4(0.0, 0.0, 0.0, 1.0)).xyz;
|
||||
float3 _132 = fast::normalize(Uniforms.cameraPosition.xyz - _127);
|
||||
float3 _134 = fast::normalize(cross(float3(0.0, 1.0, 0.0), _132));
|
||||
float4 _152 = float4((_127 + ((_134 * (-in.in_var_TEXCOORD0.x)) * scene._m0[gl_InstanceIndex].float0)) + ((cross(_132, _134) * in.in_var_TEXCOORD0.y) * scene._m0[gl_InstanceIndex].float0), 1.0);
|
||||
_207 = _152.xyz;
|
||||
_208 = _132;
|
||||
_209 = float3(0.0, 0.0, 1.0);
|
||||
_210 = Uniforms.ViewProjection * _152;
|
||||
_211 = _152;
|
||||
}
|
||||
else
|
||||
{
|
||||
float4 _159 = scene._m0[gl_InstanceIndex].Model * _115;
|
||||
float4x4 _194 = float4x4(float4(fast::normalize(float3(scene._m0[gl_InstanceIndex].Model[0][0], scene._m0[gl_InstanceIndex].Model[1][0], scene._m0[gl_InstanceIndex].Model[2][0])), 0.0), float4(fast::normalize(float3(scene._m0[gl_InstanceIndex].Model[0][1], scene._m0[gl_InstanceIndex].Model[1][1], scene._m0[gl_InstanceIndex].Model[2][1])), 0.0), float4(fast::normalize(float3(scene._m0[gl_InstanceIndex].Model[0][2], scene._m0[gl_InstanceIndex].Model[1][2], scene._m0[gl_InstanceIndex].Model[2][2])), 0.0), float4(0.0, 0.0, 0.0, 1.0));
|
||||
float4 _198 = float4(in.in_var_TEXCOORD1, 1.0);
|
||||
_207 = _159.xyz;
|
||||
_208 = fast::normalize(_198 * _194).xyz;
|
||||
_209 = (_198 * (_194 * transpose(Uniforms.NoTranslateView))).xyz;
|
||||
_210 = Uniforms.ViewProjection * (scene._m0[gl_InstanceIndex].Model * _115);
|
||||
_211 = _159;
|
||||
}
|
||||
out.out_var_TEXCOORD0 = in.in_var_TEXCOORD3;
|
||||
out.out_var_TEXCOORD1 = _207;
|
||||
out.out_var_TEXCOORD2 = _208;
|
||||
out.out_var_TEXCOORD3 = Uniforms.ShadowMapProjection * _211;
|
||||
out.out_var_TEXCOORD4 = gl_InstanceIndex;
|
||||
out.out_var_TEXCOORD5 = _209;
|
||||
out.gl_Position = _210;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> ColorTexture [[texture(0)]], texture2d<float> EmissiveTexture [[texture(1)]], texture2d<float> SsaoTexture [[texture(2)]], sampler Sampler0 [[sampler(0)]], sampler Sampler1 [[sampler(1)]], sampler Sampler2 [[sampler(2)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float2 _51 = in.in_var_TEXCOORD0;
|
||||
_51.y = (_51.y * (-1.0)) + 1.0;
|
||||
float4 _59 = ColorTexture.sample(Sampler0, _51);
|
||||
float3 _60 = _59.xyz;
|
||||
float3 _74;
|
||||
int _77;
|
||||
_74 = EmissiveTexture.sample(Sampler1, _51).xyz * 0.2270270287990570068359375;
|
||||
_77 = 0;
|
||||
float3 _75;
|
||||
for (; _77 < 5; _74 = _75, _77++)
|
||||
{
|
||||
_75 = _74;
|
||||
for (int _85 = 0; _85 < 5; )
|
||||
{
|
||||
float2 _93 = float2(float(_77) - 2.5, float(_85)) * float2(0.001953125);
|
||||
_75 = (_75 + (EmissiveTexture.sample(Sampler1, (_51 + _93)).xyz * float3(0.039999999105930328369140625))) + (EmissiveTexture.sample(Sampler1, (_51 - _93)).xyz * float3(0.039999999105930328369140625));
|
||||
_85++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
float3 _109;
|
||||
int _112;
|
||||
_109 = float3(0.0);
|
||||
_112 = 0;
|
||||
float3 _110;
|
||||
for (; _112 < 5; _109 = _110, _112++)
|
||||
{
|
||||
_110 = _109;
|
||||
for (int _120 = 0; _120 < 5; )
|
||||
{
|
||||
float2 _128 = float2(float(_112) - 2.5, float(_120)) * float2(0.0009765625);
|
||||
_110 = (_110 + (SsaoTexture.sample(Sampler2, (_51 + _128)).xyz * float3(0.0199999995529651641845703125))) + (SsaoTexture.sample(Sampler2, (_51 - _128)).xyz * float3(0.0199999995529651641845703125));
|
||||
_120++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
float3 _142 = ((powr((_60 * (float3(1.0) + (_60 * float3(0.00999999977648258209228515625)))) / (float3(1.0) + _60), float3(0.4545454680919647216796875)) + (_74 * 0.0500000007450580596923828125)) * 1.0) * _109;
|
||||
out.out_var_SV_Target0 = float4(((_142.x * (1.0 + (9.9999999747524270787835121154785e-07 * EmissiveTexture.sample(Sampler1, _51).x))) * (1.0 + (9.9999999747524270787835121154785e-07 * ColorTexture.sample(Sampler0, _51).x))) * (1.0 + (9.9999999747524270787835121154785e-07 * SsaoTexture.sample(Sampler2, _51).x)), _142.yz, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
float2 in_var_TEXCOORD3 [[attribute(3)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.out_var_TEXCOORD0 = in.in_var_TEXCOORD3;
|
||||
out.gl_Position = float4(in.in_var_TEXCOORD0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,259 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float2 imagePosition;
|
||||
float2 _imageSize;
|
||||
float2 anchorPoint;
|
||||
float2 scale;
|
||||
float alpha;
|
||||
float borderWidth;
|
||||
uint flags;
|
||||
float4 baseColor;
|
||||
float4 rounding;
|
||||
float4 edgeColor;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
float2 in_var_TEXCOORD1 [[user(locn1)]];
|
||||
float2 in_var_TEXCOORD2 [[user(locn2)]];
|
||||
uint in_var_TEXCOORD3 [[user(locn3)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_Scene& scene [[buffer(0)]], texture2d<float> Texture0 [[texture(0)]], sampler Sampler0 [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
bool _71 = in.in_var_TEXCOORD2.x < scene._m0[in.in_var_TEXCOORD3].rounding.x;
|
||||
bool _78;
|
||||
if (_71)
|
||||
{
|
||||
_78 = in.in_var_TEXCOORD2.y < scene._m0[in.in_var_TEXCOORD3].rounding.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
_78 = false;
|
||||
}
|
||||
float _95;
|
||||
float3 _96;
|
||||
if (_78)
|
||||
{
|
||||
float _82 = distance(in.in_var_TEXCOORD2, float2(scene._m0[in.in_var_TEXCOORD3].rounding.x));
|
||||
float _93;
|
||||
float3 _94;
|
||||
if (_82 > scene._m0[in.in_var_TEXCOORD3].rounding.x)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abs(_82 - scene._m0[in.in_var_TEXCOORD3].rounding.x) < 1.0)
|
||||
{
|
||||
_93 = scene._m0[in.in_var_TEXCOORD3].edgeColor.w;
|
||||
_94 = scene._m0[in.in_var_TEXCOORD3].edgeColor.xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
_93 = scene._m0[in.in_var_TEXCOORD3].alpha;
|
||||
_94 = in.in_var_TEXCOORD0.xyz;
|
||||
}
|
||||
}
|
||||
_95 = _93;
|
||||
_96 = _94;
|
||||
}
|
||||
else
|
||||
{
|
||||
_95 = scene._m0[in.in_var_TEXCOORD3].alpha;
|
||||
_96 = in.in_var_TEXCOORD0.xyz;
|
||||
}
|
||||
float _99 = scene._m0[in.in_var_TEXCOORD3]._imageSize.x - scene._m0[in.in_var_TEXCOORD3].rounding.y;
|
||||
bool _106;
|
||||
if (in.in_var_TEXCOORD2.x > _99)
|
||||
{
|
||||
_106 = in.in_var_TEXCOORD2.y < scene._m0[in.in_var_TEXCOORD3].rounding.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
_106 = false;
|
||||
}
|
||||
float _123;
|
||||
float3 _124;
|
||||
if (_106)
|
||||
{
|
||||
float _110 = distance(in.in_var_TEXCOORD2, float2(_99, scene._m0[in.in_var_TEXCOORD3].rounding.y));
|
||||
float _121;
|
||||
float3 _122;
|
||||
if (_110 > scene._m0[in.in_var_TEXCOORD3].rounding.y)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abs(_110 - scene._m0[in.in_var_TEXCOORD3].rounding.y) < 1.0)
|
||||
{
|
||||
_121 = scene._m0[in.in_var_TEXCOORD3].edgeColor.w;
|
||||
_122 = scene._m0[in.in_var_TEXCOORD3].edgeColor.xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
_121 = _95;
|
||||
_122 = _96;
|
||||
}
|
||||
}
|
||||
_123 = _121;
|
||||
_124 = _122;
|
||||
}
|
||||
else
|
||||
{
|
||||
_123 = _95;
|
||||
_124 = _96;
|
||||
}
|
||||
bool _132;
|
||||
if (_71)
|
||||
{
|
||||
_132 = in.in_var_TEXCOORD2.y > (scene._m0[in.in_var_TEXCOORD3]._imageSize.y - scene._m0[in.in_var_TEXCOORD3].rounding.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
_132 = false;
|
||||
}
|
||||
float _151;
|
||||
float3 _152;
|
||||
if (_132)
|
||||
{
|
||||
float _138 = distance(in.in_var_TEXCOORD2, float2(scene._m0[in.in_var_TEXCOORD3].rounding.x, scene._m0[in.in_var_TEXCOORD3]._imageSize.y - scene._m0[in.in_var_TEXCOORD3].rounding.y));
|
||||
float _149;
|
||||
float3 _150;
|
||||
if (_138 > scene._m0[in.in_var_TEXCOORD3].rounding.y)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abs(_138 - scene._m0[in.in_var_TEXCOORD3].rounding.y) < 1.0)
|
||||
{
|
||||
_149 = scene._m0[in.in_var_TEXCOORD3].edgeColor.w;
|
||||
_150 = scene._m0[in.in_var_TEXCOORD3].edgeColor.xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
_149 = _123;
|
||||
_150 = _124;
|
||||
}
|
||||
}
|
||||
_151 = _149;
|
||||
_152 = _150;
|
||||
}
|
||||
else
|
||||
{
|
||||
_151 = _123;
|
||||
_152 = _124;
|
||||
}
|
||||
bool _163;
|
||||
if (in.in_var_TEXCOORD2.x > (scene._m0[in.in_var_TEXCOORD3]._imageSize.x - scene._m0[in.in_var_TEXCOORD3].rounding.w))
|
||||
{
|
||||
_163 = (scene._m0[in.in_var_TEXCOORD3]._imageSize.y - in.in_var_TEXCOORD2.y) < scene._m0[in.in_var_TEXCOORD3].rounding.w;
|
||||
}
|
||||
else
|
||||
{
|
||||
_163 = false;
|
||||
}
|
||||
float _183;
|
||||
float3 _184;
|
||||
if (_163)
|
||||
{
|
||||
float _170 = distance(in.in_var_TEXCOORD2, float2(scene._m0[in.in_var_TEXCOORD3]._imageSize.x - scene._m0[in.in_var_TEXCOORD3].rounding.x, scene._m0[in.in_var_TEXCOORD3]._imageSize.y - scene._m0[in.in_var_TEXCOORD3].rounding.y));
|
||||
float _181;
|
||||
float3 _182;
|
||||
if (_170 > scene._m0[in.in_var_TEXCOORD3].rounding.y)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abs(_170 - scene._m0[in.in_var_TEXCOORD3].rounding.y) < 1.0)
|
||||
{
|
||||
_181 = scene._m0[in.in_var_TEXCOORD3].edgeColor.w;
|
||||
_182 = scene._m0[in.in_var_TEXCOORD3].edgeColor.xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
_181 = _151;
|
||||
_182 = _152;
|
||||
}
|
||||
}
|
||||
_183 = _181;
|
||||
_184 = _182;
|
||||
}
|
||||
else
|
||||
{
|
||||
_183 = _151;
|
||||
_184 = _152;
|
||||
}
|
||||
bool _191;
|
||||
if (!(in.in_var_TEXCOORD2.x < scene._m0[in.in_var_TEXCOORD3].borderWidth))
|
||||
{
|
||||
_191 = in.in_var_TEXCOORD2.x > (scene._m0[in.in_var_TEXCOORD3]._imageSize.x - scene._m0[in.in_var_TEXCOORD3].borderWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
_191 = true;
|
||||
}
|
||||
bool _198;
|
||||
if (!_191)
|
||||
{
|
||||
_198 = in.in_var_TEXCOORD2.y < scene._m0[in.in_var_TEXCOORD3].borderWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
_198 = true;
|
||||
}
|
||||
bool _207;
|
||||
if (!_198)
|
||||
{
|
||||
_207 = in.in_var_TEXCOORD2.y > (scene._m0[in.in_var_TEXCOORD3]._imageSize.y - scene._m0[in.in_var_TEXCOORD3].borderWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
_207 = true;
|
||||
}
|
||||
float _212;
|
||||
float3 _213;
|
||||
if (_207)
|
||||
{
|
||||
_212 = scene._m0[in.in_var_TEXCOORD3].edgeColor.w;
|
||||
_213 = scene._m0[in.in_var_TEXCOORD3].edgeColor.xyz;
|
||||
}
|
||||
else
|
||||
{
|
||||
_212 = _183;
|
||||
_213 = _184;
|
||||
}
|
||||
float4 _238;
|
||||
if ((scene._m0[in.in_var_TEXCOORD3].flags & 1u) > 0u)
|
||||
{
|
||||
float4 _227 = Texture0.sample(Sampler0, float2(in.in_var_TEXCOORD1.x, 1.0 - in.in_var_TEXCOORD1.y));
|
||||
_238 = float4(_227.xyz, _227.w * _212);
|
||||
}
|
||||
else
|
||||
{
|
||||
_238 = float4(_213, _212);
|
||||
}
|
||||
out.out_var_SV_Target0 = _238;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float2 imagePosition;
|
||||
float2 _imageSize;
|
||||
float2 anchorPoint;
|
||||
float2 scale;
|
||||
float alpha;
|
||||
float borderWidth;
|
||||
uint flags;
|
||||
float4 baseColor;
|
||||
float4 rounding;
|
||||
float4 edgeColor;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float2 Extents;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float2 out_var_TEXCOORD1 [[user(locn1)]];
|
||||
float2 out_var_TEXCOORD2 [[user(locn2)]];
|
||||
uint out_var_TEXCOORD3 [[user(locn3)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
float2 in_var_TEXCOORD3 [[attribute(3)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_Scene& scene [[buffer(1)]], uint gl_InstanceIndex [[instance_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float2 _63 = scene._m0[gl_InstanceIndex]._imageSize / Uniforms.Extents;
|
||||
float2 _69 = (((scene._m0[gl_InstanceIndex].imagePosition / Uniforms.Extents) * 2.0) - float2(1.0)) - ((scene._m0[gl_InstanceIndex].anchorPoint * _63) * scene._m0[gl_InstanceIndex].scale);
|
||||
float _85 = _69.y + ((in.in_var_TEXCOORD0.y * _63.y) * scene._m0[gl_InstanceIndex].scale.y);
|
||||
float4 _88 = float4(_69.x + ((in.in_var_TEXCOORD0.x * _63.x) * scene._m0[gl_InstanceIndex].scale.x), _85, in.in_var_TEXCOORD0.z, 1.0);
|
||||
_88.y = -_85;
|
||||
float2 _100 = ((in.in_var_TEXCOORD0.xy - scene._m0[gl_InstanceIndex].anchorPoint) * float2(0.5)) * scene._m0[gl_InstanceIndex]._imageSize;
|
||||
_100.y = scene._m0[gl_InstanceIndex]._imageSize.y - _100.y;
|
||||
out.out_var_TEXCOORD0 = scene._m0[gl_InstanceIndex].baseColor;
|
||||
out.out_var_TEXCOORD1 = float2(1.0 - in.in_var_TEXCOORD3.x, in.in_var_TEXCOORD3.y);
|
||||
out.out_var_TEXCOORD2 = _100;
|
||||
out.out_var_TEXCOORD3 = gl_InstanceIndex;
|
||||
out.gl_Position = _88;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.out_var_SV_Target0 = in.in_var_TEXCOORD0;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float3 color;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
constant float2 _31 = {};
|
||||
constant float4 _32 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(const device type_StructuredBuffer_Scene& test [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _71;
|
||||
float2 _72;
|
||||
if (gl_VertexIndex == 0u)
|
||||
{
|
||||
_71 = float4(test._m0[0u].color, 1.0);
|
||||
_72 = float2(-1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
float4 _69;
|
||||
float2 _70;
|
||||
if (gl_VertexIndex == 1u)
|
||||
{
|
||||
_69 = float4(test._m0[1u].color, 1.0);
|
||||
_70 = float2(1.0, -1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool _57 = gl_VertexIndex == 2u;
|
||||
float4 _66;
|
||||
if (_57)
|
||||
{
|
||||
_66 = float4(test._m0[2u].color, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_66 = _32;
|
||||
}
|
||||
_69 = _66;
|
||||
_70 = select(_31, float2(0.0, 1.0), bool2(_57));
|
||||
}
|
||||
_71 = _69;
|
||||
_72 = _70;
|
||||
}
|
||||
out.out_var_TEXCOORD0 = _71;
|
||||
out.gl_Position = float4(_72, 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float brightnessFactor;
|
||||
};
|
||||
|
||||
constant float4 _28 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
float4 out_var_SV_Target1 [[color(1)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], texturecube<float> SkyboxTexture [[texture(0)]], sampler SkyboxSampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _38 = SkyboxTexture.sample(SkyboxSampler, in.in_var_TEXCOORD0) * Uniforms.brightnessFactor;
|
||||
out.out_var_SV_Target0 = _38;
|
||||
out.out_var_SV_Target1 = select(_28, _38, bool4(length(_38) > 1.0));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float4x4 ViewProjection;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float3 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.out_var_TEXCOORD0 = in.in_var_TEXCOORD0;
|
||||
out.gl_Position = Uniforms.ViewProjection * float4(in.in_var_TEXCOORD0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,66 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Scene
|
||||
{
|
||||
float4 color;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_Scene
|
||||
{
|
||||
Scene _m0[1];
|
||||
};
|
||||
|
||||
constant float2 _30 = {};
|
||||
constant float4 _31 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(const device type_StructuredBuffer_Scene& test [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _58;
|
||||
float2 _59;
|
||||
if (gl_VertexIndex == 0u)
|
||||
{
|
||||
_58 = test._m0[0u].color;
|
||||
_59 = float2(-1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
float4 _56;
|
||||
float2 _57;
|
||||
if (gl_VertexIndex == 1u)
|
||||
{
|
||||
_56 = test._m0[1u].color;
|
||||
_57 = float2(1.0, -1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool _48 = gl_VertexIndex == 2u;
|
||||
float4 _53;
|
||||
if (_48)
|
||||
{
|
||||
_53 = test._m0[2u].color;
|
||||
}
|
||||
else
|
||||
{
|
||||
_53 = _31;
|
||||
}
|
||||
_56 = _53;
|
||||
_57 = select(_30, float2(0.0, 1.0), bool2(_48));
|
||||
}
|
||||
_58 = _56;
|
||||
_59 = _57;
|
||||
}
|
||||
out.out_var_TEXCOORD0 = _58;
|
||||
out.gl_Position = float4(_59, 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct FontInfo
|
||||
{
|
||||
float2 position;
|
||||
float2 size;
|
||||
uint isSdf;
|
||||
uint pad0;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_FontInfo
|
||||
{
|
||||
FontInfo _m0[1];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 out_var_SV_Target0 [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
uint in_var_TEXCOORD0 [[user(locn0)]];
|
||||
float2 in_var_TEXCOORD1 [[user(locn1)]];
|
||||
float2 in_var_TEXCOORD2 [[user(locn2)]];
|
||||
uint in_var_TEXCOORD3 [[user(locn3)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredBuffer_FontInfo& fontBuffer [[buffer(0)]], texture2d<float> Texture0 [[texture(0)]], sampler Sampler0 [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _67 = Texture0.sample(Sampler0, in.in_var_TEXCOORD1);
|
||||
bool _104;
|
||||
do
|
||||
{
|
||||
bool _85;
|
||||
if (in.in_var_TEXCOORD2.x >= fontBuffer._m0[in.in_var_TEXCOORD3].position.x)
|
||||
{
|
||||
_85 = in.in_var_TEXCOORD2.x <= (fontBuffer._m0[in.in_var_TEXCOORD3].position.x + fontBuffer._m0[in.in_var_TEXCOORD3].size.x);
|
||||
}
|
||||
else
|
||||
{
|
||||
_85 = false;
|
||||
}
|
||||
bool _92;
|
||||
if (_85)
|
||||
{
|
||||
_92 = in.in_var_TEXCOORD2.y >= fontBuffer._m0[in.in_var_TEXCOORD3].position.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
_92 = false;
|
||||
}
|
||||
bool _101;
|
||||
if (_92)
|
||||
{
|
||||
_101 = in.in_var_TEXCOORD2.y <= (fontBuffer._m0[in.in_var_TEXCOORD3].position.y + fontBuffer._m0[in.in_var_TEXCOORD3].size.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
_101 = false;
|
||||
}
|
||||
if (_101)
|
||||
{
|
||||
_104 = true;
|
||||
break;
|
||||
}
|
||||
_104 = false;
|
||||
break;
|
||||
} while(false);
|
||||
if (!_104)
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
float _110 = float(in.in_var_TEXCOORD0 & 255u) * 0.0039215688593685626983642578125;
|
||||
float _114 = float((in.in_var_TEXCOORD0 >> 8u) & 255u) * 0.0039215688593685626983642578125;
|
||||
float _118 = float((in.in_var_TEXCOORD0 >> 16u) & 255u) * 0.0039215688593685626983642578125;
|
||||
float _122 = float((in.in_var_TEXCOORD0 >> 24u) & 255u) * 0.0039215688593685626983642578125;
|
||||
float4 _187;
|
||||
if (fontBuffer._m0[in.in_var_TEXCOORD3].isSdf == 1u)
|
||||
{
|
||||
float _128 = _67.x;
|
||||
float _129 = fwidth(_128);
|
||||
float _130 = 0.529411792755126953125 - _129;
|
||||
float _131 = 0.529411792755126953125 + _129;
|
||||
float2 _137 = (dfdx(in.in_var_TEXCOORD1) + dfdy(in.in_var_TEXCOORD1)) * 0.3540000021457672119140625;
|
||||
float4 _144 = float4(in.in_var_TEXCOORD1 - _137, in.in_var_TEXCOORD1 + _137);
|
||||
float4 _176 = float4(_110, _114, _118, ((fast::clamp(smoothstep(_130, _131, _128), 0.0, 1.0) + (0.5 * (((fast::clamp(smoothstep(_130, _131, Texture0.sample(Sampler0, _144.xy).x), 0.0, 1.0) + fast::clamp(smoothstep(_130, _131, Texture0.sample(Sampler0, _144.zw).x), 0.0, 1.0)) + fast::clamp(smoothstep(_130, _131, Texture0.sample(Sampler0, _144.xw).x), 0.0, 1.0)) + fast::clamp(smoothstep(_130, _131, Texture0.sample(Sampler0, _144.zy).x), 0.0, 1.0)))) * 0.3333333432674407958984375) * _122);
|
||||
float3 _178 = powr(_176.xyz, float3(2.2000000476837158203125));
|
||||
_187 = float4(_178.x, _178.y, _178.z, _176.w);
|
||||
}
|
||||
else
|
||||
{
|
||||
_187 = float4(_110, _114, _118, powr(_67.x / dot(float4(_110, _114, _118, _122).xyz, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)), 0.4545454680919647216796875) * _122);
|
||||
}
|
||||
out.out_var_SV_Target0 = _187;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct FontInfo
|
||||
{
|
||||
float2 position;
|
||||
float2 size;
|
||||
uint isSdf;
|
||||
uint pad0;
|
||||
};
|
||||
|
||||
struct type_StructuredBuffer_FontInfo
|
||||
{
|
||||
FontInfo _m0[1];
|
||||
};
|
||||
|
||||
struct type_Uniforms
|
||||
{
|
||||
float2 Extents;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
uint out_var_TEXCOORD0 [[user(locn0)]];
|
||||
float2 out_var_TEXCOORD1 [[user(locn1)]];
|
||||
float2 out_var_TEXCOORD2 [[user(locn2)]];
|
||||
uint out_var_TEXCOORD3 [[user(locn3)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 in_var_TEXCOORD0 [[attribute(0)]];
|
||||
float2 in_var_TEXCOORD1 [[attribute(1)]];
|
||||
uint in_var_TEXCOORD2 [[attribute(2)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], const device type_StructuredBuffer_FontInfo& fontBuffer [[buffer(1)]], uint gl_InstanceIndex [[instance_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float2 _46 = in.in_var_TEXCOORD0 + fontBuffer._m0[gl_InstanceIndex].position;
|
||||
float2 _51 = ((_46 / Uniforms.Extents) * 2.0) + float2(-1.0);
|
||||
float4 _54 = float4(_51, 0.0, 1.0);
|
||||
_54.y = -_51.y;
|
||||
out.out_var_TEXCOORD0 = in.in_var_TEXCOORD2;
|
||||
out.out_var_TEXCOORD1 = in.in_var_TEXCOORD1;
|
||||
out.out_var_TEXCOORD2 = _46;
|
||||
out.out_var_TEXCOORD3 = gl_InstanceIndex;
|
||||
out.gl_Position = _54;
|
||||
return out;
|
||||
}
|
||||
|
||||
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.
|
|
@ -0,0 +1,53 @@
|
|||
pub const BoxObject = struct {
|
||||
playing: bool = false,
|
||||
|
||||
pub fn create(allocator: std.mem.Allocator, entity: core.Entity, params: core.SpawnParameters) !*@This() {
|
||||
const position = params.posRot.position;
|
||||
|
||||
const box2 = entity;
|
||||
const scene = box2.addComponent(core.Scene).?;
|
||||
|
||||
const mesh = box2.addComponent(rend.MeshComponent).?;
|
||||
mesh.setMesh("m_crate");
|
||||
mesh.setTexture("t_crate");
|
||||
|
||||
scene.setPosition(position);
|
||||
scene.setScaleV(params.posRot.scale);
|
||||
scene.setMobility(.moveable);
|
||||
|
||||
const collider = box2.addComponent(physics.PhysicsCollider).?;
|
||||
try collider.setupByShapeName(core.MakeName("ph_small_box"), .{
|
||||
.motion_type = .dynamic,
|
||||
.object_layer = physics.ObjectLayers.moving,
|
||||
.friction = 0.8,
|
||||
.mass_properties_override = .{ .mass = 12 },
|
||||
.override_mass_properties = .calc_inertia,
|
||||
});
|
||||
|
||||
return try allocator.create(@This());
|
||||
}
|
||||
|
||||
pub fn createSmoky(allocator: std.mem.Allocator, entity: core.Entity, params: core.SpawnParameters) !*@This() {
|
||||
const rv = try create(allocator, entity, params);
|
||||
|
||||
const particle = entity.addComponent(rend.ParticleEmitter).?;
|
||||
particle.start();
|
||||
particle.gravity = .{ .y = 1.0 };
|
||||
particle.particleVelocity = .{ .min = 0.6, .max = 1.2 };
|
||||
particle.particleLife = .{ .min = 5, .max = 6 };
|
||||
var name = core.MakeName("t_pixelSmoke");
|
||||
particle.texture = rend.getTexture(&name).?;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
pub fn destroy(self: *@This(), alloc: std.mem.Allocator) void {
|
||||
alloc.destroy(self);
|
||||
}
|
||||
};
|
||||
|
||||
const std = @import("std");
|
||||
const Backlog = @import("Backlog");
|
||||
const core = Backlog.core;
|
||||
const rend = Backlog.rend;
|
||||
const physics = Backlog.physics;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
const backlog = @import("backlog");
|
||||
const core = backlog.core;
|
||||
const imgui = backlog.imgui;
|
||||
const physics = backlog.physics;
|
||||
const rend = backlog.rend;
|
||||
const ig = imgui.api;
|
||||
const sys = backlog.sys;
|
||||
const ui = backlog.ui;
|
||||
const net = backlog.net;
|
||||
const audio = backlog.audio;
|
||||
const platform = backlog.platform;
|
||||
|
||||
pub export fn shutdown_module() void {}
|
||||
pub export fn startup_module(p_allocator: *anyopaque, p_a: ?*anyopaque) bool {
|
||||
const allocator = core.modulePreamble(p_allocator, p_a) catch return false;
|
||||
_ = allocator;
|
||||
imgui.setupFromModule();
|
||||
platform.setupFromModule();
|
||||
sys.setupFromModule();
|
||||
rend.setupFromModule();
|
||||
backlog.physics.setupFromModule();
|
||||
|
||||
start_module(core.startup_getArgs(p_a.?)) catch return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
pub fn start_module(args: core.ModuleLoaderArgs) !void {
|
||||
_ = args;
|
||||
core.PatchOrCreateObject(ZuckGame, .{});
|
||||
// core.PatchOrCreateObject(ZuckEditor, .{});
|
||||
}
|
||||
|
||||
const ZuckGame = @import("games/ZuckGame.zig");
|
||||
const ZuckEditor = @import("games/ZuckEditor.zig");
|
||||
|
||||
const ZuckPlayer = @import("actors/ZuckPlayer.zig");
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
pub var NeonObjectTable = core.EngineObjectVTable.from(@This(), "zuck.game.Editor");
|
||||
|
||||
allocator: std.mem.Allocator = undefined,
|
||||
|
||||
pub const Slack = core.SlackStruct(@This(), 8192);
|
||||
|
||||
pub fn create(allocator: std.mem.Allocator) !*@This() {
|
||||
const self = try Slack.create(allocator);
|
||||
self.* = .{
|
||||
.allocator = allocator,
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
pub fn tick(self: *@This(), dt: f64) void {
|
||||
_ = self;
|
||||
_ = dt;
|
||||
}
|
||||
|
||||
pub fn destroy(self: *@This()) void {
|
||||
self.allocator.destroy(Slack.fromPtr(self));
|
||||
}
|
||||
|
||||
const backlog = @import("backlog");
|
||||
const std = @import("std");
|
||||
const extras = @import("gameExtras");
|
||||
|
||||
const core = backlog.core;
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
pub var NeonObjectTable = core.EngineObjectVTable.from(@This(), "zuck.game.Root");
|
||||
|
||||
allocator: std.mem.Allocator = undefined,
|
||||
|
||||
pub const Slack = core.SlackStruct(@This(), 1024);
|
||||
|
||||
pub fn create(allocator: std.mem.Allocator) !*@This() {
|
||||
const self = try Slack.create(allocator);
|
||||
self.* = .{
|
||||
.allocator = allocator,
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
pub fn tick(self: *@This(), dt: f64) void {
|
||||
_ = self;
|
||||
_ = dt;
|
||||
}
|
||||
|
||||
pub fn destroy(self: *@This()) void {
|
||||
self.allocator.destroy(Slack.fromPtr(self));
|
||||
}
|
||||
|
||||
const backlog = @import("backlog");
|
||||
const std = @import("std");
|
||||
const extras = @import("gameExtras");
|
||||
|
||||
const core = backlog.core;
|
||||
|
|
@ -111,6 +111,7 @@ fn BindingData(Func: type) type {
|
|||
pub const ActionBinding = struct {
|
||||
data: BindingData(ActionFunc),
|
||||
keys: std.ArrayListUnmanaged(ActionBindingKey) = .{},
|
||||
layer: ?*BindingLayer = null,
|
||||
|
||||
// pub const Listener = struct {
|
||||
// id: u32,
|
||||
|
|
|
|||
|
|
@ -108,6 +108,20 @@ pub fn build(b: *std.Build) void {
|
|||
}),
|
||||
});
|
||||
|
||||
const hello_window = b.step("hello-window", "test window");
|
||||
const hello_window_exe = b.addExecutable(.{
|
||||
.name = "hello-window",
|
||||
.root_module = b.createModule(.{
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.root_source_file = b.path("src/samples/hello-window.zig"),
|
||||
.link_libc = true,
|
||||
}),
|
||||
});
|
||||
|
||||
hello_window.dependOn(&hello_window_exe.step);
|
||||
hello_window_exe.root_module.addImport("sdl3", mod);
|
||||
|
||||
tests.root_module.addImport("sdl3", mod);
|
||||
|
||||
const vertexDefinitions = addShaderDefinition(b, ".", target, optimize, "hello-triangle.vert", b.path("content/hello-triangle.vert.json"));
|
||||
|
|
@ -119,6 +133,7 @@ pub fn build(b: *std.Build) void {
|
|||
const runArtifact2 = b.addRunArtifact(tests2);
|
||||
test_step2.dependOn(&runArtifact2.step);
|
||||
|
||||
b.installArtifact(hello_window_exe);
|
||||
b.installArtifact(sdl3_lib);
|
||||
b.installArtifact(tests);
|
||||
b.installArtifact(tests2);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
allocator: std.mem.Allocator,
|
||||
|
||||
timer: std.time.Timer,
|
||||
// fillPipeline: *sdl3.GpuGraphicsPipeline = undefined,
|
||||
// linePipeline: *sdl3.GpuGraphicsPipeline = undefined,
|
||||
// viewport: sdl3.GpuViewport = undefined,
|
||||
running: bool = true,
|
||||
window: *sdl3.Window = undefined,
|
||||
|
||||
totalTime: f64 = 0.0,
|
||||
|
||||
var stdout_buffer: [1024]u8 = undefined;
|
||||
|
||||
pub fn print(comptime fmt: []const u8, args: anytype) void {
|
||||
var stdout = std.fs.File.stdout().writer(&stdout_buffer);
|
||||
stdout.interface.print(">>> " ++ fmt ++ "\n", args) catch return;
|
||||
stdout.interface.flush() catch return;
|
||||
}
|
||||
|
||||
pub fn create(allocator: std.mem.Allocator) !*@This() {
|
||||
const self = try allocator.create(@This());
|
||||
self.* = .{
|
||||
.allocator = allocator,
|
||||
.timer = try std.time.Timer.start(),
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
pub fn frameStamp(self: *@This()) f64 {
|
||||
return @as(f64, @floatFromInt(self.timer.read())) / 1000 / 1000 / 1000;
|
||||
}
|
||||
|
||||
pub fn startContext(self: *@This()) !void {
|
||||
try sdl3.init(.{
|
||||
.video = true,
|
||||
.gamepad = true,
|
||||
});
|
||||
|
||||
self.window = sdl3.c.SDL_CreateWindow("hello-world", 640, 480, 0).?;
|
||||
}
|
||||
|
||||
pub fn loadFileAlloc(filename: []const u8, comptime alignment: ?std.mem.Alignment, allocator: std.mem.Allocator) ![]u8 {
|
||||
var file = try std.fs.cwd().openFile(filename, .{});
|
||||
defer file.close();
|
||||
const filesize = (try file.stat()).size + 1; // add null byte
|
||||
const buffer: []u8 = try allocator.alignedAlloc(u8, alignment, filesize);
|
||||
errdefer allocator.free(buffer);
|
||||
std.mem.copyForwards(u8, buffer, try file.readToEndAlloc(allocator, buffer.len - 1));
|
||||
buffer[buffer.len - 1] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
pub fn loop(self: *@This()) !void {
|
||||
print("loop started\n", .{});
|
||||
try self.startContext();
|
||||
while (self.running) {
|
||||
const dt = @as(f64, @floatFromInt(self.timer.lap())) / 1000 / 1000 / 1000;
|
||||
self.update(dt);
|
||||
}
|
||||
}
|
||||
|
||||
fn update(self: *@This(), dt: f64) void {
|
||||
while (sdl3.pollEvent()) |event| {
|
||||
switch (event.type) {
|
||||
sdl_event.quit => {
|
||||
self.running = false;
|
||||
},
|
||||
sdl_event.key_down => {
|
||||
const key = event.key.scancode;
|
||||
if (key == @intFromEnum(sdl3.Scancode.escape)) {
|
||||
self.running = false;
|
||||
}
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
|
||||
self.draw(dt);
|
||||
print("frametime {d:.3}ms (fps: {d:.1})\r", .{ dt * 1000, 1 / dt });
|
||||
}
|
||||
|
||||
pub fn draw(self: *@This(), dt: f64) void {
|
||||
self.totalTime += dt;
|
||||
}
|
||||
|
||||
pub fn destroy(self: *@This()) void {
|
||||
sdl3.c.SDL_DestroyWindow(self.window);
|
||||
|
||||
self.allocator.destroy(self);
|
||||
}
|
||||
|
||||
pub fn main() !void {
|
||||
std.debug.print("lmao?\n", .{});
|
||||
print("hello world... n", .{});
|
||||
const app = try create(std.heap.c_allocator);
|
||||
try app.loop();
|
||||
defer app.destroy();
|
||||
}
|
||||
|
||||
const sdl3 = @import("sdl3");
|
||||
const sdl_event = sdl3.events;
|
||||
const std = @import("std");
|
||||
|
|
@ -158,7 +158,8 @@ pub fn testThing(self: *@This()) !void {
|
|||
|
||||
for (0..workerCount) |i| {
|
||||
const name = try std.fmt.allocPrintSentinel(std.heap.c_allocator, "MultiJob{d}", .{i}, 0);
|
||||
try core.dispatchJob(MultiJob{ .threadName = name, .threadId = @intCast(i), .threadCount = workerCount });
|
||||
_ = name;
|
||||
// try core.dispatchJob(MultiJob{ .threadName = name, .threadId = @intCast(i), .threadCount = workerCount });
|
||||
}
|
||||
|
||||
// workerCountHint=0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
pub export fn shutdown_module() void {}
|
||||
pub export fn startup_module(p_allocator: *anyopaque, p_a: ?*anyopaque) bool {
|
||||
const allocator = core.modulePreamble(p_allocator, p_a) catch return false;
|
||||
_ = allocator;
|
||||
|
|
@ -6,8 +7,6 @@ pub export fn startup_module(p_allocator: *anyopaque, p_a: ?*anyopaque) bool {
|
|||
sys.setupFromModule();
|
||||
rend.setupFromModule();
|
||||
backlog.physics.setupFromModule();
|
||||
// backlog.net.setupFromModule();
|
||||
// TODO backlog.setupFromModule
|
||||
|
||||
core.engine_logs("creating externgame");
|
||||
start_module(core.startup_getArgs(p_a.?)) catch return false;
|
||||
|
|
@ -152,10 +151,10 @@ pub const ExternGameObject = struct {
|
|||
}
|
||||
|
||||
// change this into a parallel for
|
||||
for (0..1) |i| {
|
||||
for (0..4000) |i| {
|
||||
_ = try core.get(core.GameObjectSystem).spawnObject(BoxObject, "Box", .{
|
||||
.posRot = .{
|
||||
.position = .{ .x = core.itof32((i % 10)) * 2, .y = 15.0, .z = core.itof32(@divFloor(i, 10) * 2) },
|
||||
.position = .{ .x = core.itof32((i % 100)) * 2, .y = 15.0, .z = core.itof32(@divFloor(i, 100) * 2) },
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -690,8 +689,6 @@ pub const ExternGameObject = struct {
|
|||
}
|
||||
};
|
||||
|
||||
pub export fn shutdown_module() void {}
|
||||
|
||||
const std = @import("std");
|
||||
const backlog = @import("backlog");
|
||||
const core = backlog.core;
|
||||
|
|
|
|||
Loading…
Reference in New Issue