0
$\begingroup$

I know this was asked in an earlier post, but I figured I'd follow-up on that with greater explanation.

Essentially, I'd like to apply a reflective cubemap to an object material (through Eevee) in a similar manner to how other real-time rendering engines do it. I am aware that I could use an HDRI/environment texture, but I'd like to use different reflection maps on different materials in order to achieve certain effects.

A picture of a cubemap

I've yet to find a solution, but I found some leads (maybe):

  • This site and this post. I haven't been able to make either work using nodes, however.
  • The Reflection output in the texture coordinate node.
  • The Box projection mode in the image texture node.

I'd like to obtain a result similar to this (obtained using Cycles):

Cycles render of Suzanne with a metallic reflection

Any assistance is appreciated!

$\endgroup$

1 Answer 1

1
$\begingroup$

Do you really have to use an actual cube map with separated top/bottom/front/back/left/right photos stacked around like what you showed there?

cube map

Because making such cube maps usable in Blender is AFAIK impossible to do without OSL (which, I don't know how, and isn't compatible with GPU rendering anyway). So the other way around is to convert your cube map into an equirectangular map.

If you don't care about using that specific format, you can indeed load equirectangular or mirror ball formatted pictures into an Environment Map node mapped with the Reflection output of the Texture Coordinates node.

Using equirectangular/mirror ball maps:

demo GIF

equirectangular setup

Converting a Cube map into an Equirectangular

First create a cube. In the UV Editing workspace, edit the Cube's UVs so that it fits your cubemap.

A simple way to do it is by selecting all your mesh, pressing U → Mark Seam → U → Unwrap. It will make all your UV's faces independant and same size. But because your cubemap is twice larger than high, so are your UVs. To fix it: select all UVs → S0.75⏎ Enter.

Then you can select each face and place it where it belongs on the map. Feel free to enable snappings and Pixel coordinates to make things easier for you.

demo UVs

Then, add a Subdivision modifier level 4, followed by a Cast modifier with its Factor and Radius to 1.
RMB RMB the object in object mode and set it to shade smooth.
In the shader editor, make sure the texture is plugged into an Emission shader instead of the default principled shader. This will make sure we convert the map without any color change.

result dummy cube

Then, place a camera at the center of the dummy cube, and make it face any side of the cube map to make sure the maps are somewhat aligned (I used the front one here).
In the Properties Editor → Camera tab → Lens panel, set the Type to Panoramic, and Panorama Type to Equirectangular.
In the Output tab, chose a resolution where X is twice Y. I set 1024 x 512.

camera setup

Then you can simply render, which should give this result:

render result

Save this map anywhere, and use it like a regular equirectangular map:

final demo

Bonus link:

Cube map Converter in Blender

Read the description, it basically renders whatever you have in the scene into a cube map. If you need for example to turn an equirectangular map, just set it up in your world's shader using an environment map and hide the default sphere object.

$\endgroup$
1
  • $\begingroup$ Thank you for the detailed response! I couldn't find a definite answer as to whether it was possible or not, so to get a clear-cut response as well as alternatives is a huge help. $\endgroup$
    – Trasche
    Commented Aug 12, 2022 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .