GroIMP Module XL English
Spoken text
As mentioned in Unit 1 of the first learning module, a project represents a higher level for combining several different files and for saving all settings. These settings include the use of textures read out of graphics files, for example for coloring bark or leaves.
First, via File -> New -> RGG project a new project is created and the RGG file is renamed with a descriptive name.
The default example model is replaced by the inserted new model and is compiled. In addition to a sphere as a bud, a parallelogram is created. This will later represent the leaves.
To give the schematic leaves a texture, the "Shaders" window has to be opened via the menu bar -> Panels -> Explorers -> 3D. This window can of course also be anchored in the user interface.
Shaders are parts of a renderer and are mainly responsible for coloring and the lighting calculation. The shader basically determines the color of an object while light shines on it. By clicking Object -> New -> Lambert we create a Lambert shader. To replace the name of this shader or rather the subsequent texture of it, you have to click twice on the name "Lambert" and then type the name you want. The name "Leaf" seems to be reasonable. With the Return key you finish this procedure.
A double-click on the sphere icon opens the attribute editor with the settings for the created shader. By opening Diffuse Colours -> Surface Maps -> Image, a certain surface from an image can be assigned to the shader. By clicking on the question mark next to "Image" and "From File", you can choose an image file with an existing texture, for example a leaf picture. By "Add the file", the entire image file is added to the project. It is important that the image background is transparent. This ensures that only the favored textures without white frames are shown.
To show the parallelogram objects with the texture, a few changes in the model code have to be made: the textures have to be assigned to the objects. At first a global constant has to be inserted to call the texture or the shader. Therefore the "shader function" is used, and as an argument the name of the shader, here “Leaf”, is inserted. At last the new shader is assigned to the parallelogram module by the “setShader” function and the defined constant.
If you run the model after recompiling there are leaves instead of simple parallelograms.
Finally, the entire project is saved using the menu bar -> File -> Save and may thus be recalled at any time and used with the included textures.