Lighting: Vizard
The command used to load a model in Vizard determines whether or not effects are enabled on it. This affects the lighting calculations for lights added in either Inspector or the Vizard script:
The command used to load a model in Vizard determines whether or not effects are enabled on it. This affects the lighting calculations for lights added in either Inspector or the Vizard script:
viz.addChild
: Loads model without effects. Only per vertex lighting is supportedvizfx.addChild
: Loads a model with effects. Per pixel lighting, ambient light, and shadows are supported
Open up testHouse.py and change where the comment is placed so the vizfx.addChild command is used to load the house model:
Open up testHouse.py and change where the comment is placed so the vizfx.addChild command is used to load the house model:
#house = viz.addChild('house1.osgb')
house = vizfx.addChild('house1.osgb')
Run the script and see the difference with the added directional and ambient light. Note that the model appears brighter in Vizard than in Inspector. The reason for this is that Vizard also has the headlight enabled. Add the following line of code to disable the head light:
Run the script and see the difference with the added directional and ambient light. Note that the model appears brighter in Vizard than in Inspector. The reason for this is that Vizard also has the headlight enabled. Add the following line of code to disable the head light:
viz.MainView.getHeadLight().disable()
Adding Lights in Vizard
Adding Lights in Vizard
Custom lights can be added, modified, and removed via the Vizard script. Run light_demo.py in the Light demo folder and try different combinations of light settings.
Custom lights can be added, modified, and removed via the Vizard script. Run light_demo.py in the Light demo folder and try different combinations of light settings.