I’m new to using p3d. I cannot load a .glb model with multiple textures, only diffuse color is shown, and I don’t seem to be able to assign later normal and roughness maps to my earth model. I attach the .glb which displays fine in https://sandbox.babylonjs.com.
I had a look to the forum but most of the info I could find concerns old versions of panda3d using the egg format.
Are you using panda3d-gltf to load the model? Is there a reason you are trying to load the textures manually instead of loading them through the glb file? If the glb loader is setting these textures (panda3d-gltf creates fallback textures if the glb/gltf file does not have them) then you will need to override them when calling set_texture() as discussed here. For example:
Hi Moguri, Thank you for answering. I’ve tried your suggestions. The PBR shader is indeed better than the default one. Still I can see neither bump nor glossy maps applied to my model when I Ioad the glb file with panda3d-gltf. Nor the override (with ,1) appears to produce any visible effect. As before setShaderAuto blackens the model out.
I was in same situation for a while trying to load image textured models from blender, and finally get into a way to make it work:
In Blender use glb/gltf exporter, and make sure you have selected the model, and check “selected objects” in “include” section. And check “tangents” in “geometry” section if you are using normal maps.
but for 330, for example, needed to set MESA_GL_VERSION_OVERRIDE=“3.00 ES” in environment variables to get it work propperly (I am using Debian GNU/Linux 11 and Intel i915 video card). Add one keyword at a time, and check results each.
Finally, be aware of lightning, use only Ambient and Directional, so Point has some issues with some mappings.
Hope it helps.
(xcuse my English if you notice any mistake or typo)
Thank you for the info. I see I was missing the part of tweaking the pbr config patameters… I will try that tonight and see if I can make it work on my win10 laptop. I also notice that you do not use setShaderAuto which I reckon gets replaced by the pbr shader. Wrt the point lights, it would be a big limitation for what I intend to do with p3d if I could not use them. I nead at least one.
In general, I’m progressing fast with my animation project in p3d! Thank you to the developers and the maintainers of this great piece of sw!
Hi All, I have tried the pbr settings suggested by Octaviotron with no success. I have also update my video card drivers (should support opengl 4.5) with no success. There must be some configuration still missing. Maybe I should have said it before, p3d gives me this error when running my test:-
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader created-shader:
ERROR: created-shader:56: '' : illegal recursive expansion of macro p3d_TextureNormal
ERROR: created-shader:56: 'p3d_TextureNormal' : failed to expand macro
ERROR: created-shader:57: '' : illegal recursive expansion of macro p3d_TextureEmission
ERROR: created-shader:57: 'p3d_TextureEmission' : failed to expand macro
ERROR: created-shader:121: '' : illegal recursive expansion of macro p3d_TextureNormal
ERROR: created-shader:121: 'p3d_TextureNormal' : failed to expand macro
ERROR: created-shader:134: '' : illegal recursive expansion of macro p3d_TextureEmission
ERROR: created-shader:134: 'p3d_TextureEmission' : failed to expand macro
Hi CM, I have tried the .bam route but I have the same situation: I cannot see any normal/gloss mapping and I get those messages from the shader compiler. I have tried the shader-terrain sample and I’ve noticed that I can see the elevation of the terrain whereas the skybox (which is a .bam model) is not displayed. I have tried also other samples, like ball-in-maze and bump-mapping: they both appear to be working fine (the ball is nicely textured and glossy and the bricks are correctly showing the normal map effect). These two samples (and all the others) don’t use .bam/.glb/gltf but .egg/.egg.pz. If I interpret all this correctly then my problem is not with OpenGL (which does its job in building the terrain glsl shader for example), nor it is with the preparation of the models (the .bam shipped with the sample project should be fine), but it is rather with the displaying of .bam/.glb/.gltf. What do you thing? I would be ok using the egg format as well, but are still there converters that generate .egg files from blender 2.9+? Cheers,
PRPEE, I believe, was not made for general usage, but rather towards the specific purposes of its creator. As a result, it doesn’t always produce the expected results.
We’ve had quite a few threads pop up as a result of people finding PRPEE, having trouble with it, and so coming here for help, as I recall.
If you want to export to egg/bam, I’d suggest trying Maxwell175’s port of YABEE instead.
But more generally, I have an “exporting from Blender” quick-reference thread, which may give you some leads to investigate (including the above-mentioned port by Maxwell175)–you should find it here:
Hi Thaumaturge, thank you for the pointers. I have tried both PRPEE and YABEE but the results aren’t very encouraging. I have also tried to reuse the untextured egg models of the solar-system example (veeery low-poly) with my textures instead of the original. Something happens when I apply these textures, but now I am not sure of what I’m seeing… Maybe my normal/gloss maps simply aren’t fit for the job. I’ll have to live without those effects for the moment. Cheers,
Unfortunately, I have very little experience with glTF files (let alone “glb” files) and PBR rendering–and on top of that, I use an older version of Blender. Thus I have little more to offer right now, I fear.
However, perhaps someone else on the forum will have an idea as to what might be going wrong!
More than a year after the last message, I want to answer your post regarding the following errors you experienced because I experience the same exact errors:
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader created-shader:
ERROR: created-shader:56: '' : illegal recursive expansion of macro p3d_TextureNormal
ERROR: created-shader:56: 'p3d_TextureNormal' : failed to expand macro
ERROR: created-shader:57: '' : illegal recursive expansion of macro p3d_TextureEmission
ERROR: created-shader:57: 'p3d_TextureEmission' : failed to expand macro
ERROR: created-shader:121: '' : illegal recursive expansion of macro p3d_TextureNormal
ERROR: created-shader:121: 'p3d_TextureNormal' : failed to expand macro
ERROR: created-shader:134: '' : illegal recursive expansion of macro p3d_TextureEmission
ERROR: created-shader:134: 'p3d_TextureEmission' : failed to expand macro
I got a project which runs perfectly fine on my desktop computer which has a decent hardware configuration. But when I try to run it on my Microsoft Surface, I have the same errors as you above. This is the same exact lines of code with the same versions of packages, dependencies, …
So my guess is, your laptop’s hardware is the culprit here : your laptop doesn’t have the graphical resources to run your project. If somebody have more information feel free to share your knowledge !
I copied all my project folder and dependencies in python’s sites-package from my desktop computer to a flash USB to test on a Surface, so I guess everything is the same.
Not sure if I clean the pycache folders, I could try this!