Page 1 of 1

Material Question

Posted: Sat Jun 25, 2016 3:57 pm
by bruZard
I've created a Plane:

Code: Select all

 
IMesh* mesh = context->getSceneMgr()->getGeometryCreator()->createPlaneMesh(
    dimension2d<f32>(1.0, 1.0), 
    dimension2du(u32(subDivs), u32(subDivs)), 
    mat);
    
IMeshSceneNode* plane = context->getSceneMgr()->addMeshSceneNode(mesh, parent);
plane->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
plane->setMaterialType(EMT_SOLID);
 
Now i try to change the color of the plane:

Code: Select all

 
plane->getMaterial(0).DiffuseColor.set(255, 255, 0, 0);
 
Why will this not work?

Re: Material Question

Posted: Sat Jun 25, 2016 4:20 pm
by CuteAlien
Not sure if standard fixed function pipeline can do that - diffuse lighting might need pixel-shaders.

Re: Material Question

Posted: Sat Jun 25, 2016 4:52 pm
by bruZard
Why the node had a material if i can't change the color of it?

Re: Material Question

Posted: Sat Jun 25, 2016 7:37 pm
by CuteAlien
You can work with the other colors. You can experiment with the different combinations of materials and lights in the example 22.MaterialViewer.