**Updated January 2011 due to changes in UDK and for greater clarity**
This tutorial assumes you have a basic understanding of the UDK, such as accessing the Content Browser, and very basic knowledge of the material editor. If you don't, see the Documentation forum, and watch the stickied tutorials.
In this tutorial I will refer to RenderToTexture as (RTT) and a SceneCaptureReflectActor (SCRA). See UDN documentation for further info: http://udn.epicgames.com/Three/RenderToTexture.html
1. Open the content browser and create a RTT by simply right clicking empty space in the content browser and choosing New TextureRenderTarget2d (you may have to scroll down to see the option). Choose an appropriate texture size, for reference a 512 will be a bit blurry, 1024 quite nice, and a 2048 will be very clean, but obviously the higher the resolution, the more resources it takes.
2. Next, within the content browser, find the tabs across the top and click the one that says Actor Classes. The SCRA can be found under Uncategorized -> SceneCaptureReflectActor. Highlight SCRA and rightclick somewhere in your map and choose Add SCRA Here. Initially, just put it somewhere central, roughly in line with the floor.
3. With the SCRA selected, open its properties (hit F4), under the SceneCaptureActor heading, go to Scene Capture -> Capture -> Texture Target. Point Texture Target to the RTT you made in step 1 (have your RTT selected in the Content Browser, then click the green arrow). You can play with the other settings, but I largely leave them default, except that I have View Mode as SceneCapViewLit and I cap the FPS much, much lower than the 1000 default (note that 0 means it won't update and behaves like a cubemap).
4. Once all that is setup, create a material and set it up as follows. For clarity, all Masks have R,G, check marked, and the ScreenPos has Screen Align checked:
[shot]http://img192.imageshack.us/img192/6752/capture3cw.png[/shot]
5. As for the distortion, since RTT is using R,G, to feed us 2d vector information (read the UDN article above to understand this better) and our Normal Map uses R,G,B, to feed us 3d information, it's a perfect candidate for some fake distortion that matches our underlying texture, once we take out the B with a Mask so it only feeds us R,G, values. This is shown in the material setup above.
Obviously, you don't need to do Specularity like I've shown, that's just my material, and you could remove the distortion setup and get a clean reflection that looks rather glassy. You can also play with the distortion, especially the multiplier, and get a nice snow/ice material. Here's my result, the reflection is completely dynamic, you can look down and see yourself, push the barrels around and see their reflection rolling, and even see projectiles reflected as they shoot across the surface:
[shot]http://img17.imageshack.us/img17/1305/screenshot00042.png[/shot]
This tutorial assumes you have a basic understanding of the UDK, such as accessing the Content Browser, and very basic knowledge of the material editor. If you don't, see the Documentation forum, and watch the stickied tutorials.
In this tutorial I will refer to RenderToTexture as (RTT) and a SceneCaptureReflectActor (SCRA). See UDN documentation for further info: http://udn.epicgames.com/Three/RenderToTexture.html
1. Open the content browser and create a RTT by simply right clicking empty space in the content browser and choosing New TextureRenderTarget2d (you may have to scroll down to see the option). Choose an appropriate texture size, for reference a 512 will be a bit blurry, 1024 quite nice, and a 2048 will be very clean, but obviously the higher the resolution, the more resources it takes.
2. Next, within the content browser, find the tabs across the top and click the one that says Actor Classes. The SCRA can be found under Uncategorized -> SceneCaptureReflectActor. Highlight SCRA and rightclick somewhere in your map and choose Add SCRA Here. Initially, just put it somewhere central, roughly in line with the floor.
3. With the SCRA selected, open its properties (hit F4), under the SceneCaptureActor heading, go to Scene Capture -> Capture -> Texture Target. Point Texture Target to the RTT you made in step 1 (have your RTT selected in the Content Browser, then click the green arrow). You can play with the other settings, but I largely leave them default, except that I have View Mode as SceneCapViewLit and I cap the FPS much, much lower than the 1000 default (note that 0 means it won't update and behaves like a cubemap).
4. Once all that is setup, create a material and set it up as follows. For clarity, all Masks have R,G, check marked, and the ScreenPos has Screen Align checked:
[shot]http://img192.imageshack.us/img192/6752/capture3cw.png[/shot]
5. As for the distortion, since RTT is using R,G, to feed us 2d vector information (read the UDN article above to understand this better) and our Normal Map uses R,G,B, to feed us 3d information, it's a perfect candidate for some fake distortion that matches our underlying texture, once we take out the B with a Mask so it only feeds us R,G, values. This is shown in the material setup above.
Obviously, you don't need to do Specularity like I've shown, that's just my material, and you could remove the distortion setup and get a clean reflection that looks rather glassy. You can also play with the distortion, especially the multiplier, and get a nice snow/ice material. Here's my result, the reflection is completely dynamic, you can look down and see yourself, push the barrels around and see their reflection rolling, and even see projectiles reflected as they shoot across the surface:
[shot]http://img17.imageshack.us/img17/1305/screenshot00042.png[/shot]
Comment