complexpbr renders it as gray black. but simplepbr renders correctly as green grass.
from direct.showbase.ShowBase import ShowBase
from panda3d.core import DirectionalLight, Vec4, Vec3, TextureStage, NodePath, AnimBundleNode
from panda3d.core import *
import simplepbr
import complexpbr
from direct.actor.Actor import Actor
import panda3d
class MyApp(ShowBase):
def __init__(self):
# Initialize the base class (ShowBase)
ShowBase.__init__(self)
#simplepbr.init(enable_shadows=True, use_normal_maps=True)
complexpbr.apply_shader(self.render)
model_path = self.loader.loadModel('grass_ground_1.glb')
model_path.reparent_to(self.render)
self.ambientLight = AmbientLight("ambientLight")
self.ambientLight_Intensity=0.8
self.ambientLight.setColor((self.ambientLight_Intensity,self.ambientLight_Intensity,self.ambientLight_Intensity, 1))
self.render.setLight(self.render.attachNewNode(self.ambientLight))
self.directionalLight = DirectionalLight("directionalLight_1")
self.directionalLight_intensity=5
self.directionalLight.setColor((self.directionalLight_intensity,self.directionalLight_intensity,self.directionalLight_intensity, 1))
#self.directionalLight.setSpecularColor((.1, .1, .1, .1))
self.directionalLight.setShadowCaster(True, 512, 512)
self.dlight1=self.render.attachNewNode(self.directionalLight)
self.render.setLight(self.dlight1)
# Run the application
app = MyApp()
app.run()