diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 600896c50..d7407da2d 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -1896,6 +1896,7 @@ {"name":"s_node_rigidSim_render_output","order":10,"path":"sprites/s_node_rigidSim_render_output/s_node_rigidSim_render_output.yy",}, {"name":"s_node_rigidSim_renderer","order":1,"path":"sprites/s_node_rigidSim_renderer/s_node_rigidSim_renderer.yy",}, {"name":"s_node_rigidSim_wall","order":11,"path":"sprites/s_node_rigidSim_wall/s_node_rigidSim_wall.yy",}, + {"name":"s_node_rm_primitive","order":51,"path":"sprites/s_node_rm_primitive/s_node_rm_primitive.yy",}, {"name":"s_node_sampler","order":19,"path":"sprites/s_node_sampler/s_node_sampler.yy",}, {"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",}, {"name":"s_node_scale","order":6,"path":"sprites/s_node_scale/s_node_scale.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 917c7ff4a..192337a9e 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -2470,6 +2470,7 @@ {"id":{"name":"s_node_rigidSim_renderer","path":"sprites/s_node_rigidSim_renderer/s_node_rigidSim_renderer.yy",},}, {"id":{"name":"s_node_rigidSim_wall","path":"sprites/s_node_rigidSim_wall/s_node_rigidSim_wall.yy",},}, {"id":{"name":"s_node_rigidSim","path":"sprites/s_node_rigidSim/s_node_rigidSim.yy",},}, + {"id":{"name":"s_node_rm_primitive","path":"sprites/s_node_rm_primitive/s_node_rm_primitive.yy",},}, {"id":{"name":"s_node_sampler","path":"sprites/s_node_sampler/s_node_sampler.yy",},}, {"id":{"name":"s_node_scale_algo","path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},}, {"id":{"name":"s_node_scale","path":"sprites/s_node_scale/s_node_scale.yy",},}, diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index f29f257d5..763ecf3cc 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -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_mk_rain, "Node_RM_Primitive", [1, Node_RM_Primitive]).setVersion(11720); + addNodeObject(generator, "RM Primitive", s_node_rm_primitive, "Node_RM_Primitive", [1, Node_RM_Primitive]).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); diff --git a/scripts/node_rm_primitive/node_rm_primitive.gml b/scripts/node_rm_primitive/node_rm_primitive.gml index 318870bac..2929f2c07 100644 --- a/scripts/node_rm_primitive/node_rm_primitive.gml +++ b/scripts/node_rm_primitive/node_rm_primitive.gml @@ -110,6 +110,9 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// + inputs[| 29] = nodeValue("Tile Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ]) + .setDisplay(VALUE_DISPLAY.vector); + outputs[| 0] = nodeValue("Surface Out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); input_display_list = [ 0, @@ -118,7 +121,8 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro ["Deform", true], 15, 16, 17, 18, 19, ["Transform", false], 3, 4, ["Camera", false], 13, 14, 5, 6, - ["Render", false], 7, 9, 10, 8, 20, + ["Render", false], 7, 9, 10, 8, 20, 29, + ["Tile", false], 20, 29, ]; static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {} @@ -246,6 +250,7 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro var _heig = _data[26]; var _radR = _data[27]; var _sizz = _data[28]; + var _tilA = _data[29]; _outSurf = surface_verify(_outSurf, _dim[0], _dim[1]); @@ -273,12 +278,13 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro shader_set_f("rotation", _rot); shader_set_f("objectScale", _sca); - shader_set_i("ortho", _ort); - shader_set_f("fov", _fov); - shader_set_f("orthoScale",_ortS); - shader_set_f("viewRange", _rng); - shader_set_f("depthInt", _dpi); - shader_set_f("tileSize", _tile); + shader_set_i("ortho", _ort); + shader_set_f("fov", _fov); + shader_set_f("orthoScale", _ortS); + shader_set_f("viewRange", _rng); + shader_set_f("depthInt", _dpi); + shader_set_f("tileSize", _tile); + shader_set_f("tileAmount", _tilA); shader_set_color("ambient", _amb); shader_set_f("ambientIntns", _ambI); @@ -289,4 +295,4 @@ function Node_RM_Primitive(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro return _outSurf; } -} \ No newline at end of file +} diff --git a/shaders/sh_rm_primitive/sh_rm_primitive.fsh b/shaders/sh_rm_primitive/sh_rm_primitive.fsh index 524b340fa..4ff838847 100644 --- a/shaders/sh_rm_primitive/sh_rm_primitive.fsh +++ b/shaders/sh_rm_primitive/sh_rm_primitive.fsh @@ -36,6 +36,7 @@ uniform float orthoScale; uniform vec2 viewRange; uniform float depthInt; uniform vec3 tileSize; +uniform vec3 tileAmount; uniform vec4 ambient; uniform float ambientIntns; @@ -313,8 +314,9 @@ uniform vec3 lightPosition; vec3 round(vec3 v) { return vec3(round(v.x), round(v.y), round(v.z)); } vec3 tilePosition(vec3 p) { - vec3 q = p - tileSize * round(p / tileSize); - return q; + if(tileAmount == vec3(0.)) + return p - tileSize * round(p / tileSize); + return p - tileSize * clamp(round(p / tileSize), -tileAmount, tileAmount); } #endregion diff --git a/sprites/s_node_rm_primitive/ce9d62bd-3878-41e3-b28e-0325c98d8a73.png b/sprites/s_node_rm_primitive/ce9d62bd-3878-41e3-b28e-0325c98d8a73.png new file mode 100644 index 000000000..eb51b7acd Binary files /dev/null and b/sprites/s_node_rm_primitive/ce9d62bd-3878-41e3-b28e-0325c98d8a73.png differ diff --git a/sprites/s_node_rm_primitive/layers/ce9d62bd-3878-41e3-b28e-0325c98d8a73/e4b2e1fb-aa71-423e-b4ac-9a9e83f702fa.png b/sprites/s_node_rm_primitive/layers/ce9d62bd-3878-41e3-b28e-0325c98d8a73/e4b2e1fb-aa71-423e-b4ac-9a9e83f702fa.png new file mode 100644 index 000000000..eb51b7acd Binary files /dev/null and b/sprites/s_node_rm_primitive/layers/ce9d62bd-3878-41e3-b28e-0325c98d8a73/e4b2e1fb-aa71-423e-b4ac-9a9e83f702fa.png differ diff --git a/sprites/s_node_rm_primitive/s_node_rm_primitive.yy b/sprites/s_node_rm_primitive/s_node_rm_primitive.yy new file mode 100644 index 000000000..82625acb0 --- /dev/null +++ b/sprites/s_node_rm_primitive/s_node_rm_primitive.yy @@ -0,0 +1,90 @@ +{ + "$GMSprite":"", + "%Name":"s_node_rm_primitive", + "bboxMode":0, + "bbox_bottom":61, + "bbox_left":3, + "bbox_right":61, + "bbox_top":3, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"ce9d62bd-3878-41e3-b28e-0325c98d8a73","name":"ce9d62bd-3878-41e3-b28e-0325c98d8a73","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":64, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"e4b2e1fb-aa71-423e-b4ac-9a9e83f702fa","blendMode":0,"displayName":"default","isLocked":false,"name":"e4b2e1fb-aa71-423e-b4ac-9a9e83f702fa","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"s_node_rm_primitive", + "nineSlice":null, + "origin":4, + "parent":{ + "name":"generator", + "path":"folders/nodes/icons/generator.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"s_node_rm_primitive", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":1.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"s_node_rm_primitive", + "playback":1, + "playbackSpeed":30.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"ce9d62bd-3878-41e3-b28e-0325c98d8a73","path":"sprites/s_node_rm_primitive/s_node_rm_primitive.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"df2b1365-2924-4580-83f6-e78b42c66e83","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":32, + "yorigin":32, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":64, +} \ No newline at end of file