tommybazar / TBRaymarchProject

Allows volumetric rendering of 3D data with Unreal Engine.
MIT License
158 stars 40 forks source link

Crash when changing Blend Mode from "AlphaComposite(Premultiplied Alpha) " to "Masked". #8

Closed ShiinaMitsuki closed 1 year ago

ShiinaMitsuki commented 1 year ago

Hello, thanks for the great work! I'm trying to rendering my volume asset through this plugin, and there's a need for casting shadows. But UE crashed when I changed Blend Mode from "AlphaComposite(Premultiplied Alpha) " to "Masked" in the "M_Raymarch" material. Below is the crash log and the UE version is 5.1.1

[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: ================================================
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: === FShaderJobCache stats ===
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: Total job queries 153, among them cache hits 28 (18.30%)
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: Tracking 125 distinct input hashes that result in 84 distinct outputs (67.20%)
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: RAM used: 0.26 MB (0.00 GB) of 1638.40 MB (1.60 GB) budget. Usage: 0.02%
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: === Shader Compilation stats ===
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: Shaders Compiled: 27
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: Jobs assigned 27, completed 27 (100.00%)
[2023.07.14-06.46.13:646][678]LogShaderCompilers: Display: Average time worker was idle: 3.15 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Time job spent in pending queue: average 0.60 s, longest 2.34 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Job execution time: average 0.98 s, max 1.54 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Job life time (pending + execution): average 1.57 s, max 3.25
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Time at least one job was in flight (either pending or executed): 8.24 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Jobs were issued in 27 batches (only local compilation was used), average 1.00 jobs/batch
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Average processing rate: 3.28 jobs/sec
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Total thread time: 18.55 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Total thread preprocess time: 1.46 s
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Percentage time preprocessing: 7.85%
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Effective parallelization: 2.25 (times faster than compiling all shaders on one thread). Compare with number of workers: 4
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display: Top 5 most expensive shader types by average time:
[2023.07.14-06.46.13:647][678]LogShaderCompilers: Display:                                 TBasePassPSFNoLightMapPolicy (compiled    8 times, average 0.93 sec, max 1.04 sec, min 0.81 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                 TBasePassVSFNoLightMapPolicy (compiled    8 times, average 0.87 sec, max 0.95 sec, min 0.76 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                  TShadowDepthVSVertexShadowDepth_OutputDepth (compiled    1 times, average 0.67 sec, max 0.67 sec, min 0.67 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                                 FLumenCardVS (compiled    3 times, average 0.63 sec, max 0.66 sec, min 0.62 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:         TShadowDepthPSPixelShadowDepth_NonPerspectiveCorrect (compiled    1 times, average 0.41 sec, max 0.41 sec, min 0.41 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display: Top 5 shader types by total compile time:
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                 TBasePassPSFNoLightMapPolicy - 40.19% of total time (compiled    8 times, average 0.93 sec, max 1.04 sec, min 0.81 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                 TBasePassVSFNoLightMapPolicy - 37.55% of total time (compiled    8 times, average 0.87 sec, max 0.95 sec, min 0.76 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                                 FLumenCardVS - 10.25% of total time (compiled    3 times, average 0.63 sec, max 0.66 sec, min 0.62 sec)
[2023.07.14-06.46.13:648][678]LogShaderCompilers: Display:                                          FLumenCardPS<false> - 6.17% of total time (compiled    3 times, average 0.38 sec, max 0.39 sec, min 0.37 sec)
[2023.07.14-06.46.13:649][678]LogShaderCompilers: Display:                  TShadowDepthVSVertexShadowDepth_OutputDepth - 3.63% of total time (compiled    1 times, average 0.67 sec, max 0.67 sec, min 0.67 sec)
[2023.07.14-06.46.13:649][678]LogShaderCompilers: Display: ================================================
[2023.07.14-06.46.16:774][ 25]MaterialEditorStats: Texture samplers: 0/16
[2023.07.14-06.46.16:774][ 25]MaterialEditorStats: Texture Lookups (Est.): VS(0), PS(3)
[2023.07.14-06.46.16:774][ 25]MaterialEditorStats: Shader Count: 0
[2023.07.14-06.46.16:822][ 27]MaterialEditorStats: Base pass shader without light map: 263 instructions
[2023.07.14-06.46.16:823][ 27]MaterialEditorStats: Base pass vertex shader: 250 instructions
[2023.07.14-06.46.16:823][ 27]MaterialEditorStats: Texture samplers: 4/16
[2023.07.14-06.46.16:823][ 27]MaterialEditorStats: Texture Lookups (Est.): VS(0), PS(3)
[2023.07.14-06.46.16:823][ 27]MaterialEditorStats: Shader Count: 3
Assertion failed: false [File:D:\build\++UE5\Sync\Engine\Source\Runtime\RHICore\Private\RHICoreShader.cpp] [Line: 59] 
Shader attempted to bind uniform buffer 'FOpaqueBasePassUniformParameters' at slot [Name: SceneTextures, Slot: 7] with hash '158928480', but the shader expected 'LumenFrontLayerTranslucencyGBufferPass' with hash '153620189'.
UnrealEditor.exe 已触发了一个断点。

Any clue?

ShiinaMitsuki commented 1 year ago

CalcSceneDepth in the PerformRaymarchCubeSetup caused this problem.