Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows, can't load shaders! #23

Open
z657446063 opened this issue Apr 15, 2021 · 4 comments
Open

Windows, can't load shaders! #23

z657446063 opened this issue Apr 15, 2021 · 4 comments

Comments

@z657446063
Copy link

z657446063 commented Apr 15, 2021

image

image

image

Hi,@lettier , after builing the project ,i ran the demo, i could hear the water and wheel sounds, but i could't load the shaders as above images show , don't know why... i just try both absolute and relative Paths ,still could’t load...

Do you or anybody ever meet similar problems ,or successfuly ran the demo on Windows ? I used the latest Panda SDK building the Demo.

Really good demos,but there are indeed some issues when building it on Windows 。。。

@rdb
Copy link

rdb commented Apr 15, 2021

If you use absolute paths, you should use UNIX-style paths (which is what Panda3D expects), in the form of /c/Users/Administrator/...

@z657446063
Copy link
Author

__

If you use absolute paths, you should use UNIX-style paths (which is what Panda3D expects), in the form of /c/Users/Administrator/...

image

Thank you for reply,it works as you said! and there must be some problems with the relative paths when loading shaders on windows ...

@t-nagai-k-sd
Copy link

I have same problem.
I delete #include <unistd.h> in main.cxx of 3d-game-shaders-for-beginners\demonstration\src
From windows11 compile main.cxx to main.exe, but Errors displayed.
Where should I use UNIX-style paths?
I copy error messages as following.
thank you.

C:\3d-game-shaders-for-beginners\demonstration>main.exe
:express(warning): Filename is incorrect case: /c/Panda3D-1.10.11-x64/etc/config.prc instead of /c/Panda3D-1.10.11-x64/etc/Config.prc
:util(error): Unable to open config.prc
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
:loader(error): Couldn't load file eggs/mill-scene/mill-scene.egg: not found on model path (currently: "/c/3d-game-shaders-for-beginners/demonstration;/c/Panda3D-1.10.11-x64/etc/..;/c/Panda3D-1.10.11-x64/etc/../models")
Texture Object .txo
DirectDraw Surface .dds
Khronos Texture .ktx
SGI RGB .rgb, .rgba, .sgi
Targa .tga
Raw binary RGB .img
SoftImage .pic, .soft
Windows BMP .bmp
NetPBM-style PBM/PGM/PPM/PNM .pbm, .pgm, .ppm, .pnm
Portable Float Map .pfm
JPEG .jpg, .jpeg
PNG .png
TIFF .tiff, .tif
OpenEXR .exr
stb_image .psd, .hdr, .gif
MovieTexture .asf
MovieTexture .avi
MovieTexture .flv
MovieTexture .m2v
MovieTexture .mkv
MovieTexture .mov
MovieTexture .mp4
MovieTexture .mpeg
MovieTexture .mpg
MovieTexture .nut
MovieTexture .ogm
MovieTexture .ogv
MovieTexture .webm
MovieTexture .wmv
Unable to load eggs/mill-scene/mill-scene
Assertion failed: !is_empty() at line 398 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 317 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 4515 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 317 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 2323 of panda/src/pgraph/nodePath.cxx
:shader(error): Could not find shader file: shaders/fragment/ssao-blur.frag
:shader(error): Could not find shader file: shaders/fragment/combine.frag
:shader(error): Could not find shader file: shaders/fragment/combine-blur.frag
Assertion failed: !is_empty() at line 1509 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1111 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1070 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1509 of panda/src/pgraph/nodePath.cxx
Assertion failed: Shader input gamma is not present.
at line 397 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\shaderAttrib.cxx
Assertion failed: Shader input gamma is not present.
at line 397 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\shaderAttrib.cxx
Assertion failed: Shader input mouseFocusPoint is not present.
at line 397 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\shaderAttrib.cxx
Assertion failed: Shader input parameters is not present.
at line 397 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\shaderAttrib.cxx
Assertion failed: !is_empty() at line 1111 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1070 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1509 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1111 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1070 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1509 of panda/src/pgraph/nodePath.cxx
Assertion failed: !is_empty() at line 1111 of panda/src/pgraph/nodePath.cxx

@NPatch
Copy link

NPatch commented Apr 22, 2023

Obviously you can move images, shaders, fonts, etc to the x64/Release directory and it'll all work without changing the CWD, but I'm also pigheaded in that it should work properly if you set CWD to point to demonstration folder.
Everything else loads apart from the shaders. I tried setting the relative path thinking it was trying to find them in x64/Release beside the .exe and it worked.

For some reason Panda's Shader::loadShader assumes the shaders are located next to the executable, despite the rest of the resource loaders not having the same assumptions for the rest of the resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants