Home | Features | Roadmap | Learn | Documentation | |||||
Latest version: Tramway SDK 0.0.9 Github Quick links Home Get Started |
Adding MaterialsIf you followed the last guide and made your own teapot, you might have noticed that the teapot is not shiny. Not shiny at all! Also the texture was pixelated. Very pixelated! The reason for this is very simple – by default all materials are matte and not at all shiny. However, we can override this behavior by adding a material definition ourselves, instead of letting the framework create a default one.
Open up the What do all of the values do?Material nameThis is the name of the material. It is used to reference it, such as by 3D models. It is also used to lookup the texture image for the material. TypeThis tells the renderer how to render the material. For the OpenGL backend this also determines which shader will be used to render this material. FilterThis tells the renderer whether to blur the textures when upscaling them. This is why they look pixelated &endash; by default blurring is disabled. PropertyThis describes aural and other physical properties about the material. This is not directly used by the renderer. We can ignore this for now. ColorThis is the color of the material. You might have noticed that a lot of materials have the white color. This is because if you use a texture image and if you want it to look exactly it looks in your image editor, you need to set it to white, since the material color and the texture color is multiplied together. Changing this will tint the texture image, or just set the material's color if there is no texture. SpecularityThis determines how intense the specularity of the material will be. Can be set in the range from 0.0 to 1.0. SpecularityThis determines how narrow or wide the specular reflection will be. Needs to be set to at least 1.0 or higher. Specular TransparencyThis determines whether the specular reflection will be multiplied with the material's color, or added to it. Can be set in the range from 0.0 to 1.0. Source
This determines the source of the material's texture image. If set to
This is useful if, for example, you want to create multiple materials with the same texture, but with different specular, color or other parameters. This way all of the materials will share the same texture image in GPU memory, thereby saving some space there. Fixing the teapot material
An easy way to do this would be to duplicate the My best work: now shiny again. ExerciseTry changing your teapot's material's properties. See what changing them to different values does. ExerciseUse the texture source option and the color parameter to create different colored variations of your material.
|
|
|||
|