title: How can i render the PMREM environment map when copying MeshStandardMaterial into a ShaderMaterial
body: <p>I am trying to build the <code>MeshStandardMaterial</code> by using a <code>ShaderMaterial</code>. I'm keeping most of the <code>#include &lt;logic&gt;</code> statements, which makes it slightly difficult to put breakpoints. </p>
  
  <p>I'd like to know if there is a straightforward way to render the PMREM cubemap, in this particular material template and have it show up the way it's supposed to.</p>
  
  <p>I'm roughly using:</p>
  
  <pre><code>material.defines.USE_ENVMAP = ''
  material.defines.ENVMAP_MODE_REFLECTION = ''
  material.defines.ENVMAP_TYPE_CUBE_UV = ''
  material.defines.ENVMAP_BLENDING_MULTIPLY = ''
  material.defines.TEXTURE_LOD_EXT = ''
  material.defines.USE_UV = ''
  material.extensions.derivatives = true
  material.extensions.shaderTextureLOD = true
  </code></pre>
  
  <p>Which,as far as i can tell, are all of the defines that appear when adding a texture to <code>material.envmap</code>. The shader compiles, the PMREM texture is being generated, and can be read in the shader (<code>gl_FragColor = vec4( texture2D( envmap, vUv ).xyz, 1.)</code> works for example). These are the uniforms i cloned:</p>
  
  <pre><code>{
      envmap: UniformsUtils.clone(UniformsLib.envmap),
      fog: UniformsUtils.clone(UniformsLib.fog),
      lights: UniformsUtils.clone(UniformsLib.lights),
      displacementmap: UniformsUtils.clone(UniformsLib.displacementmap)
  }
  </code></pre>
  
  <p>The <code>maxMipmap</code> uniform seems to have a value of 0 when <code>MeshStandardMaterial</code> is used, i'm not sure what else is being used. </p>
  
  <p>I get absolutely no effect from placing a texture in <code>material.uniforms.envmap.value</code> and using these defines. If i turn off the light in the scene, my object renders as black, no reflections. </p>
  
  <p>This doesn't seem like it requires that many inputs but i get 0. out of it:</p>
  
  <pre><code>    radiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );
  </code></pre>