YOUR ACCOUNT

Login or Register to post new topics or replies
mitaywalle
Great to meet you :)

Posts: 177
Filters: 63
This snippet allow to make simmetry, or some rescale operations inside tiles, but saves ability to decrease "Size, Pixels" and apply randomization advantagies. Unfortunately this technique stop work with forces seamless tiling



In general: basic graient + (image bounds free gradient * SIZE)

Code
function prepare()
   -- This function is called once,
   -- before the rendering begins.
   -- Use it for querying non-mapped
   -- inputs and precalculation.
   is_X = get_checkbox_input(X_OR_Y)
   max = SIZE
   if (is_X) then
      max = max * SEAMLESS_REGION_WIDTH
   else
      max = max * SEAMLESS_REGION_HEIGHT
   end;
end;

function get_sample(x, y)
   -- Image generation code goes here.
   local remapGradient = get_sample_grayscale(x, y, GRADIENT)
   
   if is_X then
      x = round(x)
   else
      y = round(y)
   end;
   local globalV = get_sample_grayscale(x, y, IMAGEGRADIENT) * max
   local result = remapGradient + globalV
   return result, result, result, 1
end;

function round(num)
   return math.floor(num)
   --local mult = 10^(numDecimalPlaces or 0)
   --return math.floor(num * mult) / mult
end


Simmetry inside randomized tiles.ffxml
Randomize everithing!
  Details E-Mail
mitaywalle
Great to meet you :)

Posts: 177
Filters: 63
showing changing "Size, pixels" with saved "local" in tile simmetry

Randomize everithing!
  Details E-Mail
mitaywalle
Great to meet you :)

Posts: 177
Filters: 63
If you dont need so much control on scaling, or need seamless tiling, or may be performance is very important, you can use this snippet from Creeps 2 by WarpZone

Randomize everithing!
  Details E-Mail
Grimbly
Grimbly
Posts: 68
Seeing as your Spaceship Lab filter is for FF9 would it be safe to assume this is as well?
  Details E-Mail
mitaywalle
Great to meet you :)

Posts: 177
Filters: 63
Some fixes in code

Code
function prepare()
   -- This function is called once,
   -- before the rendering begins.
   -- Use it for querying non-mapped
   -- inputs and precalculation.
   is_X = get_checkbox_input(X_OR_Y)
   if (is_X) then
      max = SEAMLESS_REGION_WIDTH
   else
      max = SEAMLESS_REGION_HEIGHT
   end;
end;

function get_sample(x, y)
   -- Image generation code goes here.
   local remapGradient = get_sample_grayscale(x, y, GRADIENT)
   
   if is_X then
      x = round(x)
   else
      y = round(y)
   end;
   local globalV = get_sample_grayscale(x, y, IMAGEGRADIENT) * max
   remapGradient = remapGradient + globalV
   return remapGradient, remapGradient, remapGradient, 1
end;

function round(num, numDecimalPlaces)
  local mult = 10^(numDecimalPlaces or 0)
  return math.floor(num * mult) / mult
end


Basic Nodes

Randomize everithing!
  Details E-Mail
mitaywalle
Great to meet you :)

Posts: 177
Filters: 63
Quote
Grimbly wrote:
Seeing as your Spaceship Lab filter is for FF9 would it be safe to assume this is as well?


here you go, backported to FF4

local simmetry randomized tiles.ffxml
Randomize everithing!
  Details E-Mail
Grimbly
Grimbly
Posts: 68
Awesome. Thanks. I'm gonna play around with this as soon as I get a chance to smile:)
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,711 Registered Users
+18 new in 30 days!

153,531 Posts
+39 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

25 unregistered users.