16 votes

Tiling of a material, independent of its size

One simple way to do this without a script modifying the tiling per object is to apply the texture in worldspace. That way you'll always have a consistent repeat rate, no matter where or how stretched ...
  • 125k
10 votes
Accepted

Can instantiated objects have different material/texture?

since you admittedly don't have much experience with 3D and (presumably) OpenGL, I'll give you a "bird's eye" overview of the process. I'll do my considerations about OpenGL, but the basic reasoning ...
  • 363
9 votes
Accepted

Shading Languages vs Materials in 3D editors

Well, Shading languages like GLSL and HLSL is what all the "material" code ultimately get translated to in the end. Shaders are the actual programs which are run directly on the GPU, and to create ...
5 votes
Accepted

What are 'physically-based' lighting/rendering/materials?

Physically based rendering basically means that you strive to have realistic materials and lighting calculations. The way you do this can vary a bit (or a lot) depending on application, but the main ...
5 votes
Accepted

How to create a material with variable color

MaterialPropertyBlock probably what you are looking for. Just make sure to create the block once and cache it, to save on garbage collection. I'd create one ...
5 votes
Accepted

How to find a material through a raycast in Unity 5?

I'd recommend testing empirically to confirm, but the second answer at this link says that triangle data for submeshes is indexed sequentially in order of submesh index. That means all the triangles ...
  • 125k
5 votes
Accepted

Unwanted highlight on far side of objects near the edges of the screen when using orthographic camera

The default shaders in Unity 5+ use something called physically-based rendering. This means they try to model a number of quirks we observe in real materials, which aren't included by the Lambertian/...
  • 125k
5 votes
Accepted

Unity: How do I only show parts of objects that overlap [2D]

First, create a simple mesh (such as a quad or a cube). Place it over top the actual game area, and stretch it so that it covers the entire camera view. Next, create a new shader named "...
  • 263
4 votes

Change color, or material of specific line segments on Line Renderer

Here's an example of what you can do with a single material and a shader that changes behaviour based on world position: This shader looks something like this: ...
  • 125k
4 votes
Accepted

Creating paralax background in Unity3D

When importing a texture, you can set two different 'wrap modes'. These tell the renderer what to do when the UV map goes past the edges of the texture. Yours is set to 'clamp', which will just ...
4 votes
Accepted

What game objects can have a "material"?

There are actually two completely unrelated kinds of materials in Unity: Renderer materials (which define how things are rendered) and physics materials (which define how rigidbodies behave when they ...
  • 115k
4 votes

Why are all materials pink in my Unity URP project?

To upgrade built-in Shaders (ref): Open your Project in Unity, and go to Edit > Render Pipeline > Universal Render Pipeline. According to your needs, select either Upgrade Project Materials to ...
3 votes
Accepted

Unity3D - Resources load to materials, how to?

Renderer.materials is a getter that returns a copy of the materials array. The code you've written modifies that copy, but does not change the material used by the ...
  • 125k
3 votes
Accepted

(Unity) Is there a way to automatically create a material for each texture and assign the texture to it?

Scripts put in a folder named Editor affect Unity's editor, rather than running when you play the game. You can use this functionality to extend the capabilities of the editor, to run custom functions ...
  • 15.7k
3 votes
Accepted

Make a plane to display material from both sides

You need to edit your shader source file in order to add "Cull Off" inside, more info here If you are not writing your own shaders (and so use default provided Unity shaders) then you can look at ...
3 votes

Importing materials from blender to UE4

If you want to create a transparent material you have to make your material "translucent". Glass also has the property that its surface is very shiny, so you also have to change the "Translucency ...
  • 307
3 votes
Accepted

Unity5 imported models show no texture

It looks like the Wings3D object doesn't have texture coordinates. There is a texture applied, it's just not applied correctly. Without texture coordinates, it'll just stretch a single pixel of the ...
  • 15.7k
3 votes
Accepted

Emission on part of the mesh

When you set the UVs for your model, make sure the faces which are supposed to have a different material get assigned to different images. When you then import the model into Unity, you will have a ...
  • 115k
3 votes

Can't change materials of model from FBX

Inside the import settings inspector for your model, change from "Use Embedded Materials" to "Use External Materials (Legacy)". You will then have a Materials Folder to modify.
  • 31
3 votes
Accepted

How can I update my materials to work with LWRP?

To upgrade all the materials that can be supported by LWRP, go to: Edit Menu -> Render Pipeline -> Lightweight Render Pipeline -> Update Project Materials to LightweightRP Materials Note - only ...
3 votes
Accepted

How to Convert Sprite into Texture

...
  • 2,524
3 votes
Accepted

Material changes to "material (instance)" on Start

When you access a renderer's material with the .material getter, Unity instantiates a new copy of the material unique to this object — that's why you see an "(...
  • 125k
3 votes

How can I make the hue of a material change over time?

Here's how to write a shader that applies this effect. I'm assuming you want lighting, so I started this shader by right-clicking in the Project view and selecting Create -> Shader -> Standard ...
  • 125k
2 votes

Why do I get a blank material in Unreal Engine 4?

If you want to add the material to an Actor, just select it in the editor, select the StaticMeshComponent of any other Mesh and then you can select a material in the Properties Panel, just type it ...
  • 139
2 votes

Why do I get a blank material in Unreal Engine 4?

Your texture samples in material have no textures inside him. Try to link textures to the material again.
2 votes

Why do I get a blank material in Unreal Engine 4?

Make sure your textures exists on the correct path. If you delete or move a texture the materials may throw errors.
2 votes
Accepted

OBJ file, face materials and drawing them with OpenGL

You need two vertexes in such this case. There is no way around it. If the faces have a different texture then you will need a different vertexes to define them. To simplify it you could try to save ...
2 votes

Unity how to change material properties at runtime

I tested your script and was able to dynamically adjust the colors of the line renderer. Perhaps you didn't pass your linerenderer component into your script in the editor on the attached object? ...
2 votes
Accepted

Unity2D Sprite gone / not visible when flipped using Vector3.x

You need to flip the texture, not the object. Sprite/Plane meshes are one-sided so if you flip the actual object, you are seeing the back of it, which is transparent. Edit: You could also make your ...
  • 1,728
2 votes

Difference between Material and Shader

Although late, there is a "cheat" which can help you understand better. A material is everything that is attached to a certain shader for that draw call. For example, in the above answer, you have ...

Only top scored, non community-wiki answers of a minimum length are eligible