Unity PBR Shader not showing up on Sphere - unity3d

I am using HDRP.
I have this PBR Shader Graph:
But the result I get is this:
The Shader is not showing up on the sphere at all.

It seems that the material of the sphere does have a shader, but it's probably one of the build-in ones. You need to assign your shader to the material the sphere is using. There are two ways that you can do that. One is to grab the shader and drop it on the material from the project tab. The second way is to select the material and on the top of the properties tab, there is a dropdown next to some Text saying "Shader". Click it and select your shader. If you want a visual representation of how to do that, you can check this video out at 6:40 (by Brackeys). If you have further question, feel free to ask.

Related

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.

How to set texture of shader graph material via script with URP

I am trying to set the texture of a shader graph material and am having no luck. After following some tutorials and some googling I can't seem to get it working.
So far I have set my scene up with a plane i generated via code and a pre-built one and have applied the material to both of these. I then created a script to set the texture of the MeshRenderer to "_MainTex" as I saw mention several times while googling. I also set the material texture property to "_MainTex".
I also tried the Reference name as well but that also didn't work.
So how do you set the texture of a shader graph material with Universal Render Pipeline via code?
The two planes ingame:
Prebuilt plane's inspector:
Shader Graph:
The script:
void Start()
{
GetComponent<MeshRenderer>().material.SetTexture("_MainTex", new TextureGenerator().GenerateNoiseTexture(256, 256));
}
You need to fill out the "Reference" section for this property.
It is found in Graph Inspector -> Node Settings.
(usually in the top right of the ShaderGraph)
Be sure to change "Texture2D_234E865" to "_MainTex" there. Verify the asset saved by clicking on the shader and looking in the inspector. Under Properties it should list _MainTex. Then you can use your SetTexture code or simply call material.mainTexture, which does the same thing.

Unity materials appear broken

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.

Unity3D, Glass Shader, prevent rifts

I'm new to Unity and 3D and currently working on a 3D model of a smartphone. I have a Mesh that uses Standard shader with glass material. This mesh covers all of the surface, and is able to fill in any rifts that exist on the model.
My glass material looks like this:
The properties:
The model:
The problem is that this shader is black, it's covering other elements of the model, like camera, if I remove it, the model will look like this:
which is ok, but you may see that there are little gaps near to the camera, the rifts:
I have no idea how to fill this gaps and use glass shader in the same time.
Also, I cannot use Standard shader, because it doesn't work on mobile devices.
I tried to apply any other Glass Shaders with lower LOD, which seem to work, but the gaps still remain.
Any help is highly appreciated.
Okay, so I played around with the Standard Shader and the main problem you have is that it has no transparency at all. You won't be able to look through it if it has no alpha.
What I did to get results that seemed "okay" is:
I set the rendering mode to Transparent
I set the color to #0024050C
I set the Metallic to 0
I set the Smoothness to 0.9
I kept everything else on default
There may be a comparable version for the Standard (Specular) setup:
Same values as above
Specular to #181818FF
Source to Specular Alpha
And as far as I know, the Standard Shader should work on mobile with some features disabled.

created a model in blender, imported into Unity and not affected by light

I created a hand model in blender, imported it into my scene in Unity and it does not get affected by my lights.
I created some seam lines and unwrapped the thing. I have other elements that I created in a similar way and the only difference I can appreciate here is that this one is not a mesh renderer, it is a skinned mesh renderer, because it has bones inside.
This is how it looks like, you can see the "torch light" focusing to it, making a round of light, and the hand is getting weird lights, like only the reflected light from below or something.
Those are the settings of the mesh
Looks like the normals are wrong. You can try to invert normals in blender or change the import settings (in Unity) of your hand mesh to calculate normals instead of using the normals in the blend file (See normals & tangents section here).
It is definitely an issue with normals. Something wrong is going on during exporting probably.
Try Calculate option under Normals in Importer settings
Hope that helps.