This commit is contained in:
2025-05-25 23:37:40 +03:00
commit 7f054e2904
79 changed files with 4850 additions and 0 deletions

36
funnyassets/__build.c Normal file
View File

@@ -0,0 +1,36 @@
#include "god/slang.h"
#include "god/utils.h"
#include "god/common.h"
void build_shader(char *name, enum slang_stage stage)
{
struct slang_settings shadercc = {
.entry = string_clone("funnyassets/gfx_shaders/%s.slang", name),
.stage = stage,
.output_type = SLANG_OUTPUT_SPIRV,
};
char *file = slang_compile(shadercc);
mv(string_clone("funnyassets/_rtt/gfx/%s.spv",name),file);
};
void makepak(char *name)
{
struct run_project rp = run_new("python");
run_add_arg(&rp, "tools/makepak64.py");
run_add_arg(&rp, string_clone("funnyassets/_%s",name));
run_add_arg(&rp, string_clone("build/"GAME_NAME"/game/"GAME_NAME"/%s.pak", name));
run_run(&rp);
};
void assets_build(struct build_data b)
{
remove("funnyassets/_rtt");
makedir("funnyassets/_rtt/gfx");
build_shader("brush_frag", SLANG_STAGE_FRAGMENT);
build_shader("brush_vert", SLANG_STAGE_VERTEX);
mv("funnyassets/_rtt/","funnyassets/maps");
mv("funnyassets/_rtt/","funnyassets/gfx");
mv("funnyassets/_rtt/","funnyassets/textures");
mv("funnyassets/_rtt/","funnyassets/materials");
makepak("rtt");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
parent rtt_simple_pbr
albedo textures/bricks.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

View File

@@ -0,0 +1,27 @@
uint32_t hash32(uint32_t x) {
x = ((x >> 16) ^ x) * 0x45d9f3b;
x = ((x >> 16) ^ x) * 0x45d9f3b;
x = (x >> 16) ^ x;
return x;
}
[[vk::binding(1)]]
uniform Sampler2D textures[];
struct VertexOutput
{
float4 position: SV_Position;
float2 uv: TEXCOORD0;
};
float4 main(
VertexOutput input,
uint triid: SV_PrimitiveID,
uniform uint textureID,
) : SV_TARGET
{
return float4(textures[textureID].Sample(input.uv).xyz, 1);
}

View File

@@ -0,0 +1,27 @@
struct VertexInput
{
float3 position: POSITION;
float2 uv: TEXCOORD0;
};
struct VertexOutput
{
float4 position: SV_Position;
float2 uv: TEXCOORD0;
};
[[vk::binding(0)]]
cbuffer CameraInfo
{
float4x4 projection;
};
VertexOutput main(
VertexInput input,
)
{
VertexOutput output;
output.position = mul(projection, float4(input.position,1));
output.uv = input.uv;
return output;
}

Binary file not shown.

View File

@@ -0,0 +1,2 @@
parent rtt_simple_pbr
albedo textures/bricks.png

View File

@@ -0,0 +1,106 @@
{
"classname" "worldspawn"
{
(-4.000000 8.000000 -2.000000) (-8.000000 8.000000 -2.000000) (-8.000000 8.000000 -4.000000) (6.483328 1.451694) (6.483328 0.190320) (7.114015 0.190320) BRICK0
(-4.000000 8.000000 -2.000000) (-8.000000 8.000000 -4.000000) (-4.000000 8.000000 -4.000000) (6.483328 1.451694) (7.114015 0.190320) (7.114015 1.451694) BRICK0
(0.000000 12.000000 -2.000000) (0.000000 14.000000 -2.000000) (-0.300000 14.000000 -2.000000) (0.820848 2.713067) (0.190320 2.713067) (0.190320 2.618464) BRICK0
(0.000000 12.000000 -2.000000) (-0.300000 14.000000 -2.000000) (-0.300000 12.000000 -2.000000) (0.820848 2.713067) (0.190320 2.618464) (0.820848 2.618464) BRICK0
(0.000000 6.000000 -4.000000) (4.000000 6.000000 -4.000000) (4.000000 10.000000 -2.000000) (2.726604 2.713067) (2.726604 3.974441) (1.451375 3.974441) BRICK0
(0.000000 6.000000 -4.000000) (4.000000 10.000000 -2.000000) (0.000000 10.000000 -2.000000) (2.726604 2.713067) (1.451375 3.974441) (1.451375 2.713067) BRICK0
(0.000000 6.000000 -4.000000) (0.000000 10.000000 -2.000000) (0.000000 6.000000 -2.000000) (6.798353 5.902491) (6.167666 7.163865) (6.167666 5.902491) BRICK0
(0.000000 12.000000 -2.000000) (4.000000 12.000000 -2.000000) (4.000000 14.000000 -2.000000) (0.820848 2.713067) (0.820848 3.974441) (0.190320 3.974441) BRICK0
(0.000000 12.000000 -2.000000) (4.000000 14.000000 -2.000000) (0.000000 14.000000 -2.000000) (0.820848 2.713067) (0.190320 3.974441) (0.190320 2.713067) BRICK0
(-0.300000 12.000000 -2.000000) (-0.300000 14.000000 -2.000000) (-3.700000 14.000000 -2.000000) (0.820848 2.618464) (0.190320 2.618464) (0.190320 1.546297) BRICK0
(-0.300000 12.000000 -2.000000) (-3.700000 14.000000 -2.000000) (-3.700000 12.000000 -2.000000) (0.820848 2.618464) (0.190320 1.546297) (0.820848 1.546297) BRICK0
(0.000000 2.000000 -4.000000) (4.000000 2.000000 -4.000000) (4.000000 6.000000 -4.000000) (3.987659 2.713067) (3.987659 3.974441) (2.726604 3.974441) BRICK0
(0.000000 2.000000 -4.000000) (4.000000 6.000000 -4.000000) (0.000000 6.000000 -4.000000) (3.987659 2.713067) (2.726604 3.974441) (2.726604 2.713067) BRICK0
(-0.300000 10.000000 -2.000000) (-3.700000 10.000000 -2.000000) (-3.700000 8.300000 -2.000000) (1.451375 2.618464) (1.451375 1.546297) (1.987324 1.546297) BRICK0
(-0.300000 10.000000 -2.000000) (-3.700000 8.300000 -2.000000) (-0.300000 8.300000 -2.000000) (1.451375 2.618464) (1.987324 1.546297) (1.987324 2.618464) BRICK0
(-4.000000 6.000000 -4.000000) (-4.000000 8.000000 -4.000000) (-8.000000 8.000000 -4.000000) (2.726604 1.451694) (2.096077 1.451694) (2.096077 0.190320) BRICK0
(-4.000000 6.000000 -4.000000) (-8.000000 8.000000 -4.000000) (-8.000000 6.000000 -4.000000) (2.726604 1.451694) (2.096077 0.190320) (2.726604 0.190320) BRICK0
(-4.000000 2.000000 -4.000000) (-4.000000 6.000000 -4.000000) (-8.000000 6.000000 -4.000000) (3.987659 1.451694) (2.726604 1.451694) (2.726604 0.190320) BRICK0
(-4.000000 2.000000 -4.000000) (-8.000000 6.000000 -4.000000) (-8.000000 2.000000 -4.000000) (3.987659 1.451694) (2.726604 0.190320) (3.987659 0.190320) BRICK0
(-4.000000 6.000000 -4.000000) (-4.000000 6.000000 -2.000000) (-4.000000 8.000000 -2.000000) (6.325656 2.620692) (6.325656 1.990005) (6.956343 1.990005) BRICK0
(-4.000000 6.000000 -4.000000) (-4.000000 8.000000 -2.000000) (-4.000000 8.000000 -4.000000) (6.325656 2.620692) (6.956343 1.990005) (6.956343 2.620692) BRICK0
(0.000000 6.000000 -4.000000) (0.000000 6.000000 -2.000000) (-4.000000 6.000000 -2.000000) (5.156658 7.258468) (4.525971 7.258468) (4.525971 5.997094) BRICK0
(0.000000 6.000000 -4.000000) (-4.000000 6.000000 -2.000000) (-4.000000 6.000000 -4.000000) (5.156658 7.258468) (4.525971 5.997094) (5.156658 5.997094) BRICK0
(0.000000 2.000000 -4.000000) (0.000000 6.000000 -4.000000) (-4.000000 6.000000 -4.000000) (3.987659 2.713067) (2.726604 2.713067) (2.726604 1.451694) BRICK0
(0.000000 2.000000 -4.000000) (-4.000000 6.000000 -4.000000) (-4.000000 2.000000 -4.000000) (3.987659 2.713067) (2.726604 1.451694) (3.987659 1.451694) BRICK0
(-0.300000 8.300000 -2.000000) (-3.700000 8.300000 -2.000000) (-3.700000 6.300000 -2.000000) (1.987324 2.618464) (1.987324 1.546297) (2.617851 1.546297) BRICK0
(-0.300000 8.300000 -2.000000) (-3.700000 6.300000 -2.000000) (-0.300000 6.300000 -2.000000) (1.987324 2.618464) (2.617851 1.546297) (2.617851 2.618464) BRICK0
(-3.700000 8.300000 -2.000000) (-3.700000 10.000000 -2.000000) (-8.000000 10.000000 -2.000000) (1.987324 1.546297) (1.451375 1.546297) (1.451375 0.190320) BRICK0
(-3.700000 8.300000 -2.000000) (-8.000000 10.000000 -2.000000) (-8.000000 8.300000 -2.000000) (1.987324 1.546297) (1.451375 0.190320) (1.987324 0.190320) BRICK0
(4.000000 6.000000 -4.000000) (4.000000 2.000000 -4.000000) (6.000000 2.000000 -4.000000) (2.726604 3.974441) (3.987659 3.974441) (3.987659 4.605128) BRICK0
(4.000000 6.000000 -4.000000) (6.000000 2.000000 -4.000000) (6.000000 6.000000 -4.000000) (2.726604 3.974441) (3.987659 4.605128) (2.726604 4.605128) BRICK0
(4.000000 6.000000 -4.000000) (6.000000 6.000000 -4.000000) (6.000000 6.000000 -2.000000) (1.451694 6.562484) (0.821007 6.562484) (0.821007 5.931798) BRICK0
(4.000000 6.000000 -4.000000) (6.000000 6.000000 -2.000000) (4.000000 6.000000 -2.000000) (1.451694 6.562484) (0.821007 5.931798) (1.451694 5.931798) BRICK0
(6.000000 6.000000 -4.000000) (6.000000 2.000000 -4.000000) (6.000000 2.000000 -2.000000) (7.809680 5.902491) (7.809680 7.163865) (7.178993 7.163865) BRICK0
(6.000000 6.000000 -4.000000) (6.000000 2.000000 -2.000000) (6.000000 6.000000 -2.000000) (7.809680 5.902491) (7.178993 7.163865) (7.178992 5.902491) BRICK0
(4.000000 6.000000 -4.000000) (4.000000 6.000000 -2.000000) (4.000000 10.000000 -2.000000) (5.945016 2.713067) (5.314330 2.713067) (5.314329 1.451694) BRICK0
(-3.700000 10.000000 -2.000000) (-3.700000 12.000000 -2.000000) (-8.000000 12.000000 -2.000000) (1.451375 1.546297) (0.820848 1.546297) (0.820848 0.190320) BRICK0
(-3.700000 10.000000 -2.000000) (-8.000000 12.000000 -2.000000) (-8.000000 10.000000 -2.000000) (1.451375 1.546297) (0.820848 0.190320) (1.451375 0.190320) BRICK0
(-0.300000 10.000000 -2.000000) (-0.300000 12.000000 -2.000000) (-3.700000 12.000000 -2.000000) (1.451375 2.618464) (0.820848 2.618464) (0.820848 1.546297) BRICK0
(-0.300000 10.000000 -2.000000) (-3.700000 12.000000 -2.000000) (-3.700000 10.000000 -2.000000) (1.451375 2.618464) (0.820848 1.546297) (1.451375 1.546297) BRICK0
(0.000000 10.000000 -2.000000) (4.000000 10.000000 -2.000000) (4.000000 12.000000 -2.000000) (1.451375 2.713067) (1.451375 3.974441) (0.820848 3.974441) BRICK0
(0.000000 10.000000 -2.000000) (4.000000 12.000000 -2.000000) (0.000000 12.000000 -2.000000) (1.451375 2.713067) (0.820848 3.974441) (0.820848 2.713067) BRICK0
(0.000000 10.000000 -2.000000) (0.000000 12.000000 -2.000000) (-0.300000 12.000000 -2.000000) (1.451375 2.713067) (0.820848 2.713067) (0.820848 2.618464) BRICK0
(0.000000 10.000000 -2.000000) (-0.300000 12.000000 -2.000000) (-0.300000 10.000000 -2.000000) (1.451375 2.713067) (0.820848 2.618464) (1.451375 2.618464) BRICK0
(4.000000 6.000000 -2.000000) (6.000000 6.000000 -2.000000) (6.000000 6.000000 1.000000) (1.451694 5.931798) (0.821007 5.931798) (0.821007 4.985767) BRICK0
(4.000000 6.000000 -2.000000) (6.000000 6.000000 1.000000) (4.000000 6.000000 1.000000) (1.451694 5.931798) (0.821007 4.985767) (1.451694 4.985767) BRICK0
(4.000000 12.000000 -2.000000) (4.000000 10.000000 -2.000000) (4.000000 10.000000 1.000000) (5.314329 0.821007) (5.314329 1.451694) (4.368299 1.451694) BRICK0
(4.000000 12.000000 -2.000000) (4.000000 10.000000 1.000000) (4.000000 12.000000 1.000000) (5.314329 0.821007) (4.368299 1.451694) (4.368299 0.821007) BRICK0
(4.000000 10.000000 -2.000000) (4.000000 6.000000 -2.000000) (4.000000 6.000000 1.000000) (5.314329 1.451694) (5.314330 2.713067) (4.368299 2.713067) BRICK0
(4.000000 10.000000 -2.000000) (4.000000 6.000000 1.000000) (4.000000 10.000000 1.000000) (5.314329 1.451694) (4.368299 2.713067) (4.368299 1.451694) BRICK0
(-0.300000 14.000000 -2.000000) (0.000000 14.000000 -2.000000) (0.000000 14.000000 1.000000) (6.956025 4.165875) (6.956025 4.260478) (6.009995 4.260478) BRICK0
(-0.300000 14.000000 -2.000000) (0.000000 14.000000 1.000000) (-0.300000 14.000000 1.000000) (6.956025 4.165875) (6.009995 4.260478) (6.009995 4.165875) BRICK0
(0.000000 14.000000 -2.000000) (4.000000 14.000000 -2.000000) (4.000000 14.000000 1.000000) (6.956025 4.260478) (6.956025 5.521852) (6.009995 5.521852) BRICK0
(0.000000 14.000000 -2.000000) (4.000000 14.000000 1.000000) (0.000000 14.000000 1.000000) (6.956025 4.260478) (6.009995 5.521852) (6.009995 4.260478) BRICK0
(4.000000 14.000000 -2.000000) (4.000000 12.000000 -2.000000) (4.000000 12.000000 1.000000) (5.314329 0.190320) (5.314329 0.821007) (4.368299 0.821007) BRICK0
(4.000000 14.000000 -2.000000) (4.000000 12.000000 1.000000) (4.000000 14.000000 1.000000) (5.314329 0.190320) (4.368299 0.821007) (4.368299 0.190320) BRICK0
(-8.000000 12.000000 -2.000000) (-3.700000 12.000000 -2.000000) (-3.700000 12.000000 1.000000) (2.778364 4.985768) (2.778364 6.341744) (1.832334 6.341744) BRICK0
(-8.000000 12.000000 -2.000000) (-3.700000 12.000000 1.000000) (-8.000000 12.000000 1.000000) (2.778364 4.985768) (1.832334 6.341744) (1.832334 4.985768) BRICK0
(-3.700000 14.000000 -2.000000) (-0.300000 14.000000 -2.000000) (-0.300000 14.000000 1.000000) (6.956025 3.093707) (6.956025 4.165875) (6.009995 4.165875) BRICK0
(-3.700000 14.000000 -2.000000) (-0.300000 14.000000 1.000000) (-3.700000 14.000000 1.000000) (6.956025 3.093707) (6.009995 4.165875) (6.009994 3.093707) BRICK0
(-3.700000 12.000000 -2.000000) (-3.700000 14.000000 -2.000000) (-3.700000 14.000000 1.000000) (2.463020 7.668415) (1.832333 7.668415) (1.832333 6.722384) BRICK0
(-3.700000 12.000000 -2.000000) (-3.700000 14.000000 1.000000) (-3.700000 12.000000 1.000000) (2.463020 7.668415) (1.832333 6.722384) (2.463020 6.722384) BRICK0
(6.000000 6.000000 1.000000) (6.000000 6.000000 -2.000000) (8.000000 6.000000 -2.000000) (0.821007 4.985767) (0.821007 5.931798) (0.190320 5.931798) BRICK0
(6.000000 6.000000 1.000000) (8.000000 6.000000 -2.000000) (8.000000 6.000000 1.000000) (0.821007 4.985767) (0.190320 5.931798) (0.190320 4.985767) BRICK0
(-0.300000 8.300000 -2.000000) (-0.300000 6.300000 -2.000000) (-0.300000 6.300000 -1.500000) (3.854987 5.521851) (3.854987 6.152538) (3.697315 6.152538) BRICK0
(-0.300000 8.300000 -2.000000) (-0.300000 6.300000 -1.500000) (-0.300000 8.300000 -1.500000) (3.854987 5.521851) (3.697315 6.152538) (3.697315 5.521851) BRICK0
(-3.700000 8.300000 -2.000000) (-8.000000 8.300000 -2.000000) (-8.000000 8.300000 -1.500000) (3.316675 4.985768) (3.316675 6.341744) (3.159004 6.341744) BRICK0
(-3.700000 8.300000 -2.000000) (-8.000000 8.300000 -1.500000) (-3.700000 8.300000 -1.500000) (3.316675 4.985768) (3.159004 6.341744) (3.159004 4.985768) BRICK0
(-4.000000 8.000000 -2.000000) (-4.000000 6.000000 -2.000000) (-4.000000 6.000000 -1.500000) (6.956343 1.990005) (6.325656 1.990005) (6.325656 1.832333) BRICK0
(-4.000000 8.000000 -2.000000) (-4.000000 6.000000 -1.500000) (-4.000000 8.000000 -1.500000) (6.956343 1.990005) (6.325656 1.832333) (6.956343 1.832333) BRICK0
(0.000000 10.000000 -2.000000) (-0.300000 10.000000 -2.000000) (-0.300000 10.000000 -1.500000) (2.938263 6.880056) (2.843660 6.880056) (2.843660 6.722384) BRICK0
(0.000000 10.000000 -2.000000) (-0.300000 10.000000 -1.500000) (0.000000 10.000000 -1.500000) (2.938263 6.880056) (2.843660 6.722384) (2.938263 6.722384) BRICK0
(-0.300000 6.300000 -2.000000) (-3.700000 6.300000 -2.000000) (-3.700000 6.300000 -1.500000) (7.494336 3.093707) (7.494337 4.165875) (7.336665 4.165875) BRICK0
(-0.300000 6.300000 -2.000000) (-3.700000 6.300000 -1.500000) (-0.300000 6.300000 -1.500000) (7.494336 3.093707) (7.336665 4.165875) (7.336665 3.093707) BRICK0
(0.000000 6.000000 -2.000000) (0.000000 10.000000 -2.000000) (0.000000 10.000000 -1.500000) (6.167666 5.902491) (6.167666 7.163865) (6.009995 7.163865) BRICK0
(0.000000 6.000000 -2.000000) (0.000000 10.000000 -1.500000) (0.000000 6.000000 -1.500000) (6.167666 5.902491) (6.009995 7.163865) (6.009995 5.902491) BRICK0
(-4.000000 6.000000 -2.000000) (0.000000 6.000000 -2.000000) (0.000000 6.000000 -1.500000) (4.525971 5.997094) (4.525971 7.258468) (4.368299 7.258468) BRICK0
(-4.000000 6.000000 -2.000000) (0.000000 6.000000 -1.500000) (-4.000000 6.000000 -1.500000) (4.525971 5.997094) (4.368299 7.258468) (4.368299 5.997094) BRICK0
(-3.700000 6.300000 -2.000000) (-3.700000 8.300000 -2.000000) (-3.700000 8.300000 -1.500000) (3.854987 6.533178) (3.854987 7.163865) (3.697315 7.163865) BRICK0
(-3.700000 6.300000 -2.000000) (-3.700000 8.300000 -1.500000) (-3.700000 6.300000 -1.500000) (3.854987 6.533178) (3.697315 7.163865) (3.697315 6.533178) BRICK0
(-8.000000 8.000000 -2.000000) (-4.000000 8.000000 -2.000000) (-4.000000 8.000000 -1.500000) (6.483328 0.190320) (6.483328 1.451694) (6.325656 1.451694) BRICK0
(-8.000000 8.000000 -2.000000) (-4.000000 8.000000 -1.500000) (-8.000000 8.000000 -1.500000) (6.483328 0.190320) (6.325656 1.451694) (6.325656 0.190320) BRICK0
(-0.300000 10.000000 -2.000000) (-0.300000 8.300000 -2.000000) (-0.300000 8.300000 -1.500000) (3.854987 4.985767) (3.854987 5.521851) (3.697315 5.521851) BRICK0
(-0.300000 10.000000 -2.000000) (-0.300000 8.300000 -1.500000) (-0.300000 10.000000 -1.500000) (3.854987 4.985767) (3.697315 5.521851) (3.697315 4.985767) BRICK0
(-4.000000 8.000000 -1.500000) (-3.700000 8.300000 -1.500000) (-8.000000 8.300000 -1.500000) (4.998827 4.355081) (4.904248 4.449684) (4.904248 3.093707) BRICK0
(-4.000000 8.000000 -1.500000) (-8.000000 8.300000 -1.500000) (-8.000000 8.000000 -1.500000) (4.998827 4.355081) (4.904248 3.093707) (4.998827 3.093707) BRICK0
(-4.000000 6.000000 -1.500000) (-3.700000 6.300000 -1.500000) (-3.700000 8.300000 -1.500000) (5.629354 4.355081) (5.534775 4.449684) (4.904248 4.449684) BRICK0
(-4.000000 6.000000 -1.500000) (-3.700000 8.300000 -1.500000) (-4.000000 8.000000 -1.500000) (5.629354 4.355081) (4.904248 4.449684) (4.998827 4.355081) BRICK0
(0.000000 6.000000 -1.500000) (-0.300000 6.300000 -1.500000) (-3.700000 6.300000 -1.500000) (5.629354 5.616455) (5.534775 5.521852) (5.534775 4.449684) BRICK0
(0.000000 6.000000 -1.500000) (-3.700000 6.300000 -1.500000) (-4.000000 6.000000 -1.500000) (5.629354 5.616455) (5.534775 4.449684) (5.629354 4.355081) BRICK0
(-0.300000 8.300000 -1.500000) (-0.300000 6.300000 -1.500000) (0.000000 6.000000 -1.500000) (4.904248 5.521852) (5.534775 5.521852) (5.629354 5.616455) BRICK0
(0.000000 6.000000 -1.500000) (0.000000 10.000000 -1.500000) (-0.300000 10.000000 -1.500000) (5.629354 5.616455) (4.368299 5.616455) (4.368299 5.521852) BRICK0
(-0.300000 8.300000 -1.500000) (0.000000 6.000000 -1.500000) (-0.300000 10.000000 -1.500000) (4.904248 5.521852) (5.629354 5.616455) (4.368299 5.521852) BRICK0
}
}
{
"classname" "light"
"intensity" "4.0"
}
{
"classname" "light"
"intensity" "4.0"
}

View File

@@ -0,0 +1,11 @@
{
"classname" "worldspawn"
{
( 0 0 0 ) ( 256 0 0 ) ( 256 256 0 ) ( 0 0 ) ( 1 0 ) ( 1 1 ) BRICK1
}
}
{
"classname" "light"
"origin" "128 128 96"
"light" "400"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB