Environment[solved]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
chaitanyaraghav
Posts: 12
Joined: Mon Jul 07, 2008 4:26 pm
Location: India

Environment[solved]

Post by chaitanyaraghav »

I have a small doubt :?
in blender if we create a small city or something similar we also add the environment i.e the sky textures.now if we import this into irrlicht do we have to again use skyboxes or will the textures of the sky be automatically loaded.

How do i create a dynamic environment i.e day and night cycles?
dont know if its correct but should i create skyboxes for different times of the day and then load it according to the time in the game?
Any simpler method? :roll:
Last edited by chaitanyaraghav on Sun Sep 07, 2008 4:18 am, edited 1 time in total.
Nobody is perfect!!
nd i am nobody!!
nmn
Posts: 23
Joined: Tue Sep 02, 2008 7:35 pm

Re: Environment

Post by nmn »

chaitanyaraghav wrote:I have a small doubt :?
in blender if we create a small city or something similar we also add the environment i.e the sky textures.now if we import this into irrlicht do we have to again use skyboxes or will the textures of the sky be automatically loaded.

How do i create a dynamic environment i.e day and night cycles?
dont know if its correct but should i create skyboxes for different times of the day and then load it according to the time in the game?
Any simpler method? :roll:
You should create skyboxes inside of the Irrlicht engine. It's not hard, and there are tutorials that show you how. For a day/night cycle I'm guessing the easiest way would be to fade between them.

Anyways, A Skybox:

Code: Select all

	// add a nice skybox

	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);

	smgr->addSkyBoxSceneNode(
		driver->getTexture("../../media/irrlicht2_up.jpg"),
		driver->getTexture("../../media/irrlicht2_dn.jpg"),
		driver->getTexture("../../media/irrlicht2_lf.jpg"),
		driver->getTexture("../../media/irrlicht2_rt.jpg"),
		driver->getTexture("../../media/irrlicht2_ft.jpg"),
		driver->getTexture("../../media/irrlicht2_bk.jpg"));

	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);

	// add a camera and disable the mouse cursor

	scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
	cam->setPosition(core::vector3df(-100,50,100));
	cam->setTarget(core::vector3df(0,0,0));
	device->getCursorControl()->setVisible(false);
For higher quality you'd of course want to find some very high resolution TGA or PNG skybox imagery.

If you you need a more realistic sky solution, though, you may need to look harder.

You may be able to tie the skybox images used in with the levels, too though. Metadata can be handled with XML - I don't know if you can embed metadata in Irr files or how to use them, though, sorry.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Making a realistic day/night cycle is pretty difficult. Thankfully Pazystamo already did most of the hard work-

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=10769
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
chaitanyaraghav
Posts: 12
Joined: Mon Jul 07, 2008 4:26 pm
Location: India

Re: Environment[solved]

Post by chaitanyaraghav »

nmn wrote:
You should create skyboxes inside of the Irrlicht engine. It's not hard, and there are tutorials that show you how. For a day/night cycle I'm guessing the easiest way would be to fade between them.


Anyways, A Skybox:

Code: Select all

	// add a nice skybox

	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);

	smgr->addSkyBoxSceneNode(
		driver->getTexture("../../media/irrlicht2_up.jpg"),
		driver->getTexture("../../media/irrlicht2_dn.jpg"),
		driver->getTexture("../../media/irrlicht2_lf.jpg"),
		driver->getTexture("../../media/irrlicht2_rt.jpg"),
		driver->getTexture("../../media/irrlicht2_ft.jpg"),
		driver->getTexture("../../media/irrlicht2_bk.jpg"));

	driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);

	// add a camera and disable the mouse cursor

	scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
	cam->setPosition(core::vector3df(-100,50,100));
	cam->setTarget(core::vector3df(0,0,0));
	device->getCursorControl()->setVisible(false);
For higher quality you'd of course want to find some very high resolution TGA or PNG skybox imagery.

If you you need a more realistic sky solution, though, you may need to look harder.

You may be able to tie the skybox images used in with the levels, too though. Metadata can be handled with XML - I don't know if you can embed metadata in Irr files or how to use them, though, sorry.
Thanks for the reply!
i have already used the skyboxes in the media but they were looking a bit artificial. so i thought of dynamic environment!
bitplane wrote:Making a realistic day/night cycle is pretty difficult. Thankfully Pazystamo already did most of the hard work-

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=10769
Thanks for the help!
this was what i was looking for! :)
Nobody is perfect!!
nd i am nobody!!
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Image
Post Reply