Unity materials appear broken - unity3d

I've recently imported a Unity project that references .fbx file.
When I imported the project (which was created by another user) all surfaces are pink.
Having looked at all the materials the following is observed
All the materials in the top level materials are present but are shades of grey not as the material should appear
At specific assest level (assets->material_name->material) there are no materials
All textures are present
All objects have a material associated with them which are all from the grey materials.
I can force change a material by selecting the surface and manually changing the material from its default to the one material which isn't grey "teleport" for all three surface materials.
There is a seemingly related error at the bottom "speedtree materials need to be regenerated". I've googled this however, the only solution was to select the prefab option in the assets list which is not an existing option in my project.
Any thoughts would be awesome.
CBusBus

This is a shader problem. Please note that shader is not the-same as material. You plug shader into a material. The circled image below shows a "Standard" Shader that is attached to a material named "CubeMat2".
The imported Object can be pink because:
1.The shader is missing in the Project.
Manually copy the shader into your project and re-attach it to your material.
2.The shader is obsolete or uses a keyword that's not available your current version of Unity.
Make sure you are using the-same version of Unity "another user" used to create the original project.
3.A simple import bugs. This happens somethings.
All you have to do is select the material, change the shader to another Shader then change it back to what it was before. For some reason, this seems to fix the issue.
4.There is an error in the shader. If there an error in the shader, Unity can't compile it and it will be pink when attached to a material. Also, if there is a shader error, you will see that in the Console tab. You will have to fix that error.

Related

why my skybox disappeared after I added the urp package?

I want to add light2d to my project, but it's a decision I made after months I started the project, so then I added the urp package.
But something strange happended: my skybox disappeared. I mean, it can't display neither in my scene view nor game view, it seems it's totally transparented instead of a material error.
I have checked my lighting settings and camera settings, but there's no problem.
I tried to restart Unity editor, but it can't solve the problem.
Sorry for poor English, hoping you can read this.
If you use a "URP Asset (with 2D Renderer)", it wont use the Skybox material set in Lightning -> Environment.
Its probably by design i guess (2D dont need a "box", instead a rect will suffice).
Use the other Asset (with Universal Renderer) or set your "Skybox" as Sprite material in the scene.

MRTK 2.7.3 - Outline Shader is not visible on HoloLens

I saw the scene OutlineExamples in the MRTK examples package and recreated it in my own project.
The outlining works if I stay in unity in play mode. But if I deploy it on the HoloLens the object does not get a outline effect.
The OutlineExamples scene from the MRTKHub-project works as excpected on the HoloLens!
So I guess I missed something in my own project, but I cant find it. I compared the setup multiple times, but cant find a difference. And I also used the simplest object (the cube) from the example scene.
Setup for the cube
(the screenshot shows on the left side my project and on the right side the mrtkhub-project):
Mesh Filter (standard)
Mesh Renderer (standard)
Box Collider (standard)
MeshOutline with the Material "OutlineOrange" or "OutlineGreen" (added)
Object Manipulator (added)
Constraint Manager (added)
The only thing that I had to setup after adding the as "added" marked compenents, was the material for the MeshOutline component.
Is there something else someone has to setup to see the outline shader on the HoloLens?
My Setup:
Unity 2020.3.30
MRTK 2.7.3
Visual Studio 2019
What else did I check?
The XR Plug-in Management is set up the same way
--EDIT
I noticed something strange and I guess this will help someone who knows more about shader!
I launched my application on the HoloLens, grabbed the cube and put it in front of a window in my room. While placing the cube in front of the window, I saw the outline! But as soon as I move it outside the window area, the outline disappears! Another aspect is that I'm using the spatial mapping from MRTK. That means that the window does not get meshed, only the walls. And I guess the walls have their own shader on it, right?
So the spatial mesh shader and the outline shader "dont like each other". Is this possible?
The user derHugo gave me a hint that led to the solution! I went to the material, that I use on the cube and changed the property Render Queue Override under Advanced Options to a higher value than the material MRTK_Occlusion, which is used for the spatial mapping, has.

How do you export a project from Blender to Unity?

This is what it looks like in blender:
and this is what it looks like after being exported to unity:
The above is what results after only dragging the .blend file into the unity Assets folder, that's all I did. In Blender all the objects have only one Material with a single color or a single texture, so there's no complicated Materials. And in Unity I tried the "Extract Materials" option and it does nothing; and the "Extract Textures" option is greyed out.
I want it to look the same in Blender and Unity. Can someone point me in the right direction? I don't even know what to google anymore.
It's quite easy to recreate that in Unity.
ShaderGraph also has a "Voronoi" Node, which is very similar. Instead of a Color-Ramp (Blender) I sampled a Gradient.
For the fidget popper, I used a HDRP/Lit Shader on a new Material and just set Color, Metallic and Smoothness.

Importing blender textured objects into unity

I am able to get this particular textured model from a 360 camera in blender. Blender Image
However, how do i get this .obj model into unity? I am only able to get the shaded version of it, not the textured version. Unity Image
When you export the .obj you should have a .mtl which contains the material data and texture mapping. Make sure when importing into unity (and exporting from blender) the file is generated and read.
Check your blender material properties and the individual texture properties. you should try to combine all materials into a single material so that its easier to reconfigure the textures in unity.
Once imported into unity, check the material settings and check if you need to reference the texture files again, most often when importing exporting .obj, the texture path gets lost so you must re-reference it in the target software. Sometimes it is also necessary to re-assign the materials themselves.
Also check your rendering options in unity, you may just be seeing it untextured in the unity viewport. (on the top left corner it says shaded, try changing it to textured or some other option)
You may as well try to use other mutually supported file types, like .3DS which do not use a separate material file, or check for blender add-ons that can export with all necessary settings for Unity.
Finally, your model is way too complex, it is raw data from a 3D scanner or ripper, I suggest you remake it so that you have manual control over each face and texture. (or at least for practice of doing the export-import operation).
More details like pictures of your material settings of both blender and unity would help in assisting you further.

How do I change materials on parts of huge meshes in Unreal Engine 4?

I am supposed to work on a huge single mesh in Unreal Engine 4.13.2, imported from Blender v.2.74. My first task is to change materials of some parts of the mesh. It is possible to drag and drop a material into the viewport and apply it to the desired part. I can do that with the material already in use and everything is fine.
The problem arises when I import another texture, create a new material and apply it the same way as before. Suddenly, the material is not in place and distributed all over the surface of said object.
My research showed that I could be in need of a UV-map for the texture to create a material that correctly fits the object (I hesitate using the word "mesh", because, as I said, it is all a huge mesh). Still, I could not find a way to display a UV-map of the texture that is already correctly applied.
What I have tried:
compared the already imported texture the material in use is based on with my newly imported texture in every single aspect (they are simple 512x512 pixels .png-files, all options are the same)
re-imported the current texture to see if the .png in our resources is in fact the texture used to create the current material and created a material which could be applied just fine (but was, of course, not the desired motive)
opened the exact same .png-file, put my desired picture inside, saved, imported and created a material: this resulted in the same chaos as in the description in the beginning.
I am probably missing something very basic, but cannot find it, and would not ask, if I hadn't already put dozens of hours into research. Do you have an idea what could solve the problem I described?
I would rather not make the changes in Blender, because of other changes that were applied to the mesh in Unreal Engine, before I started working on the project.
Thank you for your time.
I've had the same problem and I gave up researching after a while, but I solved the problem myself in blender.
Sadly, you can't fix this problem in Unreal Engine 4 because you either didn't or didn't do UV unwrapping correctly. UV unwrapping in blender is very simple. Here is a link to a YouTube video that shows you how to UV unwrap a mesh: https://youtu.be/r7wC0d2CeSU.
You don't have to create the material in Blender, just make sure that you add a material in blender and then in Unreal Engine 4 you can edit it. Hope This helps!