AskingQuestions / Shadeup

A language for WebGPU that makes writing shaders easier
https://shadeup.dev
150 stars 4 forks source link

Cannot compile compute shader with material graph on 5.1 on macOS #6

Open TheEnbyWitch opened 1 year ago

TheEnbyWitch commented 1 year ago

Hello! I tried creating a compute shader with material graph and the compiler is complaining about "MeshDrawCommands.h" not existing, even though it's there in "Runtime/Renderer/Private"

[1/3] Compile Module.ShadeupShaders.cpp
In file included from /Users/vivi/Development/[REDACTED]/Plugins/Dev/ShadeupTest/Intermediate/Build/Mac/x86_64/UnrealEditor/Development/ShadeupShaders/Module.ShadeupShaders.cpp:3:
In file included from /Users/vivi/Development/[REDACTED]/Plugins/Dev/ShadeupTest/Intermediate/Build/Mac/x86_64/UnrealEditor/Inc/ShadeupShaders/UHT/MaskShader.gen.cpp:8:
In file included from /Users/vivi/Development/[REDACTED]/Plugins/Dev/ShadeupTest/Source/ShadeupShaders/Public/MaskShader/MaskShader.h:7:
In file included from Runtime/Renderer/Private/ScenePrivate.h:33:
In file included from Runtime/Renderer/Private/LightSceneInfo.h:15:
In file included from Runtime/Renderer/Private/SceneRendering.h:29:
In file included from Runtime/Renderer/Private/SkyAtmosphereRendering.h:15:
0>/Users/Shared/Epic Games/UE_5.1/Engine/Source/Runtime/Renderer/Private/VirtualShadowMaps/VirtualShadowMapArray.h:7:10: Error  : 'MeshDrawCommands.h' file not found
#include "MeshDrawCommands.h"
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
TheEnbyWitch commented 1 year ago

UPDATE: Adding

        PublicIncludePaths.AddRange(new string[] 
        {
            "Runtime/Renderer/Private"
        });

to my .Build.cs seems to have worked, which is probably not the best solution but at least it compiled.

AskingQuestions commented 1 year ago

Thanks for the report and follow-up solution!

That include path you added should already be in both the CLI tool and the online example ZIPs.

I'm curious, did you use the shadeup CLI command or example ZIP from the website to create this shader? If you used the CLI, did you create a new module using it or use an existing one?

TheEnbyWitch commented 1 year ago

Hey @AskingQuestions, I used the CLI and created a new module.