Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
822e007
feat(render): Enhanced dynamic lights light the ground per pixel
nitoygo Oct 20, 2026
1736103
feat(render): see-through character shadows on the Enhanced lit ground
nitoygo Oct 20, 2026
e78044d
feat(render): Enhanced character shadows fall away from the map's sun
nitoygo Oct 20, 2026
d0b2192
feat(render): HDR Enhanced scene with a tone-mapped composite
nitoygo Oct 20, 2026
d0050f3
feat(render): nearby point lights cast characters' shadows on the Enh…
nitoygo Oct 20, 2026
9861ff8
feat(render): screen-space ambient occlusion in the Enhanced composite
nitoygo Oct 20, 2026
2548cb3
tune(render): calmer skill lights and metal shine in the shipped Enha…
nitoygo Oct 20, 2026
358b342
fix(render): Metal shaders take their uniform buffers in the declared…
nitoygo Oct 20, 2026
a816b5b
feat(render): the sun casts real shadows
nitoygo Nov 3, 2026
e221d8d
feat(render): the terrain's slope shading and the models' light turn …
nitoygo Nov 3, 2026
53e205b
feat(render): indoor and underground maps get no sun
nitoygo Oct 22, 2026
99cc4ac
refactor(render): the frame's sun is taken once per frame, lit shader…
nitoygo Nov 3, 2026
b1be5d0
feat(render): cloud shadows, sky-blue shade and a rim light that foll…
nitoygo Nov 3, 2026
a3ef5af
feat(render): ambient occlusion with anti-aliasing on
nitoygo Nov 3, 2026
4432382
feat(render): the sunlight look ships on: cloud shadows, sky-blue sha…
nitoygo Nov 3, 2026
53f96b0
fix(render): models, flat shadows and clouds agree with the frame's s…
nitoygo Nov 3, 2026
45794f4
fix(render): lighting follows the draw drawn later
nitoygo Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ if(MU_ENABLE_SHADER_COMPILATION)
set(spv "${MU_SHADER_OUTPUT_DIR}/${shader_name}.${stage}.spv")
set(msl "${MU_SHADER_OUTPUT_DIR}/${shader_name}.${stage}.msl")
set(dxil "${MU_SHADER_OUTPUT_DIR}/${shader_name}.${stage}.dxil")
# SDL binds uniform buffer, texture and sampler slot N to MSL index N: keep the declared
# bindings (spirv-cross otherwise numbers them in order of use). Not with storage buffers,
# which share the MSL buffer indices and follow the uniform buffers.
file(READ "${src}" shader_source)
# Storage buffers may be declared in an included .hlsli.
string(REGEX MATCHALL "#include \"[^\"]+\"" shader_includes "${shader_source}")
foreach(shader_include IN LISTS shader_includes)
string(REGEX REPLACE "#include \"([^\"]+)\"" "\\1" shader_include "${shader_include}")
file(READ "${MU_SHADER_SOURCE_DIR}/${shader_include}" include_source)
string(APPEND shader_source "${include_source}")
endforeach()
set(msl_flags)
if(NOT shader_source MATCHES "StructuredBuffer|ByteAddressBuffer")
set(msl_flags --msl-decoration-binding)
endif()

add_custom_command(
OUTPUT "${spv}"
Expand All @@ -110,7 +125,7 @@ if(MU_ENABLE_SHADER_COMPILATION)
)
add_custom_command(
OUTPUT "${msl}"
COMMAND "${SPIRV_CROSS_EXE}" --msl "${spv}" --output "${msl}"
COMMAND "${SPIRV_CROSS_EXE}" --msl ${msl_flags} "${spv}" --output "${msl}"
DEPENDS "${spv}" "${MU_SHADER_COMPILATION_STAMP}" "${SPIRV_CROSS_EXE}"
COMMENT "SPIR-V to MSL: ${shader_name}.${stage}.spv"
VERBATIM
Expand All @@ -126,6 +141,7 @@ if(MU_ENABLE_SHADER_COMPILATION)
set(MU_SHADER_BLOBS "${MU_SHADER_BLOBS}" "${spv}" "${msl}" "${dxil}" PARENT_SCOPE)
endfunction()

file(GLOB MU_SHADER_INCLUDES CONFIGURE_DEPENDS "${MU_SHADER_SOURCE_DIR}/*.hlsli")
set(MU_SHADER_BLOBS)
foreach(shader_stage IN LISTS MU_SHADER_STAGE_NAMES)
string(REGEX REPLACE "\\.[^.]+$" "" shader_name "${shader_stage}")
Expand Down
10 changes: 8 additions & 2 deletions cmake/ValidateDxilReflection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ set(shader_specs
"skinned_weighted.vert|cb0,space1+t0,space0"
"skinned_shadow.vert|cb0,space1+cb1,space1+t0,space0+t1,space0"
"skinned_weighted_shadow.vert|cb0,space1+cb1,space1+t0,space0+t1,space0"
"skinned_lit.frag|cb0,space3+cb1,space3+cb2,space3+s0,space2+s1,space2+t0,space2+t1,space2"
"skinned_lit.frag|cb0,space3+cb1,space3+cb2,space3+s0,space2+s1,space2+s2,space2+t0,space2+t1,space2+t2,space2"
"world_lit.vert|cb0,space1"
"world_lit.frag|cb0,space3+cb1,space3+cb2,space3+s0,space2+s1,space2+s2,space2+s3,space2+t0,space2+t1,space2+t2,space2+t3,space2"
"shadow_mask.frag|-"
"post_fullscreen.vert|-"
"post_bloom_down.frag|cb0,space3+s0,space2+t0,space2"
"post_bloom_up.frag|cb0,space3+s0,space2+t0,space2"
"post_composite.frag|cb0,space3+s0,space2+s1,space2+s2,space2+t0,space2+t1,space2+t2,space2"
"post_composite.frag|cb0,space3+s0,space2+s1,space2+s2,space2+s3,space2+s4,space2+t0,space2+t1,space2+t2,space2+t3,space2+t4,space2"
"post_ao.frag|cb0,space3+s0,space2+t0,space2"
"post_ao_blur.frag|cb0,space3+s0,space2+s1,space2+t0,space2+t1,space2"
"sun_depth.frag|cb0,space3+s0,space2+t0,space2"
)

foreach(shader_spec IN LISTS shader_specs)
Expand Down
6 changes: 6 additions & 0 deletions cmake/ValidateShaderBlobs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ set(MU_SHADER_STAGE_NAMES
skinned_shadow.vert
skinned_weighted_shadow.vert
skinned_lit.frag
world_lit.vert
world_lit.frag
shadow_mask.frag
shadow_volume.vert
post_fullscreen.vert
post_bloom_down.frag
post_bloom_up.frag
post_composite.frag
post_ao.frag
post_ao_blur.frag
sun_depth.frag
)
set(MU_SHADER_BLOB_FORMATS spv msl dxil)
set(MU_SHADER_BLOB_NAMES)
Expand Down
42 changes: 39 additions & 3 deletions cmake/ValidateShaderReflection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,24 @@ function(mu_expect_msl_binding_order shader_name json member resource_kind msl)
endforeach()
endfunction()

# Likewise for uniform buffers: SDL pushes uniform slot N into MSL buffer N, so each block must sit
# at its binding (uniform buffers come first, before any storage buffer).
function(mu_expect_msl_uniform_order shader_name json msl)
mu_json_array_length(uniform_count "${json}" ubos)
if(uniform_count LESS 2)
return()
endif()
math(EXPR last_uniform "${uniform_count} - 1")
foreach(uniform_index RANGE 0 ${last_uniform})
string(JSON uniform_name GET "${json}" ubos ${uniform_index} name)
string(JSON uniform_binding GET "${json}" ubos ${uniform_index} binding)
if(NOT msl MATCHES "constant[ \t]+${uniform_name}&[ \t]+[A-Za-z0-9_]+[ \t]+\\[\\[buffer\\(${uniform_binding}\\)\\]\\]")
mu_add_shader_validation_error(
"${shader_name}: MSL uniform buffer ${uniform_name} is not at index ${uniform_binding}")
endif()
endforeach()
endfunction()

function(mu_expect_msl_layout shader_name stage msl input_locations sampler_count storage_count uniform_count)
# A vertex shader without vertex inputs (generated geometry) has no [[stage_in]].
if(stage STREQUAL "vert" AND NOT input_locations STREQUAL "" AND NOT msl MATCHES "\\[\\[stage_in\\]\\]")
Expand Down Expand Up @@ -270,11 +288,17 @@ set(shader_specs
"skinned_weighted.vert|vert|0,1,2,3,4,5,6,7,8|0|1|1"
"skinned_shadow.vert|vert|0,3,4|0|2|2"
"skinned_weighted_shadow.vert|vert|0,3,4,6,7|0|2|2"
"skinned_lit.frag|frag||2|0|3"
"skinned_lit.frag|frag||3|0|3"
"world_lit.vert|vert|0,1,2|0|0|1"
"world_lit.frag|frag||4|0|3"
"shadow_mask.frag|frag||0|0|0"
"post_fullscreen.vert|vert||0|0|0"
"post_bloom_down.frag|frag||1|0|1"
"post_bloom_up.frag|frag||1|0|1"
"post_composite.frag|frag||3|0|1"
"post_composite.frag|frag||5|0|1"
"post_ao.frag|frag||1|0|1"
"post_ao_blur.frag|frag||2|0|1"
"sun_depth.frag|frag||1|0|1"
)

foreach(shader_spec IN LISTS shader_specs)
Expand All @@ -295,6 +319,17 @@ foreach(shader_spec IN LISTS shader_specs)
set(json_path "${MU_SHADER_REFLECTION_OUTPUT_DIR}/${shader_name}.json")
set(msl_path "${MU_SHADER_REFLECTION_OUTPUT_DIR}/${shader_name}.msl")
file(READ "${source_path}" hlsl)
# As mu_add_shader: declared bindings, except beside storage buffers (also those of an included .hlsli).
string(REGEX MATCHALL "#include \"[^\"]+\"" shader_includes "${hlsl}")
foreach(shader_include IN LISTS shader_includes)
string(REGEX REPLACE "#include \"([^\"]+)\"" "\\1" shader_include "${shader_include}")
file(READ "${MU_SHADER_SOURCE_DIR}/${shader_include}" include_source)
string(APPEND hlsl "${include_source}")
endforeach()
set(msl_flags)
if(NOT hlsl MATCHES "StructuredBuffer|ByteAddressBuffer")
set(msl_flags --msl-decoration-binding)
endif()

execute_process(
COMMAND "${GLSLANG_EXE}" -V -D -S "${stage}" -e main -o "${spv_path}" "${source_path}"
Expand Down Expand Up @@ -322,7 +357,7 @@ foreach(shader_spec IN LISTS shader_specs)
file(WRITE "${json_path}" "${reflection_json}")

execute_process(
COMMAND "${SPIRV_CROSS_EXE}" "${spv_path}" --msl --output "${msl_path}"
COMMAND "${SPIRV_CROSS_EXE}" "${spv_path}" --msl ${msl_flags} --output "${msl_path}"
RESULT_VARIABLE msl_result
ERROR_VARIABLE msl_error
)
Expand Down Expand Up @@ -356,6 +391,7 @@ foreach(shader_spec IN LISTS shader_specs)
mu_expect_msl_layout("${shader_name}" "${stage}" "${msl}" "${input_locations}" "${sampler_count}" "${storage_count}" "${uniform_count}")
mu_expect_msl_binding_order("${shader_name}" "${reflection_json}" separate_images texture "${msl}")
mu_expect_msl_binding_order("${shader_name}" "${reflection_json}" separate_samplers sampler "${msl}")
mu_expect_msl_uniform_order("${shader_name}" "${reflection_json}" "${msl}")
endforeach()

get_property(validation_errors GLOBAL PROPERTY MU_SHADER_VALIDATION_ERRORS)
Expand Down
2 changes: 1 addition & 1 deletion docs/build/rendering-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ change performance behavior by OS.
|----|----------------|--------------------|
| macOS | Metal | Identical |
| Linux | Vulkan | Identical |
| Windows | D3D12 | Identical |
| Windows | Vulkan (D3D12 via `[Render] Backend`) | Identical |

Native drivers, GPUs, and font rasterizers can still expose platform-specific
driver defects. Runtime parity therefore requires measurements on each target;
Expand Down
57 changes: 57 additions & 0 deletions docs/enhanced-look-map-environments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Enhanced look: map environments

Which environment each map has in `Data/Render/Look.json` and why. The environments themselves (what they set) are in [enhanced-look.md](enhanced-look.md#environments). Classic uses none of this.

**Physical** describes the scene: outdoor, indoor, underground, underwater, aerial or mixed. **Policy** is the lighting it calls for:

- **day-night:** open air, meant for a day-night cycle (not built yet: these maps keep their fixed sun).
- **hybrid:** mostly open, but dark, dense or special.
- **fixed:** authored lighting, never a day-night cycle.
- **custom:** its own kind of light (sky, underwater).

The classification is a rendering proposal, not Webzen's own. A map is lit as one region: a mixed map can't light its interior and its open ground differently.

| World | Map | Physical | Theme | Policy | Environment |
|---:|---|---|---|---|---|
| 0 | Lorencia | outdoor | grassland, town | day-night | `outdoor` |
| 1 | Dungeon | underground | dungeon, catacombs | fixed | `enclosed` |
| 2 | Devias | outdoor | snow, tundra | day-night | `outdoor` |
| 3 | Noria | outdoor | forest | day-night | `outdoor` |
| 4 | Lost Tower | indoor | dark tower | fixed | `enclosed` |
| 6 | Arena | mixed | gladiatorial arena | fixed | `fixed` |
| 7 | Atlans | underwater | submerged ruins | custom | `underwater` |
| 8 | Tarkan | outdoor | desert | day-night | `outdoor` |
| 9, 32 | Devil Square | indoor | demonic arena | fixed | `enclosed` |
| 10 | Icarus | aerial | sky, floating ruins | custom | `sky` |
| 11–17, 52 | Blood Castle 1–8 | aerial, mixed | floating fortress | fixed | `fixed` |
| 18–23, 53 | Chaos Castle 1–7 | indoor | enclosed battleground | fixed | `enclosed` |
| 24–29, 36 | Kalima 1–6, Lost Kalima | mixed | dark realm | fixed | `fixed` |
| 30 | Valley of Loren | outdoor | castle battlefield | day-night | `outdoor` |
| 31 | Land of Trials | outdoor | rocky wilderness | day-night | `outdoor` |
| 33 | Aida | outdoor | dark forest | hybrid | `outdoorDense` |
| 34, 35 | Crywolf | outdoor | mountain fortress | day-night | `outdoor` |
| 37 | Kanturu Ruins | outdoor, mixed | ancient ruins | hybrid | `outdoorDense` |
| 38 | Kanturu Relics | indoor | mechanical ruins | fixed | `enclosed` |
| 39 | Refinery Tower | indoor | boss chamber | fixed | `enclosed` |
| 41 | Barracks of Balgass | outdoor, mixed | military canyon | fixed | `fixed` |
| 42 | Balgass Refuge | indoor | boss refuge | fixed | `enclosed` |
| 45–50 | Illusion Temple 1–6 | indoor | ritual arena | fixed | `enclosed` |
| 51 | Elbeland | outdoor | enchanted forest | day-night | `outdoor` |
| 56 | Swamp of Calmness | outdoor | swamp | hybrid | `outdoorDense` |
| 57 | Raklion | outdoor | glacier | hybrid | `outdoorDense` |
| 58 | Raklion boss cave | underground | ice cavern | fixed | `enclosed` |
| 62 | Santa Village | outdoor | snowy village | fixed | `fixed` |
| 63 | Vulcanus | outdoor | volcanic | hybrid | `outdoorDense` |
| 64 | Duel Arena | arena | combat area | fixed | `fixed` |
| 65–68 | Doppelganger 1–4 | indoor, mixed | dungeon corridors | fixed | `enclosed` |
| 69–72 | Imperial Guardian 1–4 | indoor, mixed | fortress corridors | fixed | `enclosed` |
| 79 | Loren Market | outdoor | trade town | day-night | `outdoor` |
| 80, 81 | Karutan 1–2 | outdoor | rocky desert | day-night | `outdoor` |

Not listed, so they get only the default values:

- world 5;
- the GM area (40);
- the login and character scenes (54, 55, 73, 74, 77, 78).

The later-season maps (Acheron, Debenter, Deep Dungeon, and so on) aren't in this client.
Loading