Page 1 of 1

How to obtain metallic material with bake textures and reflection_2layer in irrlicht

Posted: Fri Jul 05, 2024 9:34 am
by Noiecity
The result(irrEdit):

Image

Irredit 1.5: https://www.ambiera.at/downloads/irrEdit-1.5.zip
Blender 2.79: https://download.blender.org/release/Blender2.79/
RobotHead_1_1_tutorial.zip: https://www.mediafire.com/file/4vwvt7ci ... l.zip/file

All the content of "RobotHead_1_1_tutorial.zip" is under CC0 license, that is, download and use as you want, without restrictions, as if it were your own.

We open blender, delete the cube and import the object.

Image

Image
Image
Image
Image



We arrange the interface to taste and render if desired.

Image
Image


We go to the UV editor and create a new image.

Image
Image
Image



With the object selected, go to edit mode by pressing TAB, select all its vertices by pressing A, then select the created image in the UV editor.

Image


With all vertices selected and in edit mode of our 3d model, press U and select smart UV (this will produce UV coordinates for the textures).


Image


We leave the Angle Limit at 35 so that it does not create overlapping UV coordinates. We leave the Island Margin at 0.06 so that there is enough distance between our seams, this will allow later that when reducing our textures in low resolution it will show us correctly the edges of the UV coordinates. Click OK.

Image
Image


Configure the image output, make sure it is at 32px margin (to add texture), this will help us later if we want to lower the resolution to the textures and keep clean edges in our UV coordinates. We hit bake to test.

Image
Image


Add illumination and test again.


Image
Image
Image
Image



We can see the result of our texture in real time, although in a lower quality than irrlicht. For this we select Texture in the Viewpot Shading. Press N to open the additional options on the right, look for Shading and activate Shadeless, with this we will see the textures without the need of illumination.

Image
Image


We will prepare to export our 3d model, go to the materials tab and make sure it is completely white, with the intensity in 1.0, so when we import it in irlicht it will be seen with the diffuse in 255, that is to say, maximum clarity.

Image
Image


We save the image and export the model, we make sure we have selected our model before exporting, then in the export options we enable the "Selection Only" checkbox, so that it only exports the model without the camera or other unselected objects.


Image
Image
Image
Image
Image


Now we will load the metal textures in our model. With the model selected, we go to the Textures tab, and from here we go to the Material icon. Create a new texture and load the image.

Image
Image
Image


In Mapping we select Object and at the bottom we select our object, which is called "Plane".

Image
Image


Above in Image Sampling we disabled the use of Alpha, and also MIP Map. In Interpolation, in Filter we choose Box and enable the "Minimum Tilter Size" checkbox.


Image


In Image Mapping in the Repeat options we choose to try with 4. This makes the size of the textures as far as projection on the object is concerned, to be reduced, so that it procedurally repeats up to 4 times on it.

Image


We try to render and then enable the Color checkbox, in Specular, within the influence options in the material color texture.

Image
Image


We rename the texture and add a new one, this time for the Specular. We load our image(Roughness), and in Color Space we choose Non-Color, which is the algorithm with which Blender works this kind of textures.


Image
Image


The other values are the same as in the Diffuse texture.


Image


Uncheck the Influence Color checkbox in Diffuse. Here, in Specular, we enable Intensity and Hardness with values at -1, which would be the correct way to work the roughness texture inside Specular.

Image


Now we do almost the same with the normalmap, we load the texture normalmapEdited_OpenGL.png, we choose as Color Space the Non-Color. We disable the use of alpha and enable Normal Map, choose Tangent.

The rest is the same except for the checkboxes enabled in influence, we only enable Normal and leave it at 1.


Image
Image



We will try to render with a Point light to verify the normalmap, so we will delete the Herni light, the bake usually differs many times from the render, but the Render helps us to understand if the normalmap is working correctly.

In the options of the light we enable Ray Shadow, with 4 samples (the more, the better the result of the shadows), and in soft Size we leave it in 0.3, so that it is a little softened in the edges. The rest we leave it as it is.


Image
Image
Image



Once we have observed and understood our current render, we will advance by enabling the Mirror checkbox from the materials tab. We will try for now with 0.2 reflectivity, with a Depth of 24, the more Depth improves the quality of the reflections, especially reflections on itself. We leave it at 24 since it is enough.

Image



In the material textures, we choose the Diffuse texture and enable the Mirror Influence, this will affect the color of the reflection. Then we try to render.

Image
Image



From the World tab, enable Environment Lighting, and choose Sky Texture here. Further down in Gather, we make sure to use Approximate and set in Sampling the Passes to 10 for a good result, in Error 10.000 to make it fast, and for the moment we do not touch Correction.

Image



In the textures tab in the world sub-tab, we add our HDRI image, in this case in .jpg format.
We make sure that in Mapping we are working with Equirectangular coordinates. Further down in Influence we disable the Blend checkbox and activate Horizon.


Image
Image
Image
Image
Image
Image



We try to render to test, then we bake. Our bake will differ from what we are looking for, so we will delete the light point and increase the reflectivity to 0.726, I will also increase the Depth to 124 (although there is practically no difference with 24).

Also, to reduce the noise I have tried several ways and the one that gave me the best result in terms of quality and speed was to leave Error of the Gather options in World at 0.25, and with a correction of 1.0.


Finally I reduced the number of repetitions to 2 for all images that were linked to the model material. I saved the image, and to satisfy my curiosity, I tried using the Herni light, without Environment Lighting, but with the reflections of it, the result was somewhat clear so I ignored it, closed Blender and tested the model in IrrEdit.


Remember in irrlicht(and irrEdit) to normalize normals to get correct results in reflections and lighting.



Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image


:mrgreen: :mrgreen:

Image