[SOLVED] How change color of scene
[SOLVED] How change color of scene
I want create night scene. But I don't want create real-time lights and shadows - it's really effected on fps. I just need made everything a little bit dark-blue. Like put mask on output window, but GUI - should be the same color.
I want keep:
ModelNode->setMaterialFlag(EMF_LIGHTING, false);
And I don't want use:
smgr->addLightSceneNode(...);
and
driver->setAmbientLight(...);
I want keep:
ModelNode->setMaterialFlag(EMF_LIGHTING, false);
And I don't want use:
smgr->addLightSceneNode(...);
and
driver->setAmbientLight(...);
Last edited by Lev_a on Tue Mar 21, 2006 3:56 pm, edited 1 time in total.
I already think about it.JP wrote:Could you maybe draw a 2D rectangle the full size of the screen and make it a seethru dark blue colour?
If any other solutions for it?
I found http://irrlicht.sourceforge.net/phpBB2/ ... 8831#58831
and I tryed:
ModelNode->getMaterial(0).AmbientColor.set(150, 50, 50, 255);
And no effect at all.
Any ideas?
Have not tried it (and cant atm), but check if you get it with:Lev_a wrote:I already think about it.JP wrote:Could you maybe draw a 2D rectangle the full size of the screen and make it a seethru dark blue colour?
If any other solutions for it?
I found http://irrlicht.sourceforge.net/phpBB2/ ... 8831#58831
and I tryed:
ModelNode->getMaterial(0).AmbientColor.set(150, 50, 50, 255);
And no effect at all.
Any ideas?
Code: Select all
driver->beginScene();
SMaterial mat;
mat.AmbienColor.set(150, 50, 50, 255);
driver->setMaterial( mat );
driver->endScene();
UHM, sry; havent read you didnt want to use driver->setAmbientLight(...); [probably the same effect; OR MAYBE NOT, try and tell
![Wink ;)](./images/smilies/icon_wink.gif)
Doesn't work - no any effects.Warchief wrote: Have not tried it (and cant atm), but check if you get it with:UHM, sry; havent read you didnt want to use driver->setAmbientLight(...); [probably the same effect; OR MAYBE NOT, try and tellCode: Select all
driver->beginScene(); SMaterial mat; mat.AmbienColor.set(150, 50, 50, 255); driver->setMaterial( mat ); driver->endScene();
]
I just need put glasses on users eyes with color(.....).
I don't want use dynamic or other lights - I just want change color of air.
Any ideas?
I found solution:
Code: Select all
driver->beginScene();
.....
irr::video::SColor col = irr::video::SColor(50, 0, 0, 150);
irr::core::rect<s32> pos = irr::core::rect<s32>(0, 0, 800, 600);
driver->draw2DRectangle(col, pos);
......
driver->endScene();
um....sorry to bump this thread up but I have the same problem with the thread starter,create a night scene
I've read the solutions he made (actually, JP made it) but it just didn't work on me![Sad :(](./images/smilies/icon_sad.gif)
I typed the code just as he showed in the previous post, like this
but nothing happened, my scene still as bright as day
your help will be appreciated![Very Happy :D](./images/smilies/icon_biggrin.gif)
I've read the solutions he made (actually, JP made it) but it just didn't work on me
![Sad :(](./images/smilies/icon_sad.gif)
I typed the code just as he showed in the previous post, like this
Code: Select all
driver->beginScene();
video::SColor col = video::SColor(50, 0, 0, 150);
core::rect<s32> pos = core::rect<s32>(0,0,800,600);
driver->draw2DRectangle(col,pos);
// some other rendering codes here
driver->endScene();
your help will be appreciated
![Very Happy :D](./images/smilies/icon_biggrin.gif)
The problem is you're drawing the rectangle before you draw your stuff, do it the other way around:
Code: Select all
driver->beginScene();
// render scene here
video::SColor col = video::SColor(50, 0, 0, 150);
core::rect<s32> pos = core::rect<s32>(0,0,800,600);
driver->draw2DRectangle(col,pos);
// if applicable, render gui here
driver->endScene();