Author Topic: [VL] Error assigning 3D texture to 2D texture property '_MainTex'  (Read 67 times)

Nikita

  • Guest
Hello,
Adding a Volumetric Light object to the scene causes persistent errors:
Code
Error assigning 3D texture to 2D texture property '_MainTex': Dimensions must match
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Also when I added VL to the prefab and moved it to the scene, this error appeared, and the prefab removed the link.

Unity 2020.2.2f1 Build-In

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6851
    • View Profile
Re: [VL] Error assigning 3D texture to 2D texture property '_MainTex'
« Reply #1 on: April 03, 2021, 01:25:54 PM »
Hi,

That message usually occurs only in Unity Editor when the inspector tries to preview a material that uses a different type of texture (usually it expects a 2D texture for _MainTex but Volumetric Lights uses a 3D texture).
The message is completely harmless.

In the case of Volumetric Lights, I've tried to reproduce that message using Unity 2020.3 (the LTS version) and it doesn't show up.

Tests I followed:

- Empty project
- Imported Volumetric Lights
- Created a point light
- Added Volumetric Light to the point light (works and no messages in console)

- Same scene
- Added a Volumetric Spot Light (from right click -> Lights menu in the hierarchy)
- Added a Volumetric Area Light
- Added Volumetric Light to the Directional Light

In all cases the lights showed up correctly without that message in console.

I guess it's a temporary issue or related to Unity 2020.2.
In any case, it's not an error of the asset - just an inspector generated message that doesn't affect the rendering nor performance.

WuceBayne

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: [VL] Error assigning 3D texture to 2D texture property '_MainTex'
« Reply #2 on: April 04, 2021, 12:30:19 AM »
Hi,

I was able to reproduce this bug in an empty project with Unity 2020.3.1f1 (LTS) / Built-in Pipeline / Gamma/Linear rendering.

1. Create an empty scene.
2. Add any 3D object (a plane, for example).
3. Add any type of light, then attach the Volumetric Light component to it.
4. In the scene, select the 3D object created in step 2, and the following error message will show up in the console:

Code
Error assigning 3D texture to 2D texture property '_MainTex': Dimensions must match
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

If you select the 3D object in the hierarchy instead, the error message won't show up. As soon as you disable the Volumetric Light component attached to the light, the error message won't show up.

Note: I just realized that the same issue actually happens in your demo scene as well.

This bug is definitely not a blocker, but it can be pretty annoying to have your console being spammed by those error messages.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6851
    • View Profile
Re: [VL] Error assigning 3D texture to 2D texture property '_MainTex'
« Reply #3 on: April 05, 2021, 09:15:32 AM »
Thanks for the additional info. It's an Unity Editor bug for which we added a workaround to latest version (3.6.5). Please update.
Regards