small adjustments

This commit is contained in:
Tuomas Katajisto 2026-01-22 22:29:59 +02:00
parent 3ce3f93e3d
commit 58b548d250
5 changed files with 169 additions and 164 deletions

View File

@ -26,6 +26,7 @@ stbi :: #import "stb_image";
#load "load.jai";
#load "ray.jai";
#load "world.jai";
#load "utils.jai";
#if USE_SAMPLE_GAME {
#load "../sample_game/game.jai";

View File

@ -22,7 +22,7 @@ Post_Process :: struct {
vignette_intensity: float = 0.5; @Slider,0,1,0.1;
vignette_radius: float = 0.5; @Slider,0,1,0.1;
scanlines_intensity: float = 0.1; @Slider,0,1,0.1;
scanlines_density: float = 1; @Slider,0,2,0.1;
scanlines_density: float = 1; @Slider,0,10,0.1;
chromatic_aberration_intensity: float = 0.0; @Slider,0,0.05,0.001;
film_grain_intensity: float = 0.0; @Slider,0,0.5,0.001;
barrel_distortion_intensity: float = 0.0; @Slider,-2,2,0.1;

View File

@ -375,7 +375,7 @@ vs_trile_source_glsl430 := u8.[
float param_8 = _543;
float _647 = max(dot(_580, _591), 0.0);
vec3 _678 = ((light_proj_pos.xyz / vec3(light_proj_pos.w)) * 0.5) + vec3(0.5);
float _682 = _678.z - 0.0005000000237487256526947021484375;
float _682 = _678.z - 0.000899999984540045261383056640625;
vec3 _762 = _678;
_762.z = _682;
light += (((((((((vec3(1.0) - _613) * (1.0 - _549)) * trixel_material.xyz) * vec3(0.3183410167694091796875)) + ((_613 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * max(dot(_580, _586), 0.0)) * _647) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_762.xy, _682))) * _647) * _201.sunLightColor) * _201.sunIntensity);
@ -843,57 +843,57 @@ fs_trile_source_glsl430 := u8.[
0x6f,0x6a,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,
0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x38,0x32,0x20,0x3d,0x20,
0x5f,0x36,0x37,0x38,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x35,0x30,
0x30,0x30,0x30,0x30,0x30,0x32,0x33,0x37,0x34,0x38,0x37,0x32,0x35,0x36,0x35,0x32,
0x36,0x39,0x34,0x37,0x30,0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,
0x36,0x37,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,
0x3d,0x20,0x5f,0x36,0x38,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,
0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,
0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,0x29,0x20,
0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,0x29,0x20,
0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,
0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,
0x33,0x31,0x38,0x33,0x34,0x31,0x30,0x31,0x36,0x37,0x36,0x39,0x34,0x30,0x39,0x31,
0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x36,0x31,
0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,
0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,
0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,
0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x34,
0x2e,0x30,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,
0x30,0x2c,0x20,0x5f,0x35,0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,
0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,
0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,
0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,
0x29,0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,
0x64,0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,
0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,
0x5f,0x36,0x38,0x32,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,
0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,
0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,
0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,
0x65,0x63,0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,0x30,0x29,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x52,0x20,0x3d,0x20,0x5f,
0x37,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x31,
0x38,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,
0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,
0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,
0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x32,
0x30,0x31,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x32,0x30,0x31,0x2e,0x64,
0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x2c,
0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,
0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,0x6c,0x61,0x6e,0x65,
0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,
0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x5f,0x36,0x37,0x38,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x38,0x39,
0x39,0x39,0x39,0x39,0x39,0x38,0x34,0x35,0x34,0x30,0x30,0x34,0x35,0x32,0x36,0x31,
0x33,0x38,0x33,0x30,0x35,0x36,0x36,0x34,0x30,0x36,0x32,0x35,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,0x36,
0x37,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,0x3d,
0x20,0x5f,0x36,0x38,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,
0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,
0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,0x29,0x20,0x2a,
0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,0x29,0x20,0x2a,
0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,
0x31,0x38,0x33,0x34,0x31,0x30,0x31,0x36,0x37,0x36,0x39,0x34,0x30,0x39,0x31,0x37,
0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x36,0x31,0x33,
0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,
0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,
0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x34,0x2e,
0x30,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,0x30,
0x2c,0x20,0x5f,0x35,0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,
0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,
0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,
0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,
0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,
0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,
0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,
0x36,0x38,0x32,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2a,
0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,
0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x49,
0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
0x65,0x63,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,
0x63,0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,0x30,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x52,0x20,0x3d,0x20,0x5f,0x37,
0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x31,0x38,
0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,
0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,
0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x32,0x30,
0x31,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,
0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x32,0x30,0x31,0x2e,0x64,0x65,
0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x2c,0x20,
0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,
0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,
0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
/*
#version 300 es
@ -1166,7 +1166,7 @@ vs_trile_source_glsl300es := u8.[
highp float param_8 = _543;
highp float _647 = max(dot(_580, _591), 0.0);
highp vec3 _678 = ((light_proj_pos.xyz / vec3(light_proj_pos.w)) * 0.5) + vec3(0.5);
highp float _682 = _678.z - 0.0005000000237487256526947021484375;
highp float _682 = _678.z - 0.000899999984540045261383056640625;
highp vec3 _762 = _678;
_762.z = _682;
light += (((((((((vec3(1.0) - _613) * (1.0 - _549)) * trixel_material.xyz) * vec3(0.3183410167694091796875)) + ((_613 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * max(dot(_580, _586), 0.0)) * _647) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_762.xy, _682))) * _647) * _201.sunLightColor) * _201.sunIntensity);
@ -1666,59 +1666,59 @@ fs_trile_source_glsl300es := u8.[
0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
0x36,0x38,0x32,0x20,0x3d,0x20,0x5f,0x36,0x37,0x38,0x2e,0x7a,0x20,0x2d,0x20,0x30,
0x2e,0x30,0x30,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x33,0x37,0x34,0x38,
0x37,0x32,0x35,0x36,0x35,0x32,0x36,0x39,0x34,0x37,0x30,0x32,0x31,0x34,0x38,0x34,
0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,
0x65,0x63,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,0x36,0x37,0x38,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x36,
0x38,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d,
0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,
0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,0x29,0x20,0x2a,0x20,0x28,0x31,
0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,
0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,
0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,
0x34,0x31,0x30,0x31,0x36,0x37,0x36,0x39,0x34,0x30,0x39,0x31,0x37,0x39,0x36,0x38,
0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x36,0x31,0x33,0x20,0x2a,0x20,
0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,
0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,
0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,
0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,
0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,0x30,0x2c,0x20,0x5f,
0x35,0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,
0x34,0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,
0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,
0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,
0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,
0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,
0x63,0x33,0x28,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x36,0x38,0x32,
0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2a,0x20,0x5f,0x32,
0x30,0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,
0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,
0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,
0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x52,0x20,0x3d,0x20,0x5f,0x37,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x31,0x38,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,
0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,
0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,
0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,
0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,
0x3d,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,
0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x32,
0x30,0x31,0x2e,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,
0x67,0x68,0x74,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,
0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,
0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,
0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,
0x00,
0x2e,0x30,0x30,0x30,0x38,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x34,0x35,0x34,0x30,
0x30,0x34,0x35,0x32,0x36,0x31,0x33,0x38,0x33,0x30,0x35,0x36,0x36,0x34,0x30,0x36,
0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,
0x63,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,0x36,0x37,0x38,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x36,0x38,
0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d,0x20,
0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,
0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,
0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,
0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,
0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x34,
0x31,0x30,0x31,0x36,0x37,0x36,0x39,0x34,0x30,0x39,0x31,0x37,0x39,0x36,0x38,0x37,
0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x36,0x31,0x33,0x20,0x2a,0x20,0x28,
0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,
0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,
0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,
0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,
0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,
0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,0x30,0x2c,0x20,0x5f,0x35,
0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,
0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,
0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,
0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,
0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,
0x33,0x28,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x36,0x38,0x32,0x29,
0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,
0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x29,
0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,
0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,0x66,
0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,0x30,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,
0x33,0x20,0x52,0x20,0x3d,0x20,0x5f,0x37,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x69,0x66,0x20,0x28,0x5f,0x37,0x31,0x38,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,
0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x76,
0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,
0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,
0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,
0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,
0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x32,0x30,
0x31,0x2e,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,0x67,
0x68,0x74,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,
0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,0x6c,
0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,
0x79,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
/*
#include <metal_stdlib>
@ -2041,7 +2041,7 @@ vs_trile_source_metal_macos := u8.[
float param_8 = _543;
float _647 = fast::max(dot(_580, _591), 0.0);
float3 _678 = ((in.light_proj_pos.xyz / float3(in.light_proj_pos.w)) * 0.5) + float3(0.5);
float _682 = _678.z - 0.0005000000237487256526947021484375;
float _682 = _678.z - 0.000899999984540045261383056640625;
float3 _762 = _678;
_762.z = _682;
light += (((((((((float3(1.0) - _613) * (1.0 - _549)) * trixel_material.xyz) * float3(0.3183410167694091796875)) + ((_613 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / float3(((4.0 * fast::max(dot(_580, _586), 0.0)) * _647) + 9.9999997473787516355514526367188e-05))) * shadowtex.sample_compare(shadowsmp, _762.xy, _682)) * _647) * _201.sunLightColor) * _201.sunIntensity);
@ -2587,61 +2587,61 @@ fs_trile_source_metal_macos := u8.[
0x6f,0x73,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x38,0x32,0x20,0x3d,0x20,0x5f,0x36,
0x37,0x38,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x35,0x30,0x30,0x30,
0x30,0x30,0x30,0x32,0x33,0x37,0x34,0x38,0x37,0x32,0x35,0x36,0x35,0x32,0x36,0x39,
0x34,0x37,0x30,0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,
0x36,0x37,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,
0x3d,0x20,0x5f,0x36,0x38,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,
0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,
0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,
0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,
0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x34,0x31,0x30,0x31,0x36,0x37,0x36,0x39,
0x34,0x30,0x39,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,
0x28,0x5f,0x36,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,
0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,
0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,
0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,
0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,
0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,
0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,
0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,0x30,0x2c,0x20,0x5f,
0x35,0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,
0x34,0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,
0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,
0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,
0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x5f,0x63,0x6f,0x6d,0x70,0x61,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,
0x73,0x6d,0x70,0x2c,0x20,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x36,
0x38,0x32,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2a,0x20,0x5f,
0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,
0x72,0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,
0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,
0x63,0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,0x30,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x52,0x20,0x3d,0x20,
0x5f,0x37,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,
0x31,0x38,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,
0x66,0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x31,0x30,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x30,0x31,
0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,
0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,
0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6d,0x69,0x78,0x28,0x66,
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x30,0x31,0x2e,0x64,0x65,0x65,0x70,0x43,
0x6f,0x6c,0x6f,0x72,0x29,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x2c,0x20,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,
0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,
0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,
0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x37,0x38,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x38,0x39,0x39,0x39,
0x39,0x39,0x39,0x38,0x34,0x35,0x34,0x30,0x30,0x34,0x35,0x32,0x36,0x31,0x33,0x38,
0x33,0x30,0x35,0x36,0x36,0x34,0x30,0x36,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x36,0x32,0x20,0x3d,0x20,0x5f,0x36,
0x37,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x36,0x32,0x2e,0x7a,0x20,0x3d,
0x20,0x5f,0x36,0x38,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,
0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x31,0x33,0x29,
0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x35,0x34,0x39,0x29,0x29,
0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,
0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x34,0x31,0x30,0x31,0x36,0x37,0x36,0x39,0x34,
0x30,0x39,0x31,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,
0x5f,0x36,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,
0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,
0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,
0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,
0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,
0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,
0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x35,0x38,0x30,0x2c,0x20,0x5f,0x35,
0x38,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,
0x37,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,
0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,
0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,
0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x5f,0x63,0x6f,0x6d,0x70,0x61,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,
0x6d,0x70,0x2c,0x20,0x5f,0x37,0x36,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x36,0x38,
0x32,0x29,0x29,0x20,0x2a,0x20,0x5f,0x36,0x34,0x37,0x29,0x20,0x2a,0x20,0x5f,0x32,
0x30,0x31,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,
0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x31,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,
0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
0x74,0x33,0x20,0x5f,0x37,0x31,0x38,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,
0x74,0x28,0x2d,0x5f,0x35,0x38,0x36,0x2c,0x20,0x5f,0x35,0x38,0x30,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x52,0x20,0x3d,0x20,0x5f,
0x37,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x31,
0x38,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,
0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,
0x30,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x30,0x31,0x2e,
0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,
0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6d,0x69,0x78,0x28,0x66,0x6c,
0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x30,0x31,0x2e,0x64,0x65,0x65,0x70,0x43,0x6f,
0x6c,0x6f,0x72,0x29,0x2c,0x20,0x6c,0x69,0x67,0x68,0x74,0x2c,0x20,0x66,0x6c,0x6f,
0x61,0x74,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,
0x2e,0x30,0x2c,0x20,0x5f,0x32,0x30,0x31,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,
0x69,0x67,0x68,0x74,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,
0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
];
trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc {
desc: sg_shader_desc;

View File

@ -241,7 +241,7 @@ void main() {
vec3 light_pos = light_proj_pos.xyz / light_proj_pos.w;
light_pos = light_pos * 0.5 + 0.5;
light_pos.z -= 0.0005;
light_pos.z -= 0.0009;
float shadowp = texture(sampler2DShadow(shadowtex, shadowsmp), light_pos);
light += shadowp * (kD * albedo / PI + specular) * NdotL * sunLightColor * sunIntensity;

4
src/utils.jai Normal file
View File

@ -0,0 +1,4 @@
sign :: (x: float) -> float {
if x < 0 then return -1;
return 1;
}