hi. i have cubes, spheres and meshes and want select one object and this should shine little brighter.
how can i realize this? all objects have a texture.
can i give a shine-color for all objects, so its look similar selected?
i mean, a green texture cube sould shine how a brown texture sphere. thanks for help!
add shine-effect for a select object
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
specular
The specular color is what you need to use. It's in the render to texture tutorial.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
node->getMaterial(0).Shininess = 35.0f;
That's how you set your specular highlights. Experiment with it to get the desired result. The higher you set it, the darker the unlit areas become and the brighter the effects is, and the lower, the lighter the unlit areas and the effect is a little weaker (from the normal lighting) if I remember correctly.
That's how you set your specular highlights. Experiment with it to get the desired result. The higher you set it, the darker the unlit areas become and the brighter the effects is, and the lower, the lighter the unlit areas and the effect is a little weaker (from the normal lighting) if I remember correctly.
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
Specular is only applicable when the camera or the object is moving, unless the lighting is specifically setup so the reflection of the specular angle is facing the camera.
You could try making it EMT_TRANSPARENT_ADD when its selected, making it additive and much brighter, using setTexture(1, ) to change the lightmap texture it uses (the second channel). But then the other option is to add a "lightmap" or detail map to the one that is selected, this way the "light" can have shapes and shading as well, much better using EMT_LIGHTMAP_ADD or EMT_LIGHTMAP_M4 or M2.
If this confuses you, check the documentation and experiment in the given examples, adding a texture to the second layer, setting the material type to lightmap and see what you can come up with (grayscale is better for lightmaps on additive)
You could try making it EMT_TRANSPARENT_ADD when its selected, making it additive and much brighter, using setTexture(1, ) to change the lightmap texture it uses (the second channel). But then the other option is to add a "lightmap" or detail map to the one that is selected, this way the "light" can have shapes and shading as well, much better using EMT_LIGHTMAP_ADD or EMT_LIGHTMAP_M4 or M2.
If this confuses you, check the documentation and experiment in the given examples, adding a texture to the second layer, setting the material type to lightmap and see what you can come up with (grayscale is better for lightmaps on additive)
little example with 3 cubes
with setAmbientLight and EMF_LIGHTING = true
or without setAmbientLight and EMF_LIGHTING = false
cube1->getMaterial(0).Shininess = 35.0f;
mhh, this changing nothing in my test.
@FuzzYspo0N
result with this line
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_ADD); // can't see changes
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_M4); // is much to bright
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_M2); // is still to bright
i look in
http://www.irrlicht3d.org/wiki/index.ph ... dMaterials
http://www.irrlicht3d.org/wiki/index.ph ... dMaterials
but this not helping me
additionally
with setAmbientLight i can set the light color for everyone. its possible to set such color to one object?
with setAmbientLight and EMF_LIGHTING = true
or without setAmbientLight and EMF_LIGHTING = false
@cobrasmgr->setAmbientLight(irr::video::SColorf(1.0,1.0,1.0,1));
irr::scene::ISceneNode* cube1 = smgr->addCubeSceneNode(10);
cube1->setMaterialFlag(irr::video::EMF_LIGHTING, true);
cube1->setMaterialTexture(0, driver->getTexture("..\\..\\irrlicht-1.5\\media\\rockwall.bmp"));
irr::scene::ISceneNode* cube2 = smgr->addCubeSceneNode(5.0f, 0, -1, irr::core::vector3df(10,0,0));
cube2->setMaterialFlag(irr::video::EMF_LIGHTING, true);
cube2->setMaterialTexture(0, driver->getTexture("..\\..\\irrlicht-1.5\\media\\rockwall.bmp"));
irr::scene::ISceneNode* cube3 = smgr->addCubeSceneNode(5.0f, 0, -1, irr::core::vector3df(-10,0,0));
cube3->setMaterialFlag(irr::video::EMF_LIGHTING, true);
cube3->setMaterialTexture(0, driver->getTexture("..\\..\\irrlicht-1.5\\media\\rockwall.bmp"));
cube1->getMaterial(0).Shininess = 35.0f;
mhh, this changing nothing in my test.
@FuzzYspo0N
result with this line
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_ADD); // can't see changes
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_M4); // is much to bright
cube1->setMaterialType(irr::video::EMT_LIGHTMAP_M2); // is still to bright
i look in
http://www.irrlicht3d.org/wiki/index.ph ... dMaterials
http://www.irrlicht3d.org/wiki/index.ph ... dMaterials
but this not helping me
additionally
with setAmbientLight i can set the light color for everyone. its possible to set such color to one object?
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
Check the documentation, please.
Each IMesh has a material associated with it. This means that :
http://irrlicht.sourceforge.net/docu/cl ... 18d30e6b4b
Reading about it will help you.
This is the scene manager, THE WHOLE SCENE.
Have fun
Each IMesh has a material associated with it. This means that :
http://irrlicht.sourceforge.net/docu/cl ... 18d30e6b4b
Reading about it will help you.
Code: Select all
smgr->setAmbientLight(irr::video::SColorf(1.0,1.0,1.0,1));
Code: Select all
cube2->getMaterial(0).AmbientColor = SColorf(1.0,1.0,1.0,1);
my first destination are tutorials and api, but as noob must first understand the irrlicht concept, without this i would never find in api my result.
the theme with glow is here often, but nobody have a solution.
the solution with cube1->getMaterial(0).AmbientColor = SColor(255,128,0,255); was very helpful. its look nice
but i founded no way for a additionally inner shining or mild glow for my cube.
the theme with glow is here often, but nobody have a solution.
the solution with cube1->getMaterial(0).AmbientColor = SColor(255,128,0,255); was very helpful. its look nice
but i founded no way for a additionally inner shining or mild glow for my cube.