networking
This commit is contained in:
@@ -36,10 +36,15 @@ int assets_build()
|
||||
|
||||
IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/maps");
|
||||
IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/gfx");
|
||||
IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/fonts");
|
||||
IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/textures");
|
||||
IFileSystem2::CopyDirectory(CUtlString("build/funnygame/assets"), "funnyassets/materials");
|
||||
build_shader("mesh_frag");
|
||||
build_shader("mesh_vert");
|
||||
build_shader("fgui_rect_frag");
|
||||
build_shader("fgui_rect_vert");
|
||||
build_shader("fgui_text_frag");
|
||||
build_shader("fgui_text_vert");
|
||||
CUtlVector<CUtlString> python_args = {
|
||||
"build/tools/makepak64.py",
|
||||
CUtlString("build/funnygame/assets"),
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 423 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
parent rtt_simple_pbr
|
||||
albedo textures/bricks.png
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 405 KiB |
@@ -3,3 +3,4 @@ bind a +left;
|
||||
bind d +right;
|
||||
bind w +forward;
|
||||
bind s +back;
|
||||
bind o connect 127.0.0.1;
|
||||
|
||||
2
funnyassets/fonts/IBMPlexMono-Regular.fontdata
Normal file
2
funnyassets/fonts/IBMPlexMono-Regular.fontdata
Normal file
@@ -0,0 +1,2 @@
|
||||
12 8 !"#$&'()*+,-./0123456789:;<=>?@ABCDEFGIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgijklmnopqrstuvwxyz{|}~
|
||||
|
||||
BIN
funnyassets/fonts/IBMPlexMono-Regular.png
Normal file
BIN
funnyassets/fonts/IBMPlexMono-Regular.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
funnyassets/fonts/IBMPlexMono-Regular.ttf
Normal file
BIN
funnyassets/fonts/IBMPlexMono-Regular.ttf
Normal file
Binary file not shown.
11
funnyassets/gfx_shaders/fgui_rect_frag.slang
Normal file
11
funnyassets/gfx_shaders/fgui_rect_frag.slang
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "fgui_rect_shared.slang"
|
||||
|
||||
[shader("fragment")]
|
||||
float4 _main(
|
||||
VertexOutput input,
|
||||
uint triid: SV_PrimitiveID,
|
||||
) : SV_TARGET
|
||||
{
|
||||
return float4(0.2,0.2,0.2,1);
|
||||
}
|
||||
|
||||
17
funnyassets/gfx_shaders/fgui_rect_shared.slang
Normal file
17
funnyassets/gfx_shaders/fgui_rect_shared.slang
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 position: SV_Position;
|
||||
}
|
||||
#include "shader_base.h"
|
||||
|
||||
DECLARE_CONSTANTS()
|
||||
{
|
||||
int2 resolution;
|
||||
uint2 size;
|
||||
int2 position;
|
||||
};
|
||||
|
||||
|
||||
|
||||
17
funnyassets/gfx_shaders/fgui_rect_vert.slang
Normal file
17
funnyassets/gfx_shaders/fgui_rect_vert.slang
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "fgui_rect_shared.slang"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float2 position: POSITION;
|
||||
};
|
||||
|
||||
[shader("vertex")]
|
||||
VertexOutput _main(
|
||||
VertexInput input,
|
||||
)
|
||||
{
|
||||
VertexOutput output;
|
||||
output.position = float4((input.position*size+position)/resolution*2-1, 0, 1.0f);
|
||||
FIX_VERTEX_POSITION(output.position);
|
||||
return output;
|
||||
}
|
||||
11
funnyassets/gfx_shaders/fgui_text_frag.slang
Normal file
11
funnyassets/gfx_shaders/fgui_text_frag.slang
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "fgui_text_shared.slang"
|
||||
|
||||
[shader("fragment")]
|
||||
float4 _main(
|
||||
VertexOutput input,
|
||||
uint triid: SV_PrimitiveID,
|
||||
) : SV_TARGET
|
||||
{
|
||||
return float4(0.2,0.2,0.2,1);
|
||||
}
|
||||
|
||||
18
funnyassets/gfx_shaders/fgui_text_shared.slang
Normal file
18
funnyassets/gfx_shaders/fgui_text_shared.slang
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 position: SV_Position;
|
||||
}
|
||||
#include "shader_base.h"
|
||||
|
||||
DECLARE_CONSTANTS()
|
||||
{
|
||||
int2 resolution;
|
||||
uint2 size;
|
||||
int2 position;
|
||||
int8_t character;
|
||||
};
|
||||
|
||||
DECLARE_TEXTURES(0);
|
||||
|
||||
18
funnyassets/gfx_shaders/fgui_text_vert.slang
Normal file
18
funnyassets/gfx_shaders/fgui_text_vert.slang
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "fgui_text_shared.slang"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float2 position: POSITION;
|
||||
float2 uv: TEXCOORD0;
|
||||
};
|
||||
|
||||
[shader("vertex")]
|
||||
VertexOutput _main(
|
||||
VertexInput input,
|
||||
)
|
||||
{
|
||||
VertexOutput output;
|
||||
output.position = float4((input.position*size+position)/resolution*2-1, 0, 1.0f);
|
||||
FIX_VERTEX_POSITION(output.position);
|
||||
return output;
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
#pragma once
|
||||
#include "shader_base.h"
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 position: SV_Position;
|
||||
float2 uv: TEXCOORD0;
|
||||
};
|
||||
|
||||
#include "shader_base.h"
|
||||
DECLARE_CONSTANTS()
|
||||
{
|
||||
float4x4 modelMatrix;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "shader_base.h"
|
||||
#include "mesh_shared.slang"
|
||||
|
||||
struct VertexInput
|
||||
@@ -14,6 +13,7 @@ VertexOutput _main(
|
||||
{
|
||||
VertexOutput output;
|
||||
output.position = mul(projection, mul(modelMatrix, float4(input.position,1)));
|
||||
FIX_VERTEX_POSITION(output.position);
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,16 @@ ParameterBlock<TextureBinding> g_textures3 : register(t24); \
|
||||
ParameterBlock<TextureBinding> g_textures4 : register(t25); \
|
||||
ParameterBlock<TextureBinding> g_textures5 : register(t26); \
|
||||
ParameterBlock<TextureBinding> g_textures6 : register(t27); \
|
||||
ParameterBlock<TextureBinding> g_textures7 : register(t28);
|
||||
ParameterBlock<TextureBinding> g_textures7 : register(t28); \
|
||||
float4 SampleTexture(uint32_t binding, float2 uv) \
|
||||
{ \
|
||||
SamplerState sampler = mlGetSampler(); \
|
||||
uint8_t textureArray = 0; \
|
||||
uint8_t textureSamplerArray = (binding >> 16) & 0xFF; \
|
||||
uint8_t textureSampler = (binding >> 8) & 0xFF; \
|
||||
uint8_t textureIndex = 1; \
|
||||
return g_textures0.textures[1].Sample(sampler, uv); \
|
||||
};
|
||||
|
||||
void _mlGetSampler()
|
||||
{
|
||||
@@ -32,16 +41,6 @@ SamplerState mlGetSampler()
|
||||
_mlGetSampler();
|
||||
};
|
||||
|
||||
float4 SampleTexture(uint32_t binding, float2 uv)
|
||||
{
|
||||
SamplerState sampler = mlGetSampler();
|
||||
uint8_t textureArray = 0;
|
||||
uint8_t textureSamplerArray = (binding >> 16) & 0xFF;
|
||||
uint8_t textureSampler = (binding >> 8) & 0xFF;
|
||||
uint8_t textureIndex = 1;
|
||||
return g_textures0.textures[1].Sample(sampler, uv);
|
||||
};
|
||||
|
||||
#define DECLARE_CBUFFER(b) \
|
||||
[[vk::binding(b)]] cbuffer cbuffer_##b : register(t##b)
|
||||
|
||||
@@ -49,16 +48,16 @@ float4 SampleTexture(uint32_t binding, float2 uv)
|
||||
[[vk::push_constant]] \
|
||||
cbuffer cbuffer_constants : register(t29)
|
||||
|
||||
#define FIX_VERTEX_POSITION(g) g = float4(g.x, -g.y, g.z, g.w);
|
||||
|
||||
#elif defined(__SPIRV__)
|
||||
|
||||
#define DECLARE_TEXTURES(b) \
|
||||
[[vk::binding(b)]] \
|
||||
Sampler2D g_textures[];
|
||||
|
||||
float4 SampleTexture(uint32_t binding, float2 uv)
|
||||
{
|
||||
return g_textures[binding].Sample(uv);
|
||||
Sampler2D g_textures[]; \
|
||||
float4 SampleTexture(uint32_t binding, float2 uv) \
|
||||
{ \
|
||||
return g_textures[binding].Sample(uv); \
|
||||
};
|
||||
|
||||
#define DECLARE_CBUFFER(b) \
|
||||
@@ -70,16 +69,21 @@ cbuffer cbuffer_##b
|
||||
[[vk::binding(b)]] \
|
||||
r
|
||||
|
||||
#define DECLARE_CONSTANTS() \
|
||||
#define DECLARE_CONSTANTS()
|
||||
[[vk::push_constant]] \
|
||||
cbuffer cbuffer_constants
|
||||
|
||||
#define FIX_VERTEX_POSITION(x)
|
||||
|
||||
#else
|
||||
#define DECLARE_TEXTURES()
|
||||
float4 SampleTexture(uint32_t binding, float2 uv);
|
||||
#define DECLARE_CBUFFER() cbuffer cbuffer_constats
|
||||
#define DECLARE_DATA() cbuffer cbuffer_constats
|
||||
#define DECLARE_CONSTANTS() cbuffer cbuffer_constats
|
||||
#define DECLARE_CBUFFER() cbuffer cbuffer_constants
|
||||
#define DECLARE_DATA() cbuffer cbuffer_constants
|
||||
#define DECLARE_CONSTANTS() cbuffer cbuffer_constants
|
||||
#define FIX_VERTEX_POSITION(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -261851,3 +261851,8 @@
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -50 3"
|
||||
}
|
||||
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -52 3"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user