Planar reflection clipplane bug on Metal

It seems that Clip plane is not working on Metal. Both Mac and iOS is affected. Planar reflections incorrectly reflect objects that are wrong side of plane. I made simple test case project that clearly show how reflections are broken.

In screenshot there are multiple cones that reflect from underwater. When player look down first person weapon also behave incorrectly.

https://dl.dropboxusercontent.com/u/10960490/ClipPlaneBug.zip

Hey Gore,

You actually are not using the full feature, as I did not see a Planar Reflection Actor placed within the scene. Try moving the floor down a little bit, and your reflections should render correctly. The placement of this plane as well as your floor is important, as it indicates where the objects contact the ground and create the reflections. The further up you move it, the more it will appear to clip the reflections of objects.

I downloaded and tested your project, and below are the results I deleted the floor mesh and placed a Planar Reflections actor in the appropriate location.

Planar Reflections Actor

Let me know if you have further questions or need additional assistance.

Cheers,

There is Planar Reflection Component within transparent Static mesh Actor that is just simple placeholder for water material. Same exact scene work fine on Windows.
This is how project look on windows.

Clip plane works correctly and cones are perfectly planar reflected to transparent mesh.

Unfortunately Planar Reflections are known to be broken on Metal in 4.12. They have been fixed upstream for OS X 10.11 (as always beta OSes are unsupported) and these changes will be part of binary 4.13. However if you are willing to work from source to modify MetalUtils.cpp and Common.usf they should work in 4.12:

Common.usf:
Change:

#define PLATFORM_SUPPORTS_GLOBAL_CLIP_PLANE (PS4_PROFILE || SM5_PROFILE || SM4_PROFILE) 

To:

#define PLATFORM_SUPPORTS_GLOBAL_CLIP_PLANE (PS4_PROFILE || SM5_PROFILE || SM4_PROFILE || METAL_PROFILE || METAL_MRT_PROFILE || METAL_SM4_PROFILE || METAL_SM5_PROFILE)

MetalUtils.cpp:
Change:

/** Vertex shader system values. */
	static FSystemValue VertexSystemValueTable[] =
	{
		{"SV_VertexID", glsl_type::uint_type, "IN_VertexID", ir_var_in, "[[ vertex_id ]]"},
		{"SV_InstanceID", glsl_type::uint_type, "IN_InstanceID", ir_var_in, "[[ instance_id ]]"},
		{"SV_Position", glsl_type::vec4_type, "Position", ir_var_out, "[[ position ]]"},
		{"SV_RenderTargetArrayIndex", glsl_type::uint_type, "OUT_Layer", ir_var_out, "[[ render_target_array_index ]]"},
		{"SV_ClipDistance0", glsl_type::float_type, "ClipDistance0", ir_var_out, "[[ clip_distance ]]"},
		//#todo-rco: Values 1..7 are not really defined well in the Metal Language Doc...
		//{"SV_ClipDistance1", glsl_type::float_type, "ClipDistance1", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance2", glsl_type::float_type, "ClipDistance2", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance3", glsl_type::float_type, "ClipDistance3", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance4", glsl_type::float_type, "ClipDistance4", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance5", glsl_type::float_type, "ClipDistance5", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance6", glsl_type::float_type, "ClipDistance6", ir_var_out, "[[ clip_distance ]]"},
		//{"SV_ClipDistance7", glsl_type::float_type, "ClipDistance7", ir_var_out, "[[ clip_distance ]]"},
		{NULL, NULL, NULL, ir_var_auto, nullptr}
	};

To:

/** Vertex shader system values. */
static FSystemValue VertexSystemValueTable[] =
{
	{"SV_VertexID", glsl_type::uint_type, "IN_VertexID", ir_var_in, "[[ vertex_id ]]"},
	{"SV_InstanceID", glsl_type::uint_type, "IN_InstanceID", ir_var_in, "[[ instance_id ]]"},
	{"SV_Position", glsl_type::vec4_type, "Position", ir_var_out, "[[ position ]]"},
	{"SV_RenderTargetArrayIndex", glsl_type::uint_type, "OUT_Layer", ir_var_out, "[[ render_target_array_index ]]"},
{"SV_ClipDistance", glsl_type::float_type, "ClipDistance0", ir_var_out, "[[ clip_distance ]]"},
{"SV_ClipDistance0", glsl_type::float_type, "ClipDistance0", ir_var_out, "[[ clip_distance ]]"},
	//#todo-rco: Values 1..7 are not really defined well in the Metal Language Doc...
	//#todo-marksatt: Perhaps not, but this is a semantic marker not a 'slot' so I think we can just use 0-8.
{"SV_ClipDistance1", glsl_type::float_type, "ClipDistance1", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance2", glsl_type::float_type, "ClipDistance2", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance3", glsl_type::float_type, "ClipDistance3", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance4", glsl_type::float_type, "ClipDistance4", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance5", glsl_type::float_type, "ClipDistance5", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance6", glsl_type::float_type, "ClipDistance6", ir_var_out, "[[ clip_distance ]]"},
	{"SV_ClipDistance7", glsl_type::float_type, "ClipDistance7", ir_var_out, "[[ clip_distance ]]"},
	{NULL, NULL, NULL, ir_var_auto, nullptr}
};

Then rebuild ShaderCompileWorker & UE4 from Xcode.

Awesome, can we get this fixed for OpenGL as well?