Particle modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.5
(汉化)
无编辑摘要
第1行: 第1行:
{{version|1.5}}
{{version|1.5}}
{{需要翻译|译者=霜泽图书馆}}


粒子是一种用来创造闪电、雪等视觉效果的特殊实体。
Posteffects are color correction effects that are applied to the lighting in certain areas (volumes) on the map map. They are used to tint the lighting for areas where the lighting would be noticable different, i.e. deserts.


粒子在 '''.asset'''文件中定义,这些文件位于 {{path|gfx/particles/}}.
All posteffects are found in {{path|gfx/posteffect_volumes.txt}}.


== 添加粒子效果 ==
== Posteffect Values ==
{{SVersion|1.5}}
{{SVersion|1.5}}


A posteffect values entry follows this format:


== 添加闪光效果==
{{SVersion|1.5}}
闪光是实体中引用的特殊类型的粒子,例如在战斗动画中枪口的闪光。
下面是一个通用的例子:
<pre>
<pre>
light = {
posteffect_values = {
    name = "name_of_light"
    name = <name>
   inherit = <name>
  
   lut = <path>
    
    
    color = {
    hdr_min_adjustment = <float>
     r = { <float> }
   hdr_max_adjustment = <float>
     g = { <float> }
     b = { <float> }
   }
    
    
    intensity = <float>, fade
    BLOOM_WIDTH = <float>
    radius = <float>
    BLOOM_SCALE = <float>
    falloff = <float>
    BRIGHT_THRESHOLD = <float>
    
    
    position = {
    tonemap_middlegrey = <float>
     x = <float>
     y = <float>
     z = <float>
   }
    
    
    animation = {
}
      name = "name_of_animation"
</pre>
      start = <float>
 
      duration = <float>
'''name''' is the name of the posteffect values entry.
      repeat = yes
 
      op = <type>
'''inherit''' causes the values for the current posteffect to be inherited from the specified posteffect.
      minValue = <float>
 
     maxValue = <float>
'''lut''' is the path for the tone map used for this entry.
      curve = {
 
        <?>
'''hdr_min_adjustment''' defines the minimum adjustment used in the HDR effect.
 
'''hdr_max_adjustment''' defines the maximum adjustment used in the HDR effect.
 
'''BLOOM_WIDTH''' defines the width of the bloom effect.
 
'''BLOOM_SCALE''' defines the scale of the bloom effect.
 
'''BRIGHT_THRESHOLD''' defines the threshold of the bloom effect.
 
'''tonemap_middlegrey''' defines the middle grey used in the tone map.
 
== Volumes ==
{{SVersion|1.5}}
 
=== Position Volume ===
A volume entry specifies an area on the map in which posteffect values are applied. It follows this format:
 
<pre>
posteffect_volumes = {
    posteffect_volume = {
      name = <name>
      posteffect_values_day = <name>
      posteffect_values_night = <name>
      posteffect_values_day_winter = <name>
      posteffect_values_night_winter = <name>
      
     position = {
       <x>
       <y>
       <z>
      }
     size = {
        <width>
       <height>
       <depth>
      }
      }
     fade_distance = <float>
   }
}
</pre>
'''name''' is the name of the volume entry.
'''posteffect_values_day''' is the posteffect values entry to use during the day.
'''posteffect_values_night''' is the posteffect values entry to use during the night.
'''posteffect_values_day_winter''' is the posteffect values entry to use during the day during winter months.
'''posteffect_values_night_winter''' is the posteffect values entry to use during the night during winter months.
'''position''' defines the location of the volume center.
'''size''' defines the size of the volume box.
'''fade_distance''' defines the fade distance for the posteffect values.
=== Height Volume ===
{{SVersion|1.5}}
A height volume entry specifies a height at which to apply posteffect values. It follows this format:
<pre>
posteffect_volumes = {
   posteffect_height_volume = {
     name = <name>
     posteffect_values_day = <name>
     posteffect_values_night = <name>
    
     height = <float>
     fade_distance = <float>
    }
    }
}
}
</pre>
</pre>
* '''name''' 是你所要定义闪光效果的名字。
* '''color''' 定义了光的颜色,通过十进制的RGB取值。
* '''intensity''' 决定了光的强度,而第二个值则决定了光是否会渐渐消失。
* '''radius''' 是光的半径。
* '''falloff''' 是光的衰减梯度。
* '''position''' 是相对于发生光的实体的位置。
* '''animation''' 闪光发生时的动画。


=== 动画 ===
'''name''' is the name of the volume entry.
 
'''posteffect_values_day''' is the posteffect values entry to use during the day.
 
'''posteffect_values_night''' is the posteffect values entry to use during the night.
 
'''height''' defines at which height the values are applied.
 
'''fade_distance''' defines the fade distance for the posteffect values.
 
== Tips ==
{{SVersion|1.5}}
{{SVersion|1.5}}
* '''name''' 是你要定义的动画的名字。
Make use of the console commands: <code>PostEffectVolumes.Enabled</code> and <code>PostEffectVolumes.Draw</code> when working with posteffects. Currently developer-only.
* '''start''' 是曲线的起始位置。
 
* '''duration''' 是动画的持续时间。
You can reload posteffects by using <code>reload posteffectvolumes</code> in the console.
* '''repeat''' 决定了动画是否重复。
* '''op''' 决定了多个源如何混合。可以是乘法(MUL),加法(ADD)或绝对值(ABS)。
* '''minValue''' 是曲线上的最小值。
* '''maxValue''' 是曲线上的最大值。
* '''curve''' 是使用在光上的曲线。




{{Modding navbox}}
{{Modding navbox}}
[[分类:Modding]]
[[分类:Modding]]

2024年9月21日 (六) 19:09的版本

Posteffects are color correction effects that are applied to the lighting in certain areas (volumes) on the map map. They are used to tint the lighting for areas where the lighting would be noticable different, i.e. deserts.

All posteffects are found in /Hearts of Iron IV/gfx/posteffect_volumes.txt.

Posteffect Values

A posteffect values entry follows this format:

posteffect_values = {
    name = <name>
    inherit = <name>
    
    lut = <path>
    
    hdr_min_adjustment = <float>
    hdr_max_adjustment = <float>
    
    BLOOM_WIDTH = <float>
    BLOOM_SCALE = <float>
    BRIGHT_THRESHOLD = <float>
    
    tonemap_middlegrey = <float>
    
}

name is the name of the posteffect values entry.

inherit causes the values for the current posteffect to be inherited from the specified posteffect.

lut is the path for the tone map used for this entry.

hdr_min_adjustment defines the minimum adjustment used in the HDR effect.

hdr_max_adjustment defines the maximum adjustment used in the HDR effect.

BLOOM_WIDTH defines the width of the bloom effect.

BLOOM_SCALE defines the scale of the bloom effect.

BRIGHT_THRESHOLD defines the threshold of the bloom effect.

tonemap_middlegrey defines the middle grey used in the tone map.

Volumes

Position Volume

A volume entry specifies an area on the map in which posteffect values are applied. It follows this format:

posteffect_volumes = {
    posteffect_volume = {
        name = <name>
        posteffect_values_day = <name>
        posteffect_values_night = <name>
        posteffect_values_day_winter = <name>
        posteffect_values_night_winter = <name>
        
        position = {
            <x>
            <y>
            <z>
        }
        size = {
            <width>
            <height>
            <depth>
        }
        fade_distance = <float>
    }
}

name is the name of the volume entry.

posteffect_values_day is the posteffect values entry to use during the day.

posteffect_values_night is the posteffect values entry to use during the night.

posteffect_values_day_winter is the posteffect values entry to use during the day during winter months.

posteffect_values_night_winter is the posteffect values entry to use during the night during winter months.

position defines the location of the volume center.

size defines the size of the volume box.

fade_distance defines the fade distance for the posteffect values.

Height Volume

A height volume entry specifies a height at which to apply posteffect values. It follows this format:

posteffect_volumes = {
    posteffect_height_volume = {
        name = <name>
        posteffect_values_day = <name>
        posteffect_values_night = <name>
        
        height = <float>
        fade_distance = <float>
    }
}

name is the name of the volume entry.

posteffect_values_day is the posteffect values entry to use during the day.

posteffect_values_night is the posteffect values entry to use during the night.

height defines at which height the values are applied.

fade_distance defines the fade distance for the posteffect values.

Tips

Make use of the console commands: PostEffectVolumes.Enabled and PostEffectVolumes.Draw when working with posteffects. Currently developer-only.

You can reload posteffects by using reload posteffectvolumes in the console.