Refine Bengal pattern and fog blending
This commit is contained in:
parent
2159798d1a
commit
5ec62b8465
5 changed files with 77 additions and 13 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 277 KiB |
|
|
@ -175,7 +175,7 @@ authored `mesh_style.png` filenames.
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| Bengal spots, body and arms | `body_arms_bengal.png` | `art/exported/characters/patterns/bengal/body_arms_bengal.png` | `fa90bd4e74b0b770ce97bf69d069676f5d4bd1f5d649f89e09638a66b61a8470` |
|
| Bengal spots, body and arms | `body_arms_bengal.png` | `art/exported/characters/patterns/bengal/body_arms_bengal.png` | `fa90bd4e74b0b770ce97bf69d069676f5d4bd1f5d649f89e09638a66b61a8470` |
|
||||||
| Bengal spots, main body | `body_main_bengal.png` | `art/exported/characters/patterns/bengal/body_main_bengal.png` | `8662fa198220cfdbe0aa83bdeeef7b855e20124d74f8481467f750d32b67ee8b` |
|
| Bengal spots, main body | `body_main_bengal.png` | `art/exported/characters/patterns/bengal/body_main_bengal.png` | `8662fa198220cfdbe0aa83bdeeef7b855e20124d74f8481467f750d32b67ee8b` |
|
||||||
| Bengal spots, round head | `head_round_bengal.png` | `art/exported/characters/patterns/bengal/head_round_bengal.png` | `7a48c5ac47cfd35ddec1783e6c4defa7807b5ef3f1c6b428157fbc0651e71ef3` |
|
| Bengal spots, round head | `head_round_bengal.png` | `art/exported/characters/patterns/bengal/head_round_bengal.png` | `c464b042397f5ffe371c48a711ec3d7257adf794d363f3116cb2bddc23e444f8` |
|
||||||
| Fox, body and arms | `body_arms_fox.png` | `art/exported/characters/patterns/fox/body_arms_fox.png` | `fd2ab31ede371129ca4806480783d57153318a909d6b87c593b6ff82d03d65eb` |
|
| Fox, body and arms | `body_arms_fox.png` | `art/exported/characters/patterns/fox/body_arms_fox.png` | `fd2ab31ede371129ca4806480783d57153318a909d6b87c593b6ff82d03d65eb` |
|
||||||
| Fox, main body | `body_main_fox.png` | `art/exported/characters/patterns/fox/body_main_fox.png` | `d2a975cf042728299de4819a023a95e9c1467671a6886f6c6eaf8b44a5a9ca3a` |
|
| Fox, main body | `body_main_fox.png` | `art/exported/characters/patterns/fox/body_main_fox.png` | `d2a975cf042728299de4819a023a95e9c1467671a6886f6c6eaf8b44a5a9ca3a` |
|
||||||
| Fox, pointy head | `head_pointy_fox.png` | `art/exported/characters/patterns/fox/head_pointy_fox.png` | `8e74685ef7a9f61b5ae75c16e86898ea80f3996471e2999862479798ce28aa52` |
|
| Fox, pointy head | `head_pointy_fox.png` | `art/exported/characters/patterns/fox/head_pointy_fox.png` | `8e74685ef7a9f61b5ae75c16e86898ea80f3996471e2999862479798ce28aa52` |
|
||||||
|
|
|
||||||
|
|
@ -311,6 +311,19 @@ func _validate_environment_presentation() -> void:
|
||||||
assert(float(
|
assert(float(
|
||||||
SaltWaterMaterial.get_shader_parameter("weather_fog_amount")
|
SaltWaterMaterial.get_shader_parameter("weather_fog_amount")
|
||||||
) > 0.99)
|
) > 0.99)
|
||||||
|
var night_rendered_fog_color := Color(
|
||||||
|
runtime_environment.fog_light_color.r
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
runtime_environment.fog_light_color.g
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
runtime_environment.fog_light_color.b
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
1.0,
|
||||||
|
)
|
||||||
|
var night_water_fog_color := (
|
||||||
|
SaltWaterMaterial.get_shader_parameter("weather_fog_color") as Color
|
||||||
|
)
|
||||||
|
assert(night_water_fog_color.is_equal_approx(night_rendered_fog_color))
|
||||||
var foggy_sky_horizon := (
|
var foggy_sky_horizon := (
|
||||||
runtime_sky_material.get_shader_parameter("sky_horizon_color") as Color
|
runtime_sky_material.get_shader_parameter("sky_horizon_color") as Color
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,16 @@ func _validate_weather_presentation() -> void:
|
||||||
"weather_fog_color"
|
"weather_fog_color"
|
||||||
) as Color
|
) as Color
|
||||||
)
|
)
|
||||||
assert(water_fog_color.get_luminance() < 0.05)
|
var rendered_fog_color := Color(
|
||||||
|
runtime_environment.fog_light_color.r
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
runtime_environment.fog_light_color.g
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
runtime_environment.fog_light_color.b
|
||||||
|
* runtime_environment.fog_light_energy,
|
||||||
|
1.0,
|
||||||
|
)
|
||||||
|
assert(water_fog_color.is_equal_approx(rendered_fog_color))
|
||||||
assert(runtime_environment.fog_depth_begin <= 4.01)
|
assert(runtime_environment.fog_depth_begin <= 4.01)
|
||||||
assert(is_equal_approx(runtime_environment.fog_depth_end, 18.0))
|
assert(is_equal_approx(runtime_environment.fog_depth_end, 18.0))
|
||||||
assert(is_equal_approx(runtime_environment.fog_sky_affect, 1.0))
|
assert(is_equal_approx(runtime_environment.fog_sky_affect, 1.0))
|
||||||
|
|
@ -386,6 +395,16 @@ func _validate_weather_presentation() -> void:
|
||||||
"weather_fog_amount"
|
"weather_fog_amount"
|
||||||
)
|
)
|
||||||
) > 0.99)
|
) > 0.99)
|
||||||
|
var rainy_water_fog_color := (
|
||||||
|
WorldTimeVisualControllerType.SALT_WATER_MATERIAL.get_shader_parameter(
|
||||||
|
"weather_fog_color"
|
||||||
|
) as Color
|
||||||
|
)
|
||||||
|
assert(
|
||||||
|
rainy_water_fog_color.is_equal_approx(
|
||||||
|
WorldTimeVisualControllerType.RAIN_WATER_FOG_COLOR
|
||||||
|
)
|
||||||
|
)
|
||||||
assert(is_equal_approx(runtime_environment.fog_sky_affect, 0.68))
|
assert(is_equal_approx(runtime_environment.fog_sky_affect, 0.68))
|
||||||
assert(
|
assert(
|
||||||
float(runtime_sky_material.get_shader_parameter("cloud_coverage"))
|
float(runtime_sky_material.get_shader_parameter("cloud_coverage"))
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ const FOG_DAYLIGHT_FOG_LIGHT_BRIGHTNESS: float = 0.42
|
||||||
const FOG_DAYLIGHT_WATER_BRIGHTNESS: float = 0.42
|
const FOG_DAYLIGHT_WATER_BRIGHTNESS: float = 0.42
|
||||||
const FOG_DAYLIGHT_POST_BRIGHTNESS: float = 0.50
|
const FOG_DAYLIGHT_POST_BRIGHTNESS: float = 0.50
|
||||||
const RAIN_DAYLIGHT_POST_BRIGHTNESS: float = 0.52
|
const RAIN_DAYLIGHT_POST_BRIGHTNESS: float = 0.52
|
||||||
const WATER_FOG_COLOR := Color(0.025, 0.038, 0.045)
|
const RAIN_WATER_FOG_COLOR := Color(0.025, 0.038, 0.045)
|
||||||
const SALT_WATER_MATERIAL: ShaderMaterial = preload(
|
const SALT_WATER_MATERIAL: ShaderMaterial = preload(
|
||||||
"res://world/materials/stylized_water.tres"
|
"res://world/materials/stylized_water.tres"
|
||||||
)
|
)
|
||||||
|
|
@ -251,13 +251,14 @@ func _apply_time(time_hours: float) -> void:
|
||||||
var fog_color: Color = _blended_color(
|
var fog_color: Color = _blended_color(
|
||||||
NIGHT_FOG, DAY_FOG, WARM_FOG, daylight, warmth
|
NIGHT_FOG, DAY_FOG, WARM_FOG, daylight, warmth
|
||||||
)
|
)
|
||||||
var fog_daylight_amount: float = (
|
var foggy_fog_amount: float = _weather_value(0.0, 0.0, 0.0, 1.0)
|
||||||
daylight * _weather_value(0.0, 0.0, 0.0, 1.0)
|
var rain_fog_amount: float = _weather_value(0.0, 0.0, 1.0, 0.0)
|
||||||
|
var fog_daylight_amount: float = daylight * foggy_fog_amount
|
||||||
|
var rain_daylight_amount: float = daylight * rain_fog_amount
|
||||||
|
var weather_fog_amount: float = minf(
|
||||||
|
rain_fog_amount + foggy_fog_amount,
|
||||||
|
1.0,
|
||||||
)
|
)
|
||||||
var rain_daylight_amount: float = (
|
|
||||||
daylight * _weather_value(0.0, 0.0, 1.0, 0.0)
|
|
||||||
)
|
|
||||||
var weather_fog_amount: float = _weather_value(0.0, 0.0, 1.0, 1.0)
|
|
||||||
_environment.fog_enabled = weather_fog_amount > 0.001
|
_environment.fog_enabled = weather_fog_amount > 0.001
|
||||||
var fog_scene_brightness: float = lerpf(
|
var fog_scene_brightness: float = lerpf(
|
||||||
1.0,
|
1.0,
|
||||||
|
|
@ -292,7 +293,7 @@ func _apply_time(time_hours: float) -> void:
|
||||||
* fog_scene_brightness
|
* fog_scene_brightness
|
||||||
)
|
)
|
||||||
_environment.fog_light_color = fog_color
|
_environment.fog_light_color = fog_color
|
||||||
_environment.fog_light_energy = (
|
var fog_light_energy := (
|
||||||
lerpf(0.56, 0.82, daylight)
|
lerpf(0.56, 0.82, daylight)
|
||||||
* _weather_value(1.0, 0.92, 0.82, 1.0)
|
* _weather_value(1.0, 0.92, 0.82, 1.0)
|
||||||
* lerpf(
|
* lerpf(
|
||||||
|
|
@ -301,6 +302,7 @@ func _apply_time(time_hours: float) -> void:
|
||||||
fog_daylight_amount,
|
fog_daylight_amount,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
_environment.fog_light_energy = fog_light_energy
|
||||||
_environment.fog_aerial_perspective = _weather_value(
|
_environment.fog_aerial_perspective = _weather_value(
|
||||||
0.35, 0.48, 0.62, 0.0
|
0.35, 0.48, 0.62, 0.0
|
||||||
)
|
)
|
||||||
|
|
@ -316,7 +318,13 @@ func _apply_time(time_hours: float) -> void:
|
||||||
_environment.fog_depth_end = _weather_value(
|
_environment.fog_depth_end = _weather_value(
|
||||||
170.0, 140.0, 95.0, 18.0
|
170.0, 140.0, 95.0, 18.0
|
||||||
)
|
)
|
||||||
_apply_water_environment(daylight, warmth, weather_fog_amount)
|
_apply_water_environment(
|
||||||
|
daylight,
|
||||||
|
warmth,
|
||||||
|
rain_fog_amount,
|
||||||
|
foggy_fog_amount,
|
||||||
|
_fog_render_color(fog_color, fog_light_energy),
|
||||||
|
)
|
||||||
_environment.adjustment_brightness = (
|
_environment.adjustment_brightness = (
|
||||||
lerpf(0.93, 0.98, daylight)
|
lerpf(0.93, 0.98, daylight)
|
||||||
* _weather_value(1.0, 0.97, 0.92, 1.0)
|
* _weather_value(1.0, 0.97, 0.92, 1.0)
|
||||||
|
|
@ -371,7 +379,9 @@ func _apply_time(time_hours: float) -> void:
|
||||||
func _apply_water_environment(
|
func _apply_water_environment(
|
||||||
daylight: float,
|
daylight: float,
|
||||||
warmth: float,
|
warmth: float,
|
||||||
weather_fog_amount: float,
|
rain_fog_amount: float,
|
||||||
|
foggy_fog_amount: float,
|
||||||
|
fog_render_color: Color,
|
||||||
) -> void:
|
) -> void:
|
||||||
var water_tint := _blended_color(
|
var water_tint := _blended_color(
|
||||||
NIGHT_WATER_TINT,
|
NIGHT_WATER_TINT,
|
||||||
|
|
@ -389,6 +399,19 @@ func _apply_water_environment(
|
||||||
daylight * _weather_value(0.0, 0.0, 0.0, 1.0),
|
daylight * _weather_value(0.0, 0.0, 0.0, 1.0),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
var weather_fog_amount: float = minf(
|
||||||
|
rain_fog_amount + foggy_fog_amount,
|
||||||
|
1.0,
|
||||||
|
)
|
||||||
|
var foggy_color_weight: float = (
|
||||||
|
foggy_fog_amount / weather_fog_amount
|
||||||
|
if weather_fog_amount > 0.001
|
||||||
|
else 0.0
|
||||||
|
)
|
||||||
|
var water_fog_color := RAIN_WATER_FOG_COLOR.lerp(
|
||||||
|
fog_render_color,
|
||||||
|
foggy_color_weight,
|
||||||
|
)
|
||||||
for material: ShaderMaterial in [
|
for material: ShaderMaterial in [
|
||||||
SALT_WATER_MATERIAL,
|
SALT_WATER_MATERIAL,
|
||||||
FRESH_WATER_MATERIAL,
|
FRESH_WATER_MATERIAL,
|
||||||
|
|
@ -398,7 +421,7 @@ func _apply_water_environment(
|
||||||
"environment_brightness",
|
"environment_brightness",
|
||||||
water_brightness,
|
water_brightness,
|
||||||
)
|
)
|
||||||
material.set_shader_parameter("weather_fog_color", WATER_FOG_COLOR)
|
material.set_shader_parameter("weather_fog_color", water_fog_color)
|
||||||
material.set_shader_parameter(
|
material.set_shader_parameter(
|
||||||
"weather_fog_amount",
|
"weather_fog_amount",
|
||||||
weather_fog_amount,
|
weather_fog_amount,
|
||||||
|
|
@ -417,6 +440,15 @@ func _apply_water_environment(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
func _fog_render_color(fog_color: Color, fog_light_energy: float) -> Color:
|
||||||
|
return Color(
|
||||||
|
fog_color.r * fog_light_energy,
|
||||||
|
fog_color.g * fog_light_energy,
|
||||||
|
fog_color.b * fog_light_energy,
|
||||||
|
1.0,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
func _apply_sky_clouds(daylight: float, warmth: float) -> void:
|
func _apply_sky_clouds(daylight: float, warmth: float) -> void:
|
||||||
var cloud_light := _blended_color(
|
var cloud_light := _blended_color(
|
||||||
NIGHT_CLOUD_LIGHT,
|
NIGHT_CLOUD_LIGHT,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue