lettier / 3d-game-shaders-for-beginners

🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
https://lettier.github.io/3d-game-shaders-for-beginners/index.html
17.35k stars 1.35k forks source link

:display:gsg:glgsg(warning): Project runs but shaders do not load correctly #22

Open eoinroe opened 3 years ago

eoinroe commented 3 years ago

After building the project and copying the binary to /Developer/Panda3D/bin as suggested in this post - https://discourse.panda3d.org/t/panda3d-c-not-working-on-os-x-10-11/15456/2, I get the following errors:

:util(error): Unable to make directory /panda3d, caching disabled. Known pipe types: CocoaGraphicsPipe (all display modules loaded.) :display:gsg:glgsg(warning): Shader shaders/fragment/geometry-buffer-0.frag produced the following warnings: WARNING: Could not find vertex shader attribute 'vertex' to match BindAttributeLocation request. WARNING: Output of vertex shader 'vertexInShadowSpaces' not read by fragment shader WARNING: Output of vertex shader 'vertexColor' not read by fragment shader WARNING: Output of vertex shader 'diffuseCoord' not read by fragment shader WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.

:display:gsg:glgsg(warning): Shader shaders/fragment/geometry-buffer-1.frag produced the following warnings: WARNING: Could not find vertex shader attribute 'vertex' to match BindAttributeLocation request. WARNING: Output of vertex shader 'vertexInShadowSpaces' not read by fragment shader WARNING: Output of vertex shader 'vertexColor' not read by fragment shader WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.

These are different warnings from the shader compile errors reported on macOS mojave 10.14.5 and I was wondering how to get round this?

rdb commented 3 years ago

The error message is just telling you that the cache directory could not be created, try setting the full path of model-cache-dir to a desired writable directory in Config.prc. However, it should not affect the output (and neither should the warnings).

eoinroe commented 3 years ago

Unfortunately, it does affect the output. The project loads but I can only see a dark outline of the scene I assume because the shaders are not working.

DevinFrenze commented 3 years ago

I'm seeing the same warnings when I try to run (on macOs Catalina) and also seeing dark shapes in the render window, and to be fair I don't know if they're related.

Wondering if either of you have any other thoughts or found any workarounds. Changing the path of model-cache-dir in the Config.prc didn't seem to make a difference for me. Also, the default model-cache-dir setting works fine for my python Panda3D programs.

^^ update: I didn't notice that there was a local .prc file at /demonstration/panda3d-prc-file.prc. Once I edited the value of model-cache-dir there I stopped seeing the :util(error): Unable to make directory /panda3d, caching disabled. error.

note: this did not fix the shader warnings, which appear similar to some of those discussed here https://discourse.panda3d.org/t/cant-get-simple-glsl-shaders-example-working/25548/3. although the fixes on that thread haven't worked out for me yet.

:display:gsg:glgsg(warning): Shader shaders/fragment/geometry-buffer-0.frag produced the following warnings:
WARNING: Output of vertex shader 'vertexInShadowSpaces' not read by fragment shader
WARNING: Output of vertex shader 'vertexColor' not read by fragment shader
WARNING: Output of vertex shader 'diffuseCoord' not read by fragment shader
WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.

:display:gsg:glgsg(warning): Shader shaders/fragment/geometry-buffer-1.frag produced the following warnings:
WARNING: Output of vertex shader 'vertexInShadowSpaces' not read by fragment shader
WARNING: Output of vertex shader 'vertexColor' not read by fragment shader
WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.

:display:gsg:glgsg(warning): Shader shaders/fragment/geometry-buffer-2.frag produced the following warnings:
WARNING: Output of vertex shader 'normalCoord' not read by fragment shader
WARNING: Output of vertex shader 'vertexNormal' not read by fragment shader
WARNING: Output of vertex shader 'binormal' not read by fragment shader
WARNING: Output of vertex shader 'tangent' not read by fragment shader
WARNING: Output of vertex shader 'vertexInShadowSpaces' not read by fragment shader
WARNING: Could not find fragment shader output 'p3d_FragData' to match FragDataBinding request.

^^ 2nd update: I now think that the issue we're both seeing is actually this, we just weren't articulating it well and got thrown off by the warnings. the fix merged for that issue also hasn't worked out for me, though.

Screen Shot 2021-05-10 at 10 33 29 AM
Js11252001 commented 2 years ago

I also have this problems.

ngn999 commented 2 years ago

this is maybe a bug about M1 MacBook Pro?

in order to get some debug information, I add:

notify-level warning
notify-level-glgsg spam
default-directnotify-level warning
notify-output mygame-log.txt

and the log file is in the attach: mygame-log.txt .

ghost commented 2 years ago

I also have this problems. i'm use intel macbookpro

ngn999 commented 2 years ago

I also have this problems. i'm use intel macbookpro

Go to buy a PC, and forget this issue.

samiede commented 2 years ago

Amazing suggestions, very helpful.

victor-kironde commented 1 year ago

Got this too