Shader fixes
This commit is contained in:
@@ -93,7 +93,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
|
|||||||
node_shader_add_texture(kong, "gbuffer0");
|
node_shader_add_texture(kong, "gbuffer0");
|
||||||
node_shader_add_texture(kong, "gbuffer1");
|
node_shader_add_texture(kong, "gbuffer1");
|
||||||
node_shader_add_texture(kong, "gbuffer2");
|
node_shader_add_texture(kong, "gbuffer2");
|
||||||
node_shader_write_frag(kong, "var fragcoord: float2 = (input.wvpposition.x / input.wvpposition.w, input.wvpposition.y / input.wvpposition.w) * 0.5 + 0.5;");
|
node_shader_write_frag(kong, "var fragcoord: float2 = float2(input.wvpposition.x / input.wvpposition.w, input.wvpposition.y / input.wvpposition.w) * 0.5 + 0.5;");
|
||||||
node_shader_write_frag(kong, "fragcoord.y = 1.0 - fragcoord.y;");
|
node_shader_write_frag(kong, "fragcoord.y = 1.0 - fragcoord.y;");
|
||||||
node_shader_write_frag(kong, "var gbuffer0_sample: float4 = sample_lod(gbuffer0, sampler_linear, fragcoord, 0.0);");
|
node_shader_write_frag(kong, "var gbuffer0_sample: float4 = sample_lod(gbuffer0, sampler_linear, fragcoord, 0.0);");
|
||||||
node_shader_write_frag(kong, "var gbuffer1_sample: float4 = sample_lod(gbuffer1, sampler_linear, fragcoord, 0.0);");
|
node_shader_write_frag(kong, "var gbuffer1_sample: float4 = sample_lod(gbuffer1, sampler_linear, fragcoord, 0.0);");
|
||||||
@@ -177,7 +177,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
|
|||||||
count += masks.length;
|
count += masks.length;
|
||||||
}
|
}
|
||||||
texture_count += count;
|
texture_count += count;
|
||||||
if (texture_count >= make_mesh_get_max_textures()) {
|
if (texture_count >= GPU_MAX_TEXTURES - 3) {
|
||||||
texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy
|
texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy
|
||||||
make_mesh_layer_pass_count++;
|
make_mesh_layer_pass_count++;
|
||||||
}
|
}
|
||||||
@@ -528,7 +528,3 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
|
|||||||
|
|
||||||
return con_mesh;
|
return con_mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_mesh_get_max_textures(): i32 {
|
|
||||||
return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
|
|||||||
count += masks.length;
|
count += masks.length;
|
||||||
}
|
}
|
||||||
texture_count += count;
|
texture_count += count;
|
||||||
if (texture_count >= make_mesh_get_max_textures()) {
|
if (texture_count >= GPU_MAX_TEXTURES - 3) {
|
||||||
texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy
|
texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy
|
||||||
make_mesh_layer_pass_count++;
|
make_mesh_layer_pass_count++;
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,3 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte
|
|||||||
gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size));
|
gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size));
|
||||||
return con_mesh;
|
return con_mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
function make_mesh_get_max_textures(): i32 {
|
|
||||||
return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES
|
|
||||||
}
|
|
||||||
|
|||||||
Binary file not shown.
@@ -280,7 +280,7 @@ declare function gpu_disable_scissor(): void;
|
|||||||
declare function _gpu_begin(render_target: gpu_texture_t, additional: gpu_texture_t[] = null, depth_buffer: gpu_texture_t = null, flags: i32 = clear_flag_t.NONE, color: i32 = 0, depth: f32 = 0.0): void;
|
declare function _gpu_begin(render_target: gpu_texture_t, additional: gpu_texture_t[] = null, depth_buffer: gpu_texture_t = null, flags: i32 = clear_flag_t.NONE, color: i32 = 0, depth: f32 = 0.0): void;
|
||||||
declare function gpu_end(): void;
|
declare function gpu_end(): void;
|
||||||
declare function gpu_present(): void;
|
declare function gpu_present(): void;
|
||||||
declare function iron_file_save_bytes(path: string, bytes: buffer_t, length?: i32): void;
|
declare function iron_file_save_bytes(path: string, bytes: buffer_t, length: i32 = 0): void;
|
||||||
declare function iron_sys_command(cmd: string): i32;
|
declare function iron_sys_command(cmd: string): i32;
|
||||||
declare function iron_internal_save_path(): string;
|
declare function iron_internal_save_path(): string;
|
||||||
declare function iron_get_arg_count(): i32;
|
declare function iron_get_arg_count(): i32;
|
||||||
@@ -669,6 +669,7 @@ enum compare_mode_t {
|
|||||||
ALWAYS,
|
ALWAYS,
|
||||||
NEVER,
|
NEVER,
|
||||||
LESS,
|
LESS,
|
||||||
|
EQUAL,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum cull_mode_t {
|
enum cull_mode_t {
|
||||||
|
|||||||
@@ -289,6 +289,9 @@ function shader_context_get_compare_mode(s: string): compare_mode_t {
|
|||||||
if (s == "never") {
|
if (s == "never") {
|
||||||
return compare_mode_t.NEVER;
|
return compare_mode_t.NEVER;
|
||||||
}
|
}
|
||||||
|
if (s == "equal") {
|
||||||
|
return compare_mode_t.EQUAL;
|
||||||
|
}
|
||||||
return compare_mode_t.LESS;
|
return compare_mode_t.LESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user