How to add fake reflections in irrEdit and irrlicht

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

How to add fake reflections in irrEdit and irrlicht

Post by Noiecity »

In this tutorial you will learn the basics of adding fake reflections using a HDRI (High dynamic range imaging) image in jpg format(320 kb).

This tutorial will try to introduce you to the basic features of irrEdit.

Edit from the future: important note, you need to have normalize normals(or normalize normals in the code) activated for the effect to affect the model correctly, this is also necessary for a correct lighting. You can also increase the brightness of the texture of the model by 10%, and increase the contrast and reduce the brightness of the hdri used, this can be done with gimp, once you understand this you will get good results.


Translated with DeepL.com (free version)

You can download irrlicht here: https://www.ambiera.at/downloads/irrEdit-1.5.zip

You can find all the content of the asset Golem1Example.rar for commercial use here:
viewtopic.php?p=307549

Personally I use irrEdit to have a real time look at the values I modify, scenes created in irrEdit(.irr) can be loaded from irrlicht(example 15 from irrlicht documentation), although it does not have the feature to include addShadowVolumeSceneNode() (or so I think). Also you can't modify the opacity of many functions that inside irrlicht you can, but not inside the editor.

Even so, irrEdit is a tool that makes things easier when it comes to setting up our scenario in code.

Well, let's start the dissertation.

Once we have unzipped irrEdit and Golem1Example.rar, we can begin to use them.

Image

Image

Delete the cube testCube by selecting it, make sure it is correctly selected by viewing the properties.

Image :mrgreen: :mrgreen:

Image

Image

We import our Golem1.x animated model, I will use the one in the TexturesRed folder.

Image

Image

Once loaded we change its position for convenience, I will leave it at 0,0,0. I will also change the FramesPerSecond to 0.1

Image

Image

Image

Image

Image

We go to Materials and change from solid to reflection2layer. As its name indicates, the second texture in the material will be the reflection.

Image

Image

Image

Image

Add the texture "christmas_photo_studio_01_4k.jpg" from the TexturesRed folder to the scene.

Image

Image

Once added, it will be selected immediately, you can select by clicking on the image and the selected image will be highlighted in yellow.

Image

Once selected we add it to the second available slot of the 1/7 material.

Image

Image

We do the same with materials 1,3,4,6 and 7.

Image

Image


We can disable the Bilinear filters if we don't like the effect, these filters help to reduce the pixelization of the images and offer better performance in comparison than without them.

Image

Image

Ready, we now have our animated character with textures with reflections.


Image

We can visualize our models with lighting by activating "Lighting" in the properties of each material, activate them for 1,3,4,6 and 7.

Image

Image

Once this is done our model will become dark with no light sources, so let's add light.

Image

We configure the attributes of the light we add and position it at our convenience.

Image

Image

Image

Image

Image

Ok, now let's reduce the Shininess values of materials 1,3,4,6 and 7, as well as their color from the Specular values.

Image

Image

Image

Image

Image

Image

Image

We can reduce the attenuation to create a smaller light source but with a resolution uniform to its size, although it would require us to clone the light source to better illuminate the area.

Image

Image

Image

Image

We can make an animation on the lighting rotating on a radius, from the options offered in Animators, make sure to first position the light at the center of the circumference you want it to rotate. Once done you can modify the values as you like.

Image

You can add some ambient light to the light so that it gradually illuminates whatever is within its radius.

Image

Image

Image


Inside the file Golem1Example.rar you can find the c++ code of this tutorial implemented in irrlicht 1.8.5. Also an executable that changes animation when holding left click :mrgreen: :mrgreen: :

Image
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Post Reply