Download

Using a capture cube?

Hello, all! I’m new to Unreal Engine 4 and I’ve watched loads of tutorials already, so I know my way around.
Right now I want to create a realtime cubemap which shows up on a reflective material. I’ve found that the ‘scene capture cube’ actor is the way to go.
The thing is, it is not expained on the docs or in a tutorial how to set it up… After a quick search on this forum I’m still not getting any further.

So, could anyone explain to me how a capture cube is assigned to a material?

Thanks!

Hey there,

I have not actually used these yet, but there is an example of how to use them in the Content Examples downloadable project in the Learn tab of the UE4 Launcher.

Here is a short description on using these, but see the actual example for a demonstration. Be warned though, these are very expensive performance wise, if possible use a SceneCapture2d, they take up 1/6th of the performance compared to a SceneCaptureCube, with the standard ReflectionSphere being the least intensive (but lower quality).

Hope that helps!

Create a scene capture cube actor in the level wherever you want to capture the reflections from.
Create a Cube Render Target in Content Browser.
Plug that cube render target in the texture target slot of your scene capture cube actor.
Now you can use that cube render target in your material. And it is expensive if you want it to capture the level in real time, but you can make it a static cubemap to help with performance if you right click on cube render target > Create Static Texture then use that texture in the material.

@Jacky:
That’s exactly what I’ve done already, actually! The part where I get stuck, is when assigning the cubemap to the material I want to use it on.
When I just drag and drop the cubematerial into my material (and assign it to the specular input?) it gives this (logical) error:

[SM5] (Node TextureSample) Coercion failed: Parameters.TexCoords[0].xy: float2 -> float3

Yeah, you cant use it for specular like that with the current shading system. Specular accepts scalar value and you dont even need specular input unless you are working with translucent material really. So you need to use it in base color, or emissive depending on your usage.

No worries! I found it on someone’s tutorial here:

http://www.caferaces.com/p/car-paint-part-4.html