I can't display a static mesh in the dark

I am unable to display a static mesh in the dark.

I want an object to be unaffected by no light so that it looks the same as if there were light. How can I do it?

You’ll need to adjust the material settings and rendering properties of the object. Here’s how you can achieve this:

1. Create an Unlit Material

First, create a material that is not affected by lighting.

  1. Create a New Material:
  • Right-click in the Content Browser and select Material.
  • Name your material, e.g., M_UnlitMaterial.
  1. Edit the Material:
  • Double-click the material to open the Material Editor.
  • In the Material Editor, change the Shading Model to Unlit in the Details panel.
  • Connect the Base Color input to a Constant3Vector or Texture Sample node, depending on whether you want a solid color or a texture.
  1. Save the Material.

2. Apply the Unlit Material to Your Mesh

  1. Select the Static Mesh in your scene.
  2. In the Details Panel, find the Materials section.
  3. Assign the Unlit Material (M_UnlitMaterial) to the mesh.

3. Adjust Rendering Properties (if needed)

If you need to ensure the object is always visible and not influenced by post-processing or any other rendering effects, you might need to adjust its rendering properties.

  1. Select the Static Mesh in the scene.
  2. In the Details Panel, find the Rendering section.
  3. Ensure Render CustomDepth Pass is checked if you are using custom rendering features.
  4. Optionally, you can set the Render in Main Pass to false if you want the object to only render in custom passes (this is more advanced and usually not needed for basic visibility adjustments).

Blueprint Solution for Dynamic Changes

If you need to toggle the lighting effect dynamically via Blueprints:

  1. Create a Blueprint Actor for your object.
  2. Add a Static Mesh Component to the Blueprint.
  3. Create a Dynamic Material Instance:
  • In the Blueprint’s Event Graph, use the Create Dynamic Material Instance node to create an instance of your unlit material.
  • Assign this dynamic material instance to the static mesh.

I hope this helps.