-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obscure warning "Attempting to use a shader that requires tangents with a mesh that doesn't contain tangents." is spammed. #84875
Comments
Referencing the mesh is difficult, as this happens in the rendering server. The way servers are designed is that they receive data and commands and act on them - they don't know where the data comes from and can't find back what scene-level node or resource triggered this. It's done this way for performance reasons, a two-way communication path between scene and servers would kill performance. But to be clear I fully agree that getting those warnings without any traceability if less than helpful. There might be ways to get some more info though, I'm not familiar with the details. CC @clayjohn It would not be a solution for end users, but from advanced users you could compile Godot with debug symbols, and then put a breakpoint where this warning is emitted, to get a stacktrace and see where the call orginated in scene space. |
Made a PR to assist with this. This particular error message is very tricky as it is deep within the rendering server. Plus meshes can come from many different sources. What I did in the PR is add in the ability to specify the shader source (if using a custom Shader only) and a mesh source (if using an ArrayMesh only). This should cover most situations where this error occurs. Additionally, as of Beta 5, newly imported and created meshes should almost always have tangent arrays. So this message should become increasingly rare |
This happens to me each time a gizmo (that serves as 3D transform handle in the editor, not sure about how they are called) appearance is updated, for example when they get displayed, hidden or hovered. Godot v4.2.beta6 - Windows 10.0.22621 - GLES3 (Compatibility) - Intel(R) Iris(R) Plus Graphics (Intel Corporation; 27.20.100.9621) - Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 Threads) |
And it is specific to the compatibility renderer. |
@Mohamed-Kr the issue of the compatibility renderer always triggering the error is a separate bug that has already been fixed by #84752. The fix will be in RC1 |
Hey I'm on RC2 and still get this error. Linux 64bit Godot 4.2 RC2 |
@dataCobra Did you run the mesh surface upgrade tool in Project > Tools > Upgrade Mesh Surfaces...? |
Hey @akien-mga, no I did not. I've created a completely new project and imported the glb file. This does not happen on version 4.1.3. Update: I tried using the tool without success. Problem is still there. |
@dataCobra Can you share the glb file here so we can take a look? Also, I'm sure you have already checked, but can you confirm that the error isn't accurate? I.e. that either your shader doesn't require tangents, or that the mesh does contain tangents? This is a new warning that was introduced to flag this problem for users. You can't rely on tangents with a mesh that doesn't have tangents. It will break your model in (sometimes) unexpected ways. |
Tomorrow I can upload the glb file to share it with you. I exported the 3D file to glb one time with tangens and once without. Both times I've got the warning. Since this is my first time trying 3D with Godot I'm not able to tell if I did something wrong when exporting to glb. If you could examine this and give me feedback this would be very nice. |
Hey, here is the link to my nextcloud with a zip which contains two glb files. https://cloud.netcobra.de/s/fMxbgwHHMMFTtQQ One with the export tangents option enabled and the other has it disabled. Please let me know when you downloaded the files so I can disable the link. |
Okay I don't know what has changed but the new exports I put into the zip file are not triggering the warning. 🙄 Here is the link to the old file which did trigger the warning message. https://cloud.netcobra.de/s/o2FJ6dCg8TAsdgC Please let me know when you downloaded the files so I can disable the link. |
Hi, I think I found the gltf export options which trigger the warnings for me. Under When I enable these when exporting a file from Blender the warning gets triggered. Enabling or disabling the export option Tangents does not trigger the warning. I hope this additional information will help you fix the problem if there is one. |
I took a look at the old file. It appears to be made of 4 surfaces and one of them is exported without tangents. So I think we have 2 issues here:
If we can resolve 2. the error spam will go away, but your assets might look a bit messed up as they won't necessarily have the same tangents that you have in Blender. But I guess that is the best we can do. |
Thank you for the time to explain the topic in this detail. 👍 So it seems to be a user made issue. More specific an issue in the way I exported the file. I don't even know exactly why I enables both loose options in the first place. 🤷♂️ |
I am also running into this issue, when trying to convert a 4.1 game over to 4.2. It is definitely a combination of meshes in the native .tres format paired with normal maps. Unfortunately, the upgrade tool doesn't get rid of the error spam, even though all assets look fine. I have done some tests and can re-export all of my offending meshes from Blender directly and reconvert to the new .tres mesh format. @clayjohn my main question is what is the recommended workflow now with mesh tangents? By default glb export from blender has the option off and obj doesn't even have the option. From some tests, it seems that 4.2 is fine with meshes that weren't exported with tangents. I have always left the "ensure tangents" option on in godot itself, so had assumed godot could create these itself....maybe this is no longer the case? It would be good to know what the recommended workflow is for 4.2 onward and if exporting with tangents from blender gives better quality normal mapping? |
@fracteed This warning doesn't have to do with the new mesh format. So the upgrade tool won't be enough to make the warning go away. We added the warning because using tangents in a shader with a mesh without tangents has become more dangerous than it was before, but it was still problematic before. The workflow from Blender hasn't changed. We generate tangents on import in more cases now than we used to, but generating tangents in your 3DCC is still much better to ensure your normal maps have a consistent look between Godot and your authoring tool. This warning is getting spammed because you are using normal mapping with assets that don't support tangents. In the case above, the warning came from line primitives that were erroneously exported with the mesh. To back up a bit, the warning appears when you have: If you are using normal mapping on a mesh without normals, it is most likely an oversight anyway. So, best case scenario you are wasting performance, worst case scenario, you are wasting performance and introducing performance overhead into your scene. As for workflow, your workflow shouldn't need to change. But the fact that you are getting this warning likely means that you have been accidentally applying normal mapping to surfaces that can't really apply normal mapping, which again, means you are wasting performance and potentially introducing visual errors. On the engine side, I think the warning is a bit too aggressive and is being perceived as a regression even though it is warning you about potential issues that already exist in your project. As described above. I would like to potentially limit the cases that show the warning and try to only show the warning when there is a high chance of visual error. |
@clayjohn thanks for the detailed reply! I probably ran into a corner case situation as I am using a large number of .tres meshes that were converted in the early 4.0 days and worked fine up until now. They would have been originally exported as objs from blender (which has no option for tangents), so the tangents would have been created by godot presumably upon import. Anyway, I now know to export glb from blender with the tangent option on. Not sure why that is off by default, maybe to cut down on file size? Most of my normal mapping is using triplanar rather than uv''s so there is probably no difference visually, but it sounds like good future proofing to export with tangents. I don't tend to use obj much any more anyway. Even though this wasn't directly related to the new mesh format, hopefully the mesh format has been locked down for the foreseeable future :) |
Hope this helps in any way: of all the imported assets in my game, only a custom Terrain3D was causing this issue. I tried recreating the Terrain3D node in v4.2.1 RC1 but I get the same warnings. EDIT: Sorry, apparently it is directly related to the Terrain3D plugin. The devs have issued a nightly build to cover this issue, here's a quote from their releases page: "For Godot 4.2, use the nightly build ... from 4d844c4 which fixes some error spam." |
My terrain plugin uses a chunk mesh with minimal vertex data which is displaced in shader and re-used for every chunk. That means normals, binormals and tangents can't possibly come from the mesh, they are generated in the shader. The mesh therefore only contains vertices, no normals, no tangents, nothing else. It is also not using any form of compression, because it is made from code. |
I guess our only option is to add the ability to disable the warning. |
How would it be specified though? If this is a project setting, that would also silence relevant warnings, not just the irrelevant ones, because it's global. This is also not good for plugins because it would require user action. I suppose a shader hint could be better, but I dont know if it's possible. Another thing could be to figure out if the shader reads TANGENT rather than referencing it at all, because in the present case the shader only writes, not read. |
Is there a way to silence this warning? I'm getting this warning on Godot 4.3 (final, release) with my voxel shader which is setting Related ticket of my voxel plugin Please reopen this ticket and either disable this warning by default or provide a way to disable it. Thanks! |
We need a way to disable any warning in a project, because issues like this can happen in many different subsystems. |
Please open a new bug report as you are asking for something different from the OP |
This already exists as |
That suggestion disables all errors and warnings which is not the intended purpose of his request though. |
Added a Godot proposal to introduce configurable log filters/limits: Please continue the discussion there. Thanks! |
Godot version
4.2beta6
System information
Windows 10
Issue description
In all my 4.2beta6 3D projects I get this warning spammed:
servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp:3725 - Attempting to use a shader that requires tangents with a mesh that doesn't contain tangents. Ensure that meshes are imported with the 'ensure_tangents' option. If creating your own meshes, add an
ARRAY_TANGENTarray (when using ArrayMesh) or call
generate_tangents()(when using SurfaceTool). (User)
This is absolutely not helping me as I don't know which mesh this is refering to.
The only way that I can get rid of it right now is by basically "drilling down" into individual scenes where this error occures and then find the mesh that is refered by the warning.
This is not a process that is in any way straight forward in a larger project.
The error should have a reference to the mesh in any way (name of the mesh instance, name of the mesh file, name of the scene etc.)
Steps to reproduce
Can't tell exactly.
Minimal reproduction project
The text was updated successfully, but these errors were encountered: