A few explanations :
What follows is supposed to be the next step of another series of tutorials in progress for Blender (available here ), the textures and materials will so be often realized with the procedural method using Cycles shaders. The final purpose would be of course to import all the assets into Godot.
Except for the background, we will need different maps to integrate colours for each object into Godot. The importation of the Cycles shaders to the engine is not supported for now (maybe planned for future versions, see Roadmap changes here) but it is possible to get around this. I explain: If Blender does not export Cycles materials to Godot, Godot will do the needed manipulations to translate. But for it to work, we must in first bake the maps one by one into Blender, and this will be the obtained images (diffuse map, normal map, etc.) which will be imported into Godot as textures.
We could think that in fact, all this could be useless as we will load images and not shaders into Godot. If of course our purpose is still to favour the use of shaders into our project.
Yes… But no. Indeed an option into Godot allow the transformation of Spatial Materials (the images) to Shader Materials in just one click ! I’ll talk about this later. From the first tests made and having saved both versions of the materials, they are apprearing identical on screen. The bonus is that the one or the other are still editable inside Godot, so, with a bit of practice and by knowing how manipulate the numerous options, it is reasonable to think that we could perfectly reproduce the renderings of the Cycles shaders, furthermore, and from what I have seen when I quickly browsed a first time the edition parameters, effects such as glare or blur appears also perfectly reproducible into the resource options.
Now that we are done about the general explanation, let’s see more precisely the method I used and for a first part:
Make a HDRI (High Dynamic Range Image) into Blender as background.
To create a HDRI into Blender, I followed the method described by gandalf3 on Blender Stack Exchange :
Create HDR map from render?
Note that It is said :
Important Note: Make sure the 3D views are set as perspective into Blender while making the needed rendering if procedural materials used. If not , it won’t properly display the background, and so the result file would not work.If you select Cycles as the default renderer, and save as an EXR, your saved file will already be high dynamic range.
Into this part of the other tutorial, I was describing a method to create a nebula wirh Cycles materials. This is one of the obtained environments I will use here as work base for the following chapter.
Set a Panorama Sky into Godot
Open Godot and create a new project (or edit the one you are currently working on)
- 1. Add a WoldEnvironment node
- 2. Into the Inspector, create a New Environment.
- 3. Select Edit
- 4. Go to Background → Mode, then select Sky
- 5. Into Sky, select : New PanoramaSky
- 6. Select Edit
- 7. Drag and drop the *.exr file previously created (we have of course moved this file into the work space of the project) to the field noted as <null>
- 8. In my case, the rendering appeared too much bright, if you experienced the same thing, you can easily modify the contrast and brightness parameters :
Go back into the resource edition panel → Adjustement→ Activate, and modify the needed parameters, the changes will be displayed in real-time into the viewport.
Note: For a detailed list of the available options see Environment and Post-Processing into the Godot Documentation. Don’t forget to save both resource and scene after each modification.