- [Preview Panel] Fix view range not apply to sdf shape.

This commit is contained in:
Tanasart 2024-07-05 07:57:06 +07:00
parent 25b1a9954b
commit 63efb6be3c
6 changed files with 14 additions and 11 deletions

View file

@ -695,9 +695,9 @@ function __initNodes() {
addNodeObject(d3d, "Point Affector", s_node_3d_point_affector, "Node_3D_Point_Affector", [1, Node_3D_Point_Affector],, "Generate array of 3D points interpolating between two values based on the distance.").setVersion(11570);
ds_list_add(d3d, "Ray Marching");
addNodeObject(d3d, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive], ["ray marching"]).setVersion(11720);
addNodeObject(d3d, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive], ["ray marching", "rm object"]).setVersion(11720);
addNodeObject(d3d, "RM Terrain", s_node_rm_terrain, "Node_RM_Terrain", [1, Node_RM_Terrain], ["ray marching"]).setVersion(11720);
addNodeObject(d3d, "RM Combine", s_node_rm_combine, "Node_RM_Combine", [1, Node_RM_Combine], ["ray marching"]).setVersion(11740);
addNodeObject(d3d, "RM Combine", s_node_rm_combine, "Node_RM_Combine", [1, Node_RM_Combine], ["ray marching", "rm boolean"]).setVersion(11740);
addNodeObject(d3d, "RM Render", s_node_rm_render, "Node_RM_Render", [1, Node_RM_Render], ["ray marching"]).setVersion(11740);
#endregion

View file

@ -1,5 +1,5 @@
{
"$GMScript":"v1",
"$GMScript":"",
"%Name":"node_registry",
"isCompatibility":false,
"isDnD":false,

View file

@ -1211,6 +1211,7 @@ function Panel_Preview() : PanelContent() constructor {
shader_set_f("gridStep", _step);
shader_set_f("gridScale", zm / 2);
shader_set_f("axisBlend", 1.);
shader_set_f("viewRange", [ d3_view_camera.view_near, d3_view_camera.view_far ]);
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, w, h);
shader_reset();

View file

@ -1,5 +1,5 @@
{
"$GMScript":"v1",
"$GMScript":"",
"%Name":"panel_preview",
"isCompatibility":false,
"isDnD":false,

View file

@ -13,15 +13,17 @@ function string_partial_match(str, key) { #region
var conMax = 0;
var misMatch = 0;
var kchr = string_char_at(key, run);
var ch;
for( var i = 1; i <= amo; i++ ) {
var ch = string_char_at(str, i);
ch = string_char_at(str, i);
if(ch == kchr) {
consec++;
conMax = max(conMax, consec);
run++;
if(run > string_length(key)) return conMax - (misMatch + (amo - i));
kchr = string_char_at(key, run);
} else {
consec = 0;
misMatch += amo - i;