How to achieve flat shading without texture? [SOLVED]
Posted: Sun Feb 08, 2015 1:36 pm
Hi guys,
Today I wanted to ask is it possible to have a flat shading without texture on mesh? Currently I do not want to be disctracted by the textures, I would like to see only flat shading of my mesh on solid color.
For example, take a look at this:
I had to add random texture for this two meshes because otherwise I do not have shading and evertything looks "flat".
By flat shading I mean this:
So, I would like to get rid of texture from my mesh and leave only solid color with this shading.
Currently I do:
How to change this code to achieve the desired effect?
Thanks.
Today I wanted to ask is it possible to have a flat shading without texture on mesh? Currently I do not want to be disctracted by the textures, I would like to see only flat shading of my mesh on solid color.
For example, take a look at this:
I had to add random texture for this two meshes because otherwise I do not have shading and evertything looks "flat".
By flat shading I mean this:
So, I would like to get rid of texture from my mesh and leave only solid color with this shading.
Currently I do:
Code: Select all
driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
//....
IAnimatedMesh* mesh = smgr->getMesh(device->getFileSystem()->getWorkingDirectory() + "//Debug//test.ywf");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture(0,
driver->getTexture("E:\\CODING\\Developement\\C++\\Libs\\irrlicht-1.8.1\\media\\stones.jpg"));
node->setMaterialType(video::EMT_SOLID);
How to change this code to achieve the desired effect?
Thanks.