␡
- World Cleanup Utilities
- Primitive Creation
- Basic Shader Manipulation
- Using Our API to Quickly Create Content
- Future Considerations
- Summary
This chapter is from the book
Basic Shader Manipulation
The Models we have been creating allow us to specify an initial color, but beyond that we have very little control over the color of the objects. Because each of our Models has its own Shader, we can control the color of a Model with the following code:
Scene.model("whichmodel").shaderlist.diffuse = rgb(R,G,B)
Because this is only one line of code, I would probably not build a custom handler to control this one property. If you decide that you need more advanced surfacing for your Models, you may need to build a custom handler at that point. For now, this syntax will suffice for our demonstration.