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 ...
user avatar
  • 113k
12 votes
Accepted

In a graph-based material system, how can I support a variety of input and output types?

I'll try to answer to the best of my knowledge, with little knowledge about the specific case of UE4, but rather on the general technique. Graph based materials are as much programming as writing the ...
user avatar
  • 3,091
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 ...
user avatar
  • 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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 113k
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 ...
user avatar
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/...
user avatar
  • 113k
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 "...
user avatar
  • 253
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: ...
user avatar
  • 113k
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 ...
user avatar
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 ...
user avatar
  • 112k
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 ...
user avatar
  • 15.6k
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 ...
user avatar
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 ...
user avatar
  • 297
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 ...
user avatar
  • 15.6k
3 votes
Accepted

How do I change the material of an object with Script in Unity?

If you want to change a Material in Unity you have to retrieve it first. If your GameObject uses a Material it means that it uses a Renderer. You can retrieve your object renderer using the internal ...
user avatar
  • 2,614
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 ...
user avatar
  • 113k
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 ...
user avatar
  • 112k
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.
user avatar
  • 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 ...
user avatar
3 votes
Accepted

How to Convert Sprite into Texture

...
user avatar
  • 2,428
3 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 ...
user avatar
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 ...
user avatar
  • 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.
user avatar
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.
user avatar
2 votes

Why does changing texture change it for both objects?

If you modify a material, it affects the objects that are using it. You need to duplicate that material, modify its texture and reassign it to the target object.
user avatar
  • 346
2 votes

UE4: Apply texture on landscape based on angle

To apply different textures based on height the general method is to, in a pixel shader; Find the height of the geometry at the current pixel position. Perform a texture lookup on the heightmap that ...
user avatar
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 ...
user avatar
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? ...
user avatar

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