Dimension Effects Modifiers - MehVahdJukaar/polytone GitHub Wiki

Dimension Effects Modifiers

Dimension Effects allow you to tweak various visuals Simension parameters as well as other existing ones on a per Dimension basis

These include:

  • Fog Colormap
  • Sky Colormap
  • Sunset Colors
  • Cloud Level
  • Ambient Lighting

Getting Started

The file will have to be in assets/[dimension namespace]/polytone/dimension_modifiers/[dimension path].json.

For example if you want to modify minecraft:the_nether you can do so with a file located in assets/minecraft/polytone/biome_effects/the_nether.json

Explicit targeting

Alternatively, if you want to manually specify your targets you can place this json in assets/[your pack namespace]/polytone/dimension_modifiers/[some name].json (Any path will work but this is recommended to avoid overwriting Implicit defined targets).

Then you can add the targets field to the json containing a list of valid Dimension ids as follows:

{
   "targets": ["minecraft:overworld", "twilightforest:twilightforest"]
}

Json Structure

Here's a list of all the json file attributes and their function

1.21.5 and before

attribute name explanation
fog_colormap A Colormap that determines the fog color of the Dimension. Will override ALL biome specific colors in that dimension, even ones changed with Biome Effects
sky_colormap A Colormap that determines the sky color of the Dimension. Will override ALL biome specific colors in that dimension, even ones changed with Biome Effects
sunset_colormap A Colormap that determines the sunset color of the Dimension
cloud_level Cloud Y level. Can be a number or an expression
has_ground Affects the sky renderer. Used in the end for example
sky_type Can be either NONE, NORMAL (OVERWORLD in 1.21.4+), END
force_bright_lightmap Changes how lightmap work in the dimension. Used in The End
constant_ambient_light Makes lightmap brighter. Used in The End
no_weather_fog_darken Makes fog color not get darkened during rain and thunder
no_weather_sky_darken Makes sky color not get darkened during rain and thunder
targets A list of ids or tag of dimensions to target used for explicit targeting. If empty it will go by the file name. Can also contain an entire Dimension Type Json instead and will match all dimensions that have those poperties. Check the minecraft wiki for more info on dimension types jsons

Here is an example of how the .json could look.

{
   "fog_colormap": "my_namespace:my_colormap",
   "could_level": 70,
   "has_ground": false
}

Example of a "dimension template" explicit targeting type, will target all dimensions where fire does not get put off.

{
   "targets": {
    "infiniburn": true
   },
   "sky_type": "END"
}

1.21.11 and above

attribute name explanation
attributes_modifiers Attribute Modifiers. Allows to customize most so many game parameters. Read about them on their wiki page
skybox Can be none, end or overworld
cardinal_light How light is applied onto blocks. Can be default or nether
ambient_light Amount of ambient light in the dimension
has_skylight If it has skylight like the end
lightmap Unused (WIP)
targets A list of ids or tag of dimensions to target used for explicit targeting. If empty it will go by the file name. Can also contain an entire Dimension Type Json instead and will match all dimensions that have those poperties. Check the minecraft wiki for more info on dimension types jsons

Colormaps

(<=1.21.5)

When adding Sky, Fog or Sunset Colormaps you can, as usual, reference existing previously defined Colormaps like in the example above.

If you want, as in other places, you can also inline a colormap definition (read about them in their own as well as the Block Modifiers pages).

When inlining, similarly to what was done in block modifiers, you'll have to place a texture file in the same path as the .json file.

Its name will have to be [json_name]_sky.png and or [json_name]_fog.png and or [json_name]_sunset.png depending on the colormaps that you added. When just adding one of the three, adding a single texture called [json_name].png will aslo work.

Sunset Colormaps

(<=1.21.5)

Being a little diffeernt than the rest, here's a section talking about the Sunset Colormap specifically.

The colormap works like any other so you can tweak them like you did with those.

By default it will use these samplers (you dont need to copy these, they are implied, just here to explain the vanilla behavior)

{
 "x_axis": "1 - ((DAY_TIME/24000)%1)",
 "y_axis": "0"
}

As you can see the Vanilla-equivalent "implementation" of a sunset color samples a 1D texture linearlly depending on the time of day (0-24000). The x_axis sampler above is also equivalent to the builtin "day_time" one too.

Here's a high resolution texture which closely matches what the game uses internally. Note that as with all colormaps the smoother the texture is, the smoother color transitions will be. Texture has is 10 pixel wide justbecause its easier to see. you can make any dimension you like but vanilla Impl just has it as a 1D one since Y sampler is 0. Texture is quite large so you might want to scale it down.

sunrise_colors

Attributes Modifiers

(1.21.11+)

Environment Attribute modifiers are a very powerful concept explained in detail in the Environment Attributes Wiki page.

These will allow you to edit a miriad of game parameters like fog, sun, stars, sky, cloud and much more in a modular and per biome fashion.

To do so you'll have to follow the instructions on the before mentioned page and add it to the attributes_modifiers field in your Dimension Modifier json.