Повторите фрактальные модели без растяжения - PullRequest
0 голосов
/ 11 марта 2020

Итак, я использую AccidentalNoiseLibrary на Windows 10 для создания шума с этими функциями;

terraintree=
{
    {name="ground_gradient",               type="gradient",         x1=0, x2=0, y1=0, y2=1},

    {name="lowland_shape_fractal",         type="fractal",          fractaltype=anl.BILLOW, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=2, frequency=0.25},
    {name="lowland_autocorrect",           type="autocorrect",      source="lowland_shape_fractal", low=0, high=1},
    {name="lowland_scale",                 type="scaleoffset",      source="lowland_autocorrect", scale=0.125, offset=-0.45},
    {name="lowland_y_scale",               type="scaledomain",      source="lowland_scale", scaley=0},
    {name="lowland_terrain",               type="translatedomain",  source="ground_gradient", ty="lowland_y_scale"},

    {name="highland_shape_fractal",        type="fractal",          fractaltype=anl.FBM, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=4, frequency=2},
    {name="highland_autocorrect",          type="autocorrect",      source="highland_shape_fractal", low=-1, high=1},
    {name="highland_scale",                type="scaleoffset",      source="highland_autocorrect", scale=0.25, offset=0},
    {name="highland_y_scale",              type="scaledomain",      source="highland_scale", scaley=0},
    {name="highland_terrain",              type="translatedomain",  source="ground_gradient", ty="highland_y_scale"},

    {name="mountain_shape_fractal",        type="fractal",          fractaltype=anl.RIDGEDMULTI, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=8, frequency=1},
    {name="mountain_autocorrect",          type="autocorrect",      source="mountain_shape_fractal", low=-1, high=1},
    {name="mountain_scale",                type="scaleoffset",      source="mountain_autocorrect", scale=0.45, offset=0.15},
    {name="mountain_y_scale",              type="scaledomain",      source="mountain_scale", scaley=0.25},
    {name="mountain_terrain",              type="translatedomain",  source="ground_gradient", ty="mountain_y_scale"},

    {name="terrain_type_fractal",          type="fractal",          fractaltype=anl.FBM, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=3, frequency=0.125},
    {name="terrain_autocorrect",           type="autocorrect",      source="terrain_type_fractal", low=0, high=1},
    {name="terrain_type_y_scale",          type="scaledomain",      source="terrain_autocorrect", scaley=0},
    {name="terrain_type_cache",            type="cache",            source="terrain_type_y_scale"},
    {name="highland_mountain_select",      type="select",           low="highland_terrain", high="mountain_terrain", control="terrain_type_cache", threshold=0.55, falloff=0.2},
    {name="highland_lowland_select",       type="select",           low="lowland_terrain", high="highland_mountain_select", control="terrain_type_cache", threshold=0.25, falloff=0.15},
    {name="highland_lowland_select_cache", type="cache",            source="highland_lowland_select"},
    {name="ground_select",                 type="select",           low=0, high=1, threshold=0.5, control="highland_lowland_select_cache"},

    {name="cave_shape",                    type="fractal",           fractaltype=anl.RIDGEDMULTI, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=1, frequency=4},
    {name="cave_attenuate_bias",           type="bias",              source="highland_lowland_select_cache", bias=0.45},
    {name="cave_shape_attenuate",          type="combiner",          operation=anl.MULT, source_0="cave_shape", source_1="cave_attenuate_bias"},
    {name="cave_perturb_fractal",          type="fractal",           fractaltype=anl.FBM, basistype=anl.GRADIENT, interptype=anl.QUINTIC, octaves=6, frequency=3},
    {name="cave_perturb_scale",            type="scaleoffset",       source="cave_perturb_fractal", scale=0.5, offset=0},
    {name="cave_perturb",                  type="translatedomain",   source="cave_shape_attenuate", tx="cave_perturb_scale"},
    {name="cave_select",                   type="select",            low=1, high=0, control="cave_perturb", threshold=0.48, falloff=0},

    {name="ground_cave_multiply",          type="combiner",          operation=anl.MULT, source_0="cave_select", source_1="ground_select"}
}

Хотя вместо создания нескольких шаблонов по размерам ширины и высоты, которые я разделил, он растягивается центральный шаблон, чтобы соответствовать всей области. У меня недостаточно опыта, чтобы понять, возможно ли это, с чем связываться, если я использую правильную библиотеку или какие вопросы задавать. Вот почему я приехал сюда, в надежде, что смогу получить профессиональное представление об этом, так как Google не дает результатов, которые я ищу, и другие форумы также не могут ответить на мой вопрос. Спасибо! = D

...