Basic tutorial to illuminate a model in irrlicht using irredit

A forum to store posts deemed exceptionally wise and useful
Post Reply
Noiecity
Posts: 92
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Basic tutorial to illuminate a model in irrlicht using irredit

Post by Noiecity »

In this basic tutorial you will get an idea of how irrlicht lighting works and how to use it in the irredit scenario editor, although it does not cover all its settings and possibilities, it is a basic tutorial.

Download irredit 1.5: https://www.ambiera.at/downloads/irrEdit-1.5.zip

The asset used in this tutorial can be found free for commercial use here:
viewtopic.php?t=52987


Well, let's begin.

Unzip irrEdit-1.5.zip, once we have unzipped irrEdit-1.5.zip we open irrEdit.exe that is inside the irrEdit-1.5 folder.

Image

Image

Remove the "testCube"

Image

Image

Import our 3d model

Image

Image

Image

Import our texture

Image

Image

Select the texture in the "Textures" box, the selected texture will be marked with yellow

Image

Select the 3d model in the scene and go to "Materials" and click on the letter "s" so that the selected texture is loaded in the model.

Image

Image

Image

In the section below we enable the "Lighting" checkbox.

Image

Image

Now the model will be dark in the absence of a light source, so let's add a light.

Image

Image

Select the light and set position conveniently

Image

Increase the size of the model by selecting it and modifying the "Scale" value.

Image

Image

Select the light and set position conveniently, again

Image

Image

By default the model will be loaded with filters, that reduce pixelization (and also slightly increase FPS), we can deactivate it if we do not like the effect.

Image

Image

We can add ambient light to the scene from the "Atributes" parameters by selecting "root", this will make all objects in the scene contain some lighting, but no shadows, I will leave it in a dark blue to simulate the night.

Image

Image

We can see how lighting is affected inside and outside the house.

Image

Image

Image

We can change the color of the illumination produced by "Light" from the object attributes, for example, to simulate the color of a torch we can use red.

Image

We save the scene and then load it into our irrlicht project.

Image

Image

Make sure to configure the paths of our assets manually if necessary, this is done by modifying the .irr file with any text editor.

Image

And that's all for now, as this is a basic tutorial it will only cover the basics.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free and in an anonymous way if necessary. You can send me a private message.

https://www.artstation.com/noiecty
**
thenewkgb
Posts: 53
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by thenewkgb »

Ahh. Noie!

Look in IrrEdit, Tools, Options, Working Directory.

I do thank you for showing me where IrrEdit could be downloaded. I felt CopperCube was heading in a different direction.

Many thanks.
Noiecity
Posts: 92
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by Noiecity »

:mrgreen:
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free and in an anonymous way if necessary. You can send me a private message.

https://www.artstation.com/noiecty
**
thenewkgb
Posts: 53
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by thenewkgb »

I found this works...

Code: Select all

IrrlichtSVN
 |
 |_ IrrApps __ 2022 solution file
 |_ bin     __ here are the exes
    |__ media __ here are your textures and models
          |__ scene __  here's your .irr scene file
 
Then set IrrEdit working directory to "\IrrlichtSVN\bin\"
And in 2022 set Properties->Debugging->Working Dir to "\Irrlicht\bin"
(then load the textures in IrrEdit to "media/irrlicht2_lf.jpg" for skybox)

Thanks to CuteAlien and Noie.
You can just play around until you fix paths.
Have a good day.
Noiecity
Posts: 92
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by Noiecity »

thenewkgb wrote: Tue Mar 12, 2024 4:56 pm I found this works...

Code: Select all

IrrlichtSVN
 |
 |_ IrrApps __ 2022 solution file
 |_ bin     __ here are the exes
    |__ media __ here are your textures and models
          |__ scene __  here's your .irr scene file
 
Then set IrrEdit working directory to "\IrrlichtSVN\bin\"
And in 2022 set Properties->Debugging->Working Dir to "\Irrlicht\bin"
(then load the textures in IrrEdit to "media/irrlicht2_lf.jpg" for skybox)

Thanks to CuteAlien and Noie.
You can just play around until you fix paths.
Have a good day.
Thanks for the information.
I still do not know if it is possible to activate addShadowVolumeSceneNode() to the nodes that you load from the scene .irr, so for the moment I use irredit to give me an idea of where to put the objects and lights

I love irlicht damn it.

By the way, the light obtains a higher quality if the attenuation value increases from 0.01 to 0.1, although the distance is lower, something like this:

Code: Select all

	ISceneManager* smgr = device->getSceneManager();	
	ILightSceneNode* light = smgr->addLightSceneNode(0, vector3df(0, 10, -5), SColorf(1.0f, 1.0f, 1.0f, 1.0f), 60.0f);
	video::SLight lightData = light->getLightData();
	lightData.Attenuation = core::vector3df(0.0f, 0.1f, 0.0f);
	light->setLightData(lightData);
And if you add many sources in the same light in the same position, you get a fairly realistic lighting with good shadows, although when activating addShadowVolumeSceneNode() to a 3d model performance is quite reduced, but it is worth it :mrgreen: :mrgreen:

I made this fast example, although with 3 light source:

Image
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free and in an anonymous way if necessary. You can send me a private message.

https://www.artstation.com/noiecty
**
thenewkgb
Posts: 53
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by thenewkgb »

You add lights in code to get the shadow volume then?

I did wonder if you saw how to load classes into IrrEdit? It would be interesting if we/I/you could code a class/object in code then also could load the class into IrrEdit. For example, code a target that makes a noise when an arrow hits it - but with the advantage of being able to place the target in IrrEdit (all coded).

Maybe IrrEdit doesn't have all those features. It's a world builder, no more.

Maybe it's only for .Irr files with no custom stuff. Just nodes with x,y,z,colour,texture. If you did want to purchase the source code, I think I saw it going for 1900€.
Noiecity
Posts: 92
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Basic tutorial to illuminate a model in irrlicht using irredit

Post by Noiecity »

The example in the GIF is all loaded from code, without .irr, still use irredit to guide me visually where the objects will go, then transfer it to code manually, It also helps me to orient myself to functionalities that I didn't know about Irricht

If I noticed that he sold the Irredit source code, it is quite generous, it is Niko, so it is fine, although it is sad that I no longer see it in the forum
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free and in an anonymous way if necessary. You can send me a private message.

https://www.artstation.com/noiecty
**
Post Reply