This commit is contained in:
Tanasart 2024-05-30 13:44:11 +07:00
parent a3cd8846f7
commit a69e3a9598
9 changed files with 18 additions and 14 deletions

View file

@ -752,7 +752,7 @@ function __initNodes() {
addNodeObject(generator, "Flood Fill", s_node_flood_fill, "Node_Flood_Fill", [1, Node_Flood_Fill],, "Filled connected pixel given position and color.").setVersion(1133);
ds_list_add(generator, "Ray March");
addNodeObject(generator, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive]).setVersion(11720);
addNodeObject(generator, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive], ["ray marching"]).setVersion(11720);
ds_list_add(generator, "MK Effects");
addNodeObject(generator, "MK Rain", s_node_mk_rain, "Node_MK_Rain", [1, Node_MK_Rain]).setVersion(11600);

View file

@ -317,6 +317,8 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
for (var i = 0, n = array_length(temp_surface); i < n; i++)
shader_set_surface($"texture{i}", temp_surface[i]);
shader_set_f("time", CURRENT_FRAME / TOTAL_FRAMES);
shader_set_i("shape", _shpI);
shader_set_f("size", _size);
shader_set_f("radius", _rad);

View file

@ -50,7 +50,7 @@ function Panel_Palette_Mixer() : PanelContent() constructor {
node_hovering = noone;
node_dragging = noone;
node_drag_mx = 0;
node_drag_my = 0;
node_drag_my = 0;
node_drag_sx = 0;
node_drag_sy = 0;
node_selecting = noone;

View file

@ -18,6 +18,8 @@ uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
uniform float time;
uniform int shape;
uniform vec3 size;
uniform float radius;
@ -306,7 +308,7 @@ mat3 rotMatrix, irotMatrix;
vec4 sm = sampleTexture(extrudeSurface, pos);
float am = (sm.r + sm.g + sm.b) / 3. * sm.a;
float d = 0.1 - am;
float d = 0.3 - am;
vec2 w = vec2( d, abs(p.y) - h );
return min(max(w.x, w.y), 0.0) + length(max(w, 0.0));
}
@ -486,9 +488,6 @@ void main() {
if(dist > viewRange.y - EPSILON) // Not hitting anything.
return;
// if(sin(wcoll.y * 64.) > -.9)
// return;
vec3 c = ambient.rgb;
float distNorm = 1. - (dist - viewRange.x) / (viewRange.y - viewRange.x);
@ -501,5 +500,8 @@ void main() {
c *= lamo;
// if(sin((wcoll.y + time * PI * 2.) * 96.) < -.9)
// c *= 4.;
gl_FragColor = vec4(c, 1.);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -2,24 +2,24 @@
"$GMSprite":"",
"%Name":"s_node_rm_primitive",
"bboxMode":0,
"bbox_bottom":62,
"bbox_left":6,
"bbox_right":62,
"bbox_top":5,
"bbox_bottom":63,
"bbox_left":2,
"bbox_right":60,
"bbox_top":1,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"9fcdf9f9-ba78-46c9-b253-0c8ab869e7fd","name":"9fcdf9f9-ba78-46c9-b253-0c8ab869e7fd","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"1edabec3-254d-42f4-8d2c-52898860ab0c","name":"1edabec3-254d-42f4-8d2c-52898860ab0c","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"eae4b9cd-265e-4fa2-9fa6-1e3d16f2efcf","blendMode":0,"displayName":"default","isLocked":false,"name":"eae4b9cd-265e-4fa2-9fa6-1e3d16f2efcf","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"30e25e94-92fd-4e97-87a4-b6fe46ef67a9","blendMode":0,"displayName":"default","isLocked":false,"name":"30e25e94-92fd-4e97-87a4-b6fe46ef67a9","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_rm_primitive",
"nineSlice":null,
@ -69,8 +69,8 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"9fcdf9f9-ba78-46c9-b253-0c8ab869e7fd","path":"sprites/s_node_rm_primitive/s_node_rm_primitive.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"32fef19e-0a12-4c33-a385-a86daf2a08de","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"1edabec3-254d-42f4-8d2c-52898860ab0c","path":"sprites/s_node_rm_primitive/s_node_rm_primitive.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"22ee247f-a875-4591-afa7-cb8d52f409c7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,