How to use tone mapping shader chunk with RawShaderMaterial?

Hello,
Since r139 CubeCamera render target has no tone mapping applied. I have a RawShaderMaterial that converts WebGLCubeRenderTarget to equirectangular texture but now the image looks almost white.
I would like to add in the RawShaderMaterial the tone mapping chunks. Which uniforms do I have to set? Is this the correct way to use the chunks in the fragment shader?

 #include <tonemapping_pars_fragment>

void main()  {
   ...
   gl_FragColor = textureCube( map, dir );
   #include <tonemapping_fragment>
}

This line should not be required. When configuring the renderer with tone mapping, the chunk gets automatically injected at the top of the fragment shader.

Hello Mugen,
looking at the source it seems the #include <tonemapping_pars_fragment> chunk is injected only for ShaderMaterial:

I changed my code to use ShaderMaterial and got tone mapping to work with #include <tonemapping_fragment>

Good catch! Well, can you stick with ShaderMaterial?

Yes, Thank you!

Great! Otherwise you would have to do some more manual work like managing the TONE_MAPPING define. Using ShaderMaterial seems to more straightforward solution.