I have another piece of information if it helps: when I install panda3d-gltf, just install but no import in my project, I see the following result, which is kind of artistic but not what I expected :
At the moment there is another problem: simplepbr does not support the metallicity of the material parameter. Therefore, all surfaces will be black.
Although reading this thread, you can see that this has been implemented, but nowhere is it indicated how to install lighting based on the images. Logically, you can install a pre-rendered map. However, this question can be answered by @Moguri
It would be nice if you would create a minal example of the model for demonstration. Or additionally provided a screenshot of the nodes for the car body material.
IBL support is still new (master branch, no release with it yet), and I’d like to write some docs/examples for it. The gist of it is set env_map (e.g., as a keyword to init()) to a string or panda3d.core.Filename that is a path to a set of cubemap images as described here: Cube Maps — Panda3D Manual
The shiny grey of this model is just a base color set to grey and roughness set to 0 in Blender, nothing fancy for now.
@Moguri: following your advice, I downloaded the latest version of panda3d-simplepbr on the master branch. After that, I installed the new dependency typing-extensions required for simplepbr.
I edited my code like so:
import simplepbr
import direct.showbase.ShowBase
class Main(direct.showbase.ShowBase.ShowBase):
def __init__(self):
super().__init__(self)
simplepbr.init(env_map="content/models/objects/cubemap.env")
The cubemap is the one given in the package of simplepbr.
For information, here are the traces of execution:
“C:\Program Files\Panda3D-1.10.13-x64\python\python.exe” D:\Workspace\Python\200SX\main.py
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
AL lib: (EE) ALCwasapiPlayback_resetProxy: Audio client returned buffer_len < period*2; expect break up
:display:gsg:glgsg(error): An error occurred while compiling GLSL fragment shader pbr:
pbr(205) : error C7616: global function shadow2DProj is removed after version 140
pbr(240) : error C7616: global function textureCubeLod is removed after version 140
pbr(261) : warning C7533: global variable gl_FragColor is deprecated after version 120
tonemap(40) : warning C7533: global variable gl_FragColor is deprecated after version 120
:display:gsg:glgsg(warning): Shader tonemap produced the following warnings:
Fragment info
0(40) : warning C7533: global variable gl_FragColor is deprecated after version 120
Okay, it looks like there’s a version-mismatch: version 140 is being used, but the shader-code is built for an earlier version.
And indeed, looking at the simplepbr GitHub page, it does look like the shaders there specificy version 120.
So, do you have something requesting a specific GLSL version somewhere? Perhaps you’re setting the gl-version config-variable, either in a PRC file or via code…?
[edit] I do note that in the “readme” file for simplepbr, there is a parameter to the “init” function called “use_330”–what happens if you set that to “True”?
(That looks like it might be intended for cases in which a later version of GLSL is desired, you see.)
Why does a pure mate material still have reflections on it?
How to generate a CubeMap that can be used as env_map for simplepbr?
If I want a black background what are you advice? Should I use a black box to cover the whole scene?
Regarding question #1
I created a simple example with two spheres: one pure shiny red, the other pure mate black.
Here is the preview with https://gltf-viewer.donmccurdy.com/
Why does the black sphere still have some reflections on it? This is the same for the car’s tyres. I played a lot with Blender materials parameters (roughness to 1, specular to 0, …) but did not succeed in getting the pure mate material, any ideas?
Regarding question #2
I tried passing 5 PNG images to simplepbr as suggested in the manual (Cube Maps):
But for some reason the same image is used for all the face of the cube, you can see it on the spheres: 5 of 6 face of the cube map should be black bit it is not the case here.
This post got me to do some digging into the IBL code for simplepbr, and found some errors that I cleaned up and pushed to the master branch. A fully metallic and fully rough material still doesn’t look quite right (the reflection is still too visible for a fully rough material).