armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.05k stars 317 forks source link

Build fails: kha.Shaders has no field line_vert/line_deferred_frag if arm_debug_console is on #1410

Closed MoritzBrueckner closed 1 year ago

MoritzBrueckner commented 4 years ago

The build fails if I activate the debug console. Open any file (it seems not file related), activate the arm_debug_console flag and hit F5.

Console output:

Armory v2019.9 ($Id: 2c6dcd0b50371c010c1287c332b6c1b791aeb1c1 $)
OS: win, Target: krom, GAPI: direct3d11, Blender: 2.80 (sub 75)
CMFT info: Converting latlong image to cubemap.
CMFT info: Saving spherical harmonics coefficients to A:\Workspace\Documents\Projekte\Blender\Spiele\Balance\/build_balance/compiled/Assets/envmaps/rooitou_park_2k_irradiance.c
CMFT info: Done.
CMFT info: Converting latlong image to cubemap.
CMFT info: Resizing source image from 256x256 to 128x128.
CMFT info: Running radiance filter for:
        [srcFaceSize=128]
        [lightingModel=blinnbrdf]
        [excludeBase=false]
        [mipCount=8]
        [glossScale=8]
        [glossBias=3]
        [dstFaceSize=128]
CMFT info: Radiance -> Starting filter...
CMFT info: Radiance -> Utilizing 4 CPU processing threads and GeForce GTX 750 Ti.
CMFT info: Radiance -> ------------------------------------
CMFT info: Radiance ->  Device / Face /     Time /    Total
CMFT info: Radiance -> ------------------------------------
CMFT info: Radiance -> [CPU0]  |    1 |   0.001s |   0.002s
CMFT info: Radiance -> [CPU2]  |    1 |   0.001s |   0.003s
CMFT info: Radiance -> [CPU1]  |    1 |   0.002s |   0.003s
CMFT info: Radiance -> [CPU2]  |    1 |   0.001s |   0.004s
CMFT info: Radiance -> [CPU0]  |    1 |   0.002s |   0.005s
CMFT info: Radiance -> [CPU3]  |    1 |   0.002s |   0.006s
CMFT info: Radiance -> [CPU2]  |    2 |   0.003s |   0.007s
CMFT info: Radiance -> [CPU3]  |    2 |   0.003s |   0.009s
CMFT info: Radiance -> [CPU0]  |    2 |   0.004s |   0.010s
CMFT info: Radiance -> [CPU2]  |    2 |   0.003s |   0.011s
CMFT info: Radiance -> [CPU1]  |    2 |   0.007s |   0.011s
CMFT info: Radiance -> [CPU3]  |    2 |   0.003s |   0.012s
CMFT info: Radiance -> [CPU2]  |    4 |   0.009s |   0.020s
CMFT info: Radiance -> [CPU3]  |    4 |   0.009s |   0.021s
CMFT info: Radiance -> [CPU0]  |    4 |   0.011s |   0.022s
CMFT info: Radiance -> [CPU1]  |    4 |   0.012s |   0.023s
CMFT info: Radiance -> [CPU2]  |    4 |   0.009s |   0.029s
CMFT info: Radiance -> [CPU3]  |    4 |   0.009s |   0.030s
CMFT info: Radiance -> [CPU2]  |    8 |   0.026s |   0.055s
CMFT info: Radiance -> [CPU0]  |    8 |   0.031s |   0.058s
CMFT info: Radiance -> [CPU3]  |    8 |   0.029s |   0.059s
CMFT info: Radiance -> [CPU1]  |    8 |   0.041s |   0.067s
CMFT info: Radiance -> [CPU0]  |    8 |   0.022s |   0.086s
CMFT info: Radiance -> [CPU2]  |    8 |   0.028s |   0.087s
CMFT info: Radiance ->  <GPU>  |  128 |   0.098s |   0.109s
CMFT info: Radiance -> [CPU3]  |   16 |   0.066s |   0.130s
CMFT info: Radiance ->  <GPU>  |  128 |   0.013s |   0.146s
CMFT info: Radiance -> [CPU2]  |   16 |   0.057s |   0.151s
CMFT info: Radiance -> [CPU0]  |   16 |   0.066s |   0.159s
CMFT info: Radiance ->  <GPU>  |  128 |   0.008s |   0.161s
CMFT info: Radiance -> [CPU1]  |   16 |   0.086s |   0.169s
CMFT info: Radiance ->  <GPU>  |  128 |   0.030s |   0.201s
CMFT info: Radiance -> [CPU3]  |   16 |   0.064s |   0.214s
CMFT info: Radiance ->  <GPU>  |  128 |   0.017s |   0.224s
CMFT info: Radiance -> [CPU2]  |   16 |   0.084s |   0.239s
CMFT info: Radiance ->  <GPU>  |  128 |   0.018s |   0.257s
CMFT info: Radiance ->  <GPU>  |   64 |   0.036s |   0.306s
CMFT info: Radiance -> [CPU1]  |   32 |   0.146s |   0.320s
CMFT info: Radiance -> [CPU0]  |   32 |   0.167s |   0.336s
CMFT info: Radiance ->  <GPU>  |   64 |   0.017s |   0.352s
CMFT info: Radiance -> [CPU3]  |   32 |   0.169s |   0.394s
CMFT info: Radiance ->  <GPU>  |   64 |   0.026s |   0.394s
CMFT info: Radiance -> [CPU2]  |   32 |   0.175s |   0.415s
CMFT info: Radiance ->  <GPU>  |   64 |   0.018s |   0.432s
CMFT info: Radiance -> [CPU0]  |   32 |   0.144s |   0.485s
CMFT info: Radiance -> [CPU1]  |   32 |   0.148s |   0.490s
CMFT info: Radiance -> [CPU3]  |   64 |   0.233s |   0.633s
CMFT info: Radiance -> [CPU2]  |   64 |   0.224s |   0.639s
CMFT info: Radiance -> ------------------------------------
CMFT info: Radiance -> Total faces processed on [CPU]: 38
CMFT info: Radiance -> Total faces processed on <GPU>: 10
CMFT info: Radiance -> Total time: 0.640 seconds.
CMFT info: Saving A:\Workspace\Documents\Projekte\Blender\Spiele\Balance\/build_balance/compiled/Assets/envmaps/rooitou_park_2k_radiance.hdr [HDR 512x256 RGBE LatLong 1-faces 8-mips].
CMFT info: Done.
#2x1
#1x1
Exporting MainMenu
Exporting mesh Icosphere.003_Rocks.blend
Exporting mesh Icosphere.004_Rocks.blend
Scene exported in 0.01199197769165039
Exporting Scene
Exporting mesh Circle.002
Exporting mesh Circle.003
Exporting mesh Sphere
Exporting mesh Plane.001
Exporting mesh Cube
Exporting mesh Cylinder.001
Scene exported in 0.8384833335876465
Exported modules: ['audio', 'physics', 'ui']
Shader flags: ['_Irr', '_EnvTex', '_Rad', '_EnvStr', '_Deferred', '_ShadowMap', '_CSM', '_Sun', '_Brdf', '_SMAA', '_SSAO']
Khafile flags: ['arm_deferred', 'arm_csm', 'rp_hdr', 'rp_renderer=Deferred', 'rp_shadowmap', 'rp_shadowmap_cascade=1024', 'rp_shadowmap_cube=512', 'rp_background=World', 'rp_render_to_texture', 'rp_compositornodes', 'rp_antialiasing=SMAA', 'rp_supersampling=1', 'rp_ssgi=SSAO', 'rp_bloom', 'rp_water']
Running:  ['A:\\Workspace\\Documents\\Projekte\\Forks\\ArmorySDKDEV//nodejs/node.exe', 'A:\\Workspace\\Documents\\Projekte\\Forks\\ArmorySDKDEV//Kha/make', 'krom', '-g', 'direct3d11', '--shaderversion', '330', '--parallelAssetConversion', '4', '--to', 'build_balance/debug']
Using project from A:\Workspace\Documents\Projekte\Blender\Spiele\Balance\
Using Kha from A:\Workspace\Documents\Projekte\Forks\ArmorySDKDEV\Kha
Creating Kha project.
Exporting asset 1 of 1 (ammo.js).
Exporting asset 1 of 22 (MainMenu.arm).
Exporting asset 2 of 22 (Scene.arm).
Exporting asset 3 of 22 (rooitou_park_2k_irradiance.arm).
Exporting asset 4 of 22 (rooitou_park_2k_radiance.hdr).
Exporting asset 5 of 22 (rooitou_park_2k_radiance_1.hdr).
Exporting asset 6 of 22 (rooitou_park_2k_radiance_2.hdr).
Exporting asset 7 of 22 (rooitou_park_2k_radiance_0.hdr).
Exporting asset 8 of 22 (rooitou_park_2k_radiance_3.hdr).
Exporting asset 9 of 22 (rooitou_park_2k_radiance_4.hdr).
Exporting asset 10 of 22 (rooitou_park_2k_radiance_5.hdr).
Exporting asset 11 of 22 (rooitou_park_2k_radiance_6.hdr).
Exporting asset 12 of 22 (rooitou_park_2k_radiance_7.hdr).
Exporting asset 13 of 22 (rooitou_park_2k_radiance_8.hdr).
Exporting asset 14 of 22 (rooitou_park_2k_radiance_9.hdr).
Exporting asset 15 of 22 (mesh_Circle.002.arm).
Exporting asset 16 of 22 (mesh_Circle.003.arm).
Exporting asset 17 of 22 (mesh_Cube.arm).
Exporting asset 18 of 22 (mesh_Cylinder.001.arm).
Exporting asset 19 of 22 (mesh_Icosphere.003_Rocks.blend.arm).
Exporting asset 20 of 22 (mesh_Icosphere.004_Rocks.blend.arm).
Exporting asset 21 of 22 (mesh_Plane.001.arm).
Exporting asset 22 of 22 (mesh_Sphere.arm).
Exporting asset 1 of 6 (Material_002_data.arm).
Exporting asset 2 of 6 (Material_003_data.arm).
Exporting asset 3 of 6 (Material_data.arm).
Exporting asset 4 of 6 (Metal_data.arm).
Exporting asset 5 of 6 (Rock_Rocks_blend_data.arm).
Exporting asset 6 of 6 (shader_datas.arm).
Exporting asset 1 of 1 (rock_05_diff_2k.jpg).
Exporting asset 1 of 1 (rock_05_rough_2k.jpg).
Exporting asset 1 of 1 (rock_05_spec_2k.jpg).
Exporting asset 1 of 1 (rooitou_park_2k.hdr).
Exporting asset 1 of 1 (Metall6DIFF2K.jpg).
Exporting asset 1 of 1 (Metall7SPEC2K.jpg).
Exporting asset 1 of 1 (castle_brick_broken_06_diff_2k.jpg).
Exporting asset 1 of 1 (castle_brick_broken_06_disp_2k.jpg).
Exporting asset 1 of 1 (castle_brick_broken_06_nor_2k.jpg).
Exporting asset 1 of 1 (castle_brick_broken_06_rough_2k.jpg).
Exporting asset 1 of 1 (rock_06_diff_2k.jpg).
Exporting asset 1 of 1 (rock_06_rough_2k.jpg).
Exporting asset 1 of 1 (rock_06_spec_2k.jpg).
Exporting asset 1 of 1 (brdf.png).
Exporting asset 1 of 1 (smaa_area.png).
Exporting asset 1 of 1 (smaa_search.png).
Exporting asset 1 of 1 (water_base.png).
Exporting asset 1 of 1 (water_detail.png).
Exporting asset 1 of 1 (water_foam.png).
Exporting asset 1 of 1 (MainMenu.json).
Exporting asset 1 of 1 (font_default.ttf).
Compiling shader 1 of 30 (Material_002_mesh.frag.glsl).
Compiling shader 2 of 30 (Material_002_mesh.vert.glsl).
Compiling shader 3 of 30 (Material_003_mesh.frag.glsl).
Compiling shader 4 of 30 (Material_003_mesh.vert.glsl).
Compiling shader 5 of 30 (Material_mesh.frag.glsl).
Compiling shader 6 of 30 (Material_mesh.vert.glsl).
Compiling shader 7 of 30 (Metal_mesh.frag.glsl).
Compiling shader 8 of 30 (Rock_Rocks_blend_mesh.frag.glsl).
Compiling shader 9 of 30 (Rock_Rocks_blend_mesh.vert.glsl).
Compiling shader 10 of 30 (Rock_Rocks_blend_shadowmap.frag.glsl).
Compiling shader 11 of 30 (Rock_Rocks_blend_shadowmap.vert.glsl).
Compiling shader 12 of 30 (bloom_pass.frag.glsl).
Compiling shader 13 of 30 (blur_edge_pass.frag.glsl).
Compiling shader 14 of 30 (blur_gaus_pass.frag.glsl).
Compiling shader 15 of 30 (compositor_pass.frag.glsl).
Compiling shader 16 of 30 (compositor_pass.vert.glsl).
Compiling shader 17 of 30 (deferred_light.frag.glsl).
Compiling shader 18 of 30 (pass.vert.glsl).
Compiling shader 19 of 30 (pass_copy.frag.glsl).
Compiling shader 20 of 30 (pass_viewray.vert.glsl).
Compiling shader 21 of 30 (smaa_blend_weight.frag.glsl).
Compiling shader 22 of 30 (smaa_blend_weight.vert.glsl).
Compiling shader 23 of 30 (smaa_edge_detect.frag.glsl).
Compiling shader 24 of 30 (smaa_edge_detect.vert.glsl).
Compiling shader 25 of 30 (smaa_neighborhood_blend.frag.glsl).
Compiling shader 26 of 30 (smaa_neighborhood_blend.vert.glsl).
Compiling shader 27 of 30 (ssao_pass.frag.glsl).
Compiling shader 28 of 30 (water_pass.frag.glsl).
Compiling shader 29 of 30 (world_pass.frag.glsl).
Compiling shader 30 of 30 (world_pass.vert.glsl).
Compiling shader 1 of 8 (painter-colored.frag.glsl).
Compiling shader 2 of 8 (painter-colored.vert.glsl).
Compiling shader 3 of 8 (painter-image.frag.glsl).
Compiling shader 4 of 8 (painter-image.vert.glsl).
Compiling shader 5 of 8 (painter-text.frag.glsl).
Compiling shader 6 of 8 (painter-text.vert.glsl).
Compiling shader 7 of 8 (painter-video.frag.glsl).
Compiling shader 8 of 8 (painter-video.vert.glsl).
A:\Workspace\Documents\Projekte\Forks\ArmorySDKDEV\armory\Sources/armory/trait/internal/DebugDraw.hx:48: characters 29-59 : Class<kha.Shaders> has no field line_deferred_frag
A:\Workspace\Documents\Projekte\Forks\ArmorySDKDEV\armory\Sources/armory/trait/internal/DebugDraw.hx:52: characters 27-48 : Class<kha.Shaders> has no field line_vert

Haxe compiler error.
Finished in 7.882229804992676
Build failed, check console

System Blender: 2.80.75 f6cb5f54494e Armory: SDK https://github.com/armory3d/armsdk/commit/cb6697d1496077171d35d96c1bc7c3de542ecc6b OS: Win 10 64bit v1903 Graphics card: Geforce GTX 750Ti

luboslenco commented 4 years ago

Hm is this still an issue? I can't seem to reproduce on my Windows 10 machine. :(

MoritzBrueckner commented 4 years ago

Ah no, it works now! Maybe it was just a certain commit in a submodule that caused this issue. Thanks again

MoritzBrueckner commented 4 years ago

I was able to reproduce the issue again -> activate Generate Relative Paths in Armory's settings and the game will not build if the debug console is on.

MoritzBrueckner commented 4 years ago

A thing that got my attention is that relative paths have sometimes a different amount of ../ in khafile.js:

project.addShaders("../../../Forks/ArmorySDKDEV/armory/Shaders/debug_draw/**"); project.addLibrary("../../../../Forks/ArmorySDKDEV/armory");

There are more entries in khafile.js for both cases.

Maybe that's the problem?

MoritzBrueckner commented 4 years ago

A workaround is to replace the line https://github.com/armory3d/armory/blob/01920b99c76eceb690914ad6613854f03c6e8d83/blender/arm/write_data.py#L221

with

f.write(add_shaders(sdk_path + "armory/Shaders/debug_draw/line.frag.glsl", rel_path=rel_path))
f.write(add_shaders(sdk_path + "armory/Shaders/debug_draw/line.vert.glsl", rel_path=rel_path))
f.write(add_shaders(sdk_path + "armory/Shaders/debug_draw/line_deferred.frag.glsl", rel_path=rel_path))

So it seems that the ** in the khafile is causing the issue, although it only occurs when relative paths are used as already mentioned.

j2l commented 4 years ago

I have a similar problem that may be related after I updated to 2019.11: I need to manually clean cache before browser view after I made some changes like adding a material (tested with blender PBR and Armory PBR) to Suzanne AND activate debug console: the object doesn't display in browser runtime and it doesn't display in the debug scene tree too.

It's non-consistent, for some changes it works, for some others (LOD, material) it may work or not.

MoritzBrueckner commented 1 year ago

The problematic khafile entry mentioned above in https://github.com/armory3d/armory/issues/1410#issuecomment-544299517 does no longer exist in that form so this issue is no longer reproducible in Armory.

I tried to reproduce it in pure Kha as well in case it's still a Khamake issue but I also wasn't able to do so.