mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-24 17:50:31 +01:00
Demo - billboard zbuffer
11.PerPixelLighting - darker light, enable specular again for diffuse - replace wrong irrlichtlogo2.png (was a test around 2005) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6088 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
8554ec93f9
commit
fe7778d8d8
@ -277,7 +277,7 @@ int main()
|
|||||||
/*
|
/*
|
||||||
And at last, we create a nice Irrlicht Engine logo in the top left corner.
|
And at last, we create a nice Irrlicht Engine logo in the top left corner.
|
||||||
*/
|
*/
|
||||||
env->addImage(driver->getTexture(mediaPath + "irrlichtlogo2.png"),
|
env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"),
|
||||||
position2d<int>(10,10));
|
position2d<int>(10,10));
|
||||||
|
|
||||||
|
|
||||||
|
@ -978,7 +978,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
// load the irrlicht engine logo
|
// load the irrlicht engine logo
|
||||||
IGUIImage *img =
|
IGUIImage *img =
|
||||||
env->addImage(driver->getTexture("irrlichtlogo2.png"),
|
env->addImage(driver->getTexture("irrlichtlogo3.png"),
|
||||||
core::position2d<s32>(10, driver->getScreenSize().Height - 128));
|
core::position2d<s32>(10, driver->getScreenSize().Height - 128));
|
||||||
|
|
||||||
// lock the logo's edges to the bottom left corner of the screen
|
// lock the logo's edges to the bottom left corner of the screen
|
||||||
|
@ -285,9 +285,9 @@ int main()
|
|||||||
driver->getTexture(mediaPath + "rockwall.jpg"));
|
driver->getTexture(mediaPath + "rockwall.jpg"));
|
||||||
room->setMaterialTexture(1, normalMap);
|
room->setMaterialTexture(1, normalMap);
|
||||||
|
|
||||||
// Stones don't glitter..
|
// Stones don't glitter.. (but specular highlight for EMT_SOLID)
|
||||||
room->getMaterial(0).SpecularColor.set(0,0,0,0);
|
//room->getMaterial(0).SpecularColor.set(0,0,0,0);
|
||||||
room->getMaterial(0).Shininess = 0.f;
|
//room->getMaterial(0).Shininess = 0.f;
|
||||||
|
|
||||||
room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
|
room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
|
||||||
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
|
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
|
||||||
@ -365,7 +365,7 @@ int main()
|
|||||||
// add light 1 (more green)
|
// add light 1 (more green)
|
||||||
scene::ILightSceneNode* light1 =
|
scene::ILightSceneNode* light1 =
|
||||||
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
|
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
|
||||||
video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 800.0f);
|
video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 400.0f);
|
||||||
|
|
||||||
// add fly circle animator to light 1
|
// add fly circle animator to light 1
|
||||||
scene::ISceneNodeAnimator* anim =
|
scene::ISceneNodeAnimator* anim =
|
||||||
@ -398,7 +398,7 @@ int main()
|
|||||||
// add light 2 (red)
|
// add light 2 (red)
|
||||||
scene::ISceneNode* light2 =
|
scene::ISceneNode* light2 =
|
||||||
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
|
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
|
||||||
video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 800.0f);
|
video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 400.0f);
|
||||||
|
|
||||||
// add fly circle animator to light 2
|
// add fly circle animator to light 2
|
||||||
anim = smgr->createFlyCircleAnimator(core::vector3df(0,150,0), 200.0f,
|
anim = smgr->createFlyCircleAnimator(core::vector3df(0,150,0), 200.0f,
|
||||||
|
@ -120,7 +120,7 @@ int main()
|
|||||||
const io::path mediaPath = getExampleMediaPath();
|
const io::path mediaPath = getExampleMediaPath();
|
||||||
|
|
||||||
// add irrlicht logo
|
// add irrlicht logo
|
||||||
env->addImage(driver->getTexture(mediaPath + "irrlichtlogo2.png"),
|
env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"),
|
||||||
core::position2d<s32>(10,10));
|
core::position2d<s32>(10,10));
|
||||||
|
|
||||||
//set other font
|
//set other font
|
||||||
|
@ -318,7 +318,7 @@ int IRRCALLCONV main(int argc, char* argv[])
|
|||||||
device->getCursorControl()->setVisible(false);
|
device->getCursorControl()->setVisible(false);
|
||||||
|
|
||||||
// load the engine logo
|
// load the engine logo
|
||||||
gui->addImage(driver->getTexture("irrlichtlogo2.png"),
|
gui->addImage(driver->getTexture("irrlichtlogo3.png"),
|
||||||
core::position2d<s32>(10, 10));
|
core::position2d<s32>(10, 10));
|
||||||
|
|
||||||
// show the driver logo
|
// show the driver logo
|
||||||
|
@ -497,6 +497,7 @@ void CDemo::loadSceneData()
|
|||||||
bill = sm->addBillboardSceneNode(0, core::dimension2d<f32>(100,100),
|
bill = sm->addBillboardSceneNode(0, core::dimension2d<f32>(100,100),
|
||||||
waypoint[r]+ core::vector3df(0,20,0));
|
waypoint[r]+ core::vector3df(0,20,0));
|
||||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||||
|
bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
|
||||||
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp"));
|
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp"));
|
||||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||||
bill->addAnimator(anim);
|
bill->addAnimator(anim);
|
||||||
@ -583,7 +584,7 @@ void CDemo::createLoadingScreen()
|
|||||||
const io::path mediaPath = getExampleMediaPath();
|
const io::path mediaPath = getExampleMediaPath();
|
||||||
|
|
||||||
// irrlicht logo
|
// irrlicht logo
|
||||||
device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture(mediaPath + "irrlichtlogo2.png"),
|
device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture(mediaPath + "irrlichtlogo3.png"),
|
||||||
core::position2d<s32>(5,5));
|
core::position2d<s32>(5,5));
|
||||||
|
|
||||||
// loading text
|
// loading text
|
||||||
@ -648,8 +649,8 @@ void CDemo::shoot()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// doesnt collide with wall
|
// doesnt collide with wall
|
||||||
core::vector3df start = camera->getPosition();
|
start = camera->getPosition();
|
||||||
core::vector3df end = (camera->getTarget() - start);
|
end = (camera->getTarget() - start);
|
||||||
end.normalize();
|
end.normalize();
|
||||||
start += end*8.0f;
|
start += end*8.0f;
|
||||||
end = start + (end * camera->getFarValue());
|
end = start + (end * camera->getFarValue());
|
||||||
|
@ -70,7 +70,7 @@ bool CMainMenu::run()
|
|||||||
gui::IGUIListBox* box = guienv->addListBox(core::rect<int>(10,10,220,120), optTab, 1);
|
gui::IGUIListBox* box = guienv->addListBox(core::rect<int>(10,10,220,120), optTab, 1);
|
||||||
box->addItem(L"OpenGL 1.5");
|
box->addItem(L"OpenGL 1.5");
|
||||||
box->addItem(L"Direct3D 9.0c");
|
box->addItem(L"Direct3D 9.0c");
|
||||||
box->addItem(L"Burning's Video 0.47");
|
box->addItem(L"Burning's Video 0.5");
|
||||||
box->addItem(L"Irrlicht Software Renderer 1.0");
|
box->addItem(L"Irrlicht Software Renderer 1.0");
|
||||||
switch (driverType )
|
switch (driverType )
|
||||||
{
|
{
|
||||||
@ -184,6 +184,7 @@ bool CMainMenu::run()
|
|||||||
{
|
{
|
||||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||||
|
bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
|
||||||
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp"));
|
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp"));
|
||||||
}
|
}
|
||||||
// add fly circle animator to the light
|
// add fly circle animator to the light
|
||||||
@ -202,6 +203,7 @@ bool CMainMenu::run()
|
|||||||
{
|
{
|
||||||
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
bill->setMaterialFlag(video::EMF_LIGHTING, false);
|
||||||
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
|
||||||
|
bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
|
||||||
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp"));
|
bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp"));
|
||||||
}
|
}
|
||||||
// add fly circle animator to the light
|
// add fly circle animator to the light
|
||||||
|
Loading…
Reference in New Issue
Block a user