However I have a problem when trying to display shapes that I am generating procedurally using the GeomVertexFormat, GeomVertexData and GeomTriangles(Geom.UHStatic) from panda3d.core.
The problem is that all these shapes appear pitch black regardless of the lights that I put in the scene.
I’m using a GeomVertexFormat with V3n3c4t2, so I have rows with: vertex, color, normal and texcoord.I couldn’t find any documentation on how to procedurally apply textures when using the RenderPipeline, and all the examples provided with the library use pre-created textured assets. So for the moment, I am only applying colors to my vertuces, no textures or materials (texcoord is always 0.0).
To fix my problem I tried:
flipping the normals of my shapes
adding more and stronger lights from rpcore and panda.core in my scene
but my models remain black.
My code after the creation of the GeomTriangles(Geom.UHStatic) looks like this:
I have one follow-up question, regarding creating PBR materials in Panda3D. I am trying to use texture maps not only for the base color, but also for the metallic, normal and roughness of my materials. Do you know have any suggestions on how to do that?
I think the RenderPipeline requires PBR textures to be applied to four successively numbered texture stages; consult the RenderPipeline documentation for the precise order in which these should be applied.
The plans are to make this easier to do in Panda3D 1.11 by creating a new interface for assigning these texture slots in the Material class.
I can advise you to study .blend files with examples. To do this, you need to install Blender version <2.7. Also YABEE and Panda3D-Bam-Exporter. Save the EGG use YABEE, after which it will be possible to study the structure of the material in a text file.