weird grass shader test
This commit is contained in:
parent
726a43370e
commit
1e44d6ddc2
@ -141,14 +141,9 @@ vs_plane_source_glsl430 := u8.[
|
||||
}
|
||||
else
|
||||
{
|
||||
vec2 _63 = vec2(float(int(pos.x * 50000.0)), float(int(pos.z * 50000.0)));
|
||||
vec2 param = _63;
|
||||
if (random(param) < (float(idx) * 0.100000001490116119384765625))
|
||||
{
|
||||
discard;
|
||||
}
|
||||
vec2 param_1 = _63;
|
||||
frag_color = vec4(0.0, random(param_1) + 0.100000001490116119384765625, 0.0, 1.0);
|
||||
vec2 _54 = pos.xy * 10.0;
|
||||
vec2 param = _54;
|
||||
frag_color = vec4(vec3(length(vec2((fract(_54.x) * 2.0) - 1.0, (fract(_54.y) * 2.0) - 1.0))) * 0.100000001490116119384765625, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,28 +194,19 @@ fs_plane_source_glsl430 := u8.[
|
||||
0x63,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,
|
||||
0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x33,0x20,0x3d,0x20,
|
||||
0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x28,0x70,
|
||||
0x6f,0x73,0x2e,0x78,0x20,0x2a,0x20,0x35,0x30,0x30,0x30,0x30,0x2e,0x30,0x29,0x29,
|
||||
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x28,0x70,0x6f,0x73,0x2e,
|
||||
0x7a,0x20,0x2a,0x20,0x35,0x30,0x30,0x30,0x30,0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,
|
||||
0x61,0x6d,0x20,0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x69,0x66,0x20,0x28,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,0x61,0x72,
|
||||
0x61,0x6d,0x29,0x20,0x3c,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x64,0x78,
|
||||
0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,
|
||||
0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,
|
||||
0x35,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,
|
||||
0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,
|
||||
0x31,0x20,0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,
|
||||
0x70,0x6f,0x73,0x2e,0x78,0x79,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,
|
||||
0x6d,0x20,0x3d,0x20,0x5f,0x35,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,
|
||||
0x63,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2b,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,
|
||||
0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,
|
||||
0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,
|
||||
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
0x63,0x34,0x28,0x76,0x65,0x63,0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,
|
||||
0x65,0x63,0x32,0x28,0x28,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x35,0x34,0x2e,0x78,
|
||||
0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,
|
||||
0x28,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x35,0x34,0x2e,0x79,0x29,0x20,0x2a,0x20,
|
||||
0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,
|
||||
0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,
|
||||
0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x31,
|
||||
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
];
|
||||
/*
|
||||
#version 300 es
|
||||
@ -312,14 +298,9 @@ vs_plane_source_glsl300es := u8.[
|
||||
}
|
||||
else
|
||||
{
|
||||
highp vec2 _63 = vec2(float(int(pos.x * 50000.0)), float(int(pos.z * 50000.0)));
|
||||
highp vec2 param = _63;
|
||||
if (random(param) < (float(idx) * 0.100000001490116119384765625))
|
||||
{
|
||||
discard;
|
||||
}
|
||||
highp vec2 param_1 = _63;
|
||||
frag_color = vec4(0.0, random(param_1) + 0.100000001490116119384765625, 0.0, 1.0);
|
||||
highp vec2 _54 = pos.xy * 10.0;
|
||||
highp vec2 param = _54;
|
||||
frag_color = vec4(vec3(length(vec2((fract(_54.x) * 2.0) - 1.0, (fract(_54.y) * 2.0) - 1.0))) * 0.100000001490116119384765625, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,29 +358,19 @@ fs_plane_source_glsl300es := u8.[
|
||||
0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,
|
||||
0x20,0x5f,0x36,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,
|
||||
0x74,0x28,0x69,0x6e,0x74,0x28,0x70,0x6f,0x73,0x2e,0x78,0x20,0x2a,0x20,0x35,0x30,
|
||||
0x30,0x30,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,
|
||||
0x6e,0x74,0x28,0x70,0x6f,0x73,0x2e,0x7a,0x20,0x2a,0x20,0x35,0x30,0x30,0x30,0x30,
|
||||
0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,
|
||||
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,
|
||||
0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,
|
||||
0x66,0x20,0x28,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,
|
||||
0x20,0x3c,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x64,0x78,0x29,0x20,0x2a,
|
||||
0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,
|
||||
0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,
|
||||
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,
|
||||
0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
|
||||
0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x72,0x61,0x6e,0x64,0x6f,
|
||||
0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2b,0x20,0x30,0x2e,0x31,
|
||||
0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,0x70,0x6f,0x73,0x2e,0x78,0x79,0x20,0x2a,0x20,
|
||||
0x31,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,
|
||||
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,
|
||||
0x20,0x5f,0x35,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,
|
||||
0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,
|
||||
0x76,0x65,0x63,0x33,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x65,0x63,0x32,
|
||||
0x28,0x28,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x35,0x34,0x2e,0x78,0x29,0x20,0x2a,
|
||||
0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x28,0x66,0x72,
|
||||
0x61,0x63,0x74,0x28,0x5f,0x35,0x34,0x2e,0x79,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,
|
||||
0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,
|
||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,
|
||||
0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x2c,
|
||||
0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,
|
||||
0x00,
|
||||
0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,
|
||||
0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
];
|
||||
/*
|
||||
#include <metal_stdlib>
|
||||
@ -519,7 +490,6 @@ vs_plane_source_metal_macos := u8.[
|
||||
struct main0_in
|
||||
{
|
||||
float4 pos [[user(locn0)]];
|
||||
int idx [[user(locn1)]];
|
||||
};
|
||||
|
||||
static inline __attribute__((always_inline))
|
||||
@ -537,14 +507,9 @@ vs_plane_source_metal_macos := u8.[
|
||||
}
|
||||
else
|
||||
{
|
||||
float2 _63 = float2(float(int(in.pos.x * 50000.0)), float(int(in.pos.z * 50000.0)));
|
||||
float2 param = _63;
|
||||
if (random(param) < (float(in.idx) * 0.100000001490116119384765625))
|
||||
{
|
||||
discard_fragment();
|
||||
}
|
||||
float2 param_1 = _63;
|
||||
out.frag_color = float4(0.0, random(param_1) + 0.100000001490116119384765625, 0.0, 1.0);
|
||||
float2 _54 = in.pos.xy * 10.0;
|
||||
float2 param = _54;
|
||||
out.frag_color = float4(float3(length(float2((fract(_54.x) * 2.0) - 1.0, (fract(_54.y) * 2.0) - 1.0))) * 0.100000001490116119384765625, 1.0);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@ -586,61 +551,49 @@ fs_plane_source_metal_macos := u8.[
|
||||
0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
|
||||
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,
|
||||
0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x69,0x6e,0x74,0x20,0x69,0x64,0x78,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
|
||||
0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,
|
||||
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,
|
||||
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,
|
||||
0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x20,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,
|
||||
0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x73,0x74,0x29,
|
||||
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,
|
||||
0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x73,0x74,0x2c,0x20,
|
||||
0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30,0x30,
|
||||
0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,
|
||||
0x37,0x36,0x37,0x2e,0x32,0x33,0x32,0x39,0x37,0x31,0x31,0x39,0x31,0x34,0x30,0x36,
|
||||
0x32,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35,0x34,
|
||||
0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,
|
||||
0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,
|
||||
0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,
|
||||
0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,
|
||||
0x73,0x74,0x61,0x6e,0x74,0x20,0x70,0x6c,0x61,0x6e,0x65,0x5f,0x77,0x6f,0x72,0x6c,
|
||||
0x64,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,
|
||||
0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,
|
||||
0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,
|
||||
0x32,0x38,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,
|
||||
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,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,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,
|
||||
0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,
|
||||
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
||||
0x32,0x20,0x5f,0x36,0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,
|
||||
0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x2e,
|
||||
0x78,0x20,0x2a,0x20,0x35,0x30,0x30,0x30,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x66,
|
||||
0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x2e,
|
||||
0x7a,0x20,0x2a,0x20,0x35,0x30,0x30,0x30,0x30,0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,
|
||||
0x61,0x72,0x61,0x6d,0x29,0x20,0x3c,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,
|
||||
0x6e,0x2e,0x69,0x64,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,
|
||||
0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,
|
||||
0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
||||
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,
|
||||
0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,
|
||||
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,
|
||||
0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,
|
||||
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,
|
||||
0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,
|
||||
0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x74,0x68,0x72,0x65,0x61,
|
||||
0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,
|
||||
0x73,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
|
||||
0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x73,
|
||||
0x74,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,
|
||||
0x38,0x30,0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,
|
||||
0x35,0x2c,0x20,0x37,0x36,0x37,0x2e,0x32,0x33,0x32,0x39,0x37,0x31,0x31,0x39,0x31,
|
||||
0x34,0x30,0x36,0x32,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,
|
||||
0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,
|
||||
0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
|
||||
0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,
|
||||
0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,
|
||||
0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x70,0x6c,0x61,0x6e,0x65,0x5f,0x77,
|
||||
0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x32,0x38,
|
||||
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,
|
||||
0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,
|
||||
0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,
|
||||
0x20,0x28,0x5f,0x32,0x38,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x54,0x79,0x70,0x65,0x20,
|
||||
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,
|
||||
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,0x30,0x2e,0x30,0x2c,
|
||||
0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,
|
||||
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,
|
||||
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,
|
||||
0x6f,0x61,0x74,0x32,0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x6f,
|
||||
0x73,0x2e,0x78,0x79,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,
|
||||
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,
|
||||
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,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,0x30,0x2e,0x30,0x2c,0x20,
|
||||
0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,
|
||||
0x2b,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,
|
||||
0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,
|
||||
0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
||||
0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,
|
||||
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
0x6d,0x20,0x3d,0x20,0x5f,0x35,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,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,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,
|
||||
0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x28,0x66,
|
||||
0x72,0x61,0x63,0x74,0x28,0x5f,0x35,0x34,0x2e,0x78,0x29,0x20,0x2a,0x20,0x32,0x2e,
|
||||
0x30,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x28,0x66,0x72,0x61,0x63,0x74,
|
||||
0x28,0x5f,0x35,0x34,0x2e,0x79,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,
|
||||
0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,
|
||||
0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,
|
||||
0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,
|
||||
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
|
||||
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||
];
|
||||
plane_shader_desc :: (backend: sg_backend) -> sg_shader_desc {
|
||||
desc: sg_shader_desc;
|
||||
|
||||
@ -49,15 +49,26 @@ layout(binding=1) uniform plane_world_config {
|
||||
};
|
||||
|
||||
void main() {
|
||||
|
||||
if(planeType == 1) {
|
||||
frag_color = vec4(0.0, 0.0, 1.0, 1.0);
|
||||
} else {
|
||||
vec2 approxPos = vec2(int(pos.x * 50000.0), int(pos.z * 50000.0));
|
||||
float height = random(approxPos);
|
||||
if(height < float(idx) * 0.1) {
|
||||
discard;
|
||||
float density = 10.0;
|
||||
|
||||
vec2 uv = pos.xy * density;
|
||||
vec2 localUV = vec2(fract(uv.x) * 2.0 - 1.0, fract(uv.y) * 2.0 - 1.0);
|
||||
|
||||
float localDistanceFromCenter = length(localUV);
|
||||
|
||||
float rand = random(uv);
|
||||
|
||||
|
||||
bool outsideThickness = localDistanceFromCenter > (0.1 * (rand - pos.y));
|
||||
|
||||
if(outsideThickness) {
|
||||
// discard;
|
||||
}
|
||||
frag_color = vec4(0.0, random(approxPos) + 0.1, 0.0, 1.0);
|
||||
frag_color = vec4(vec3(localDistanceFromCenter) * 0.1, 1.0);
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user