How do I apply a texture to an object?

The manual is useless as all it sais is apply texture to material. Thats it? Never mind that there are several places within the material editor to apply an image and so far, none of them have resulte din texture being applied to object using the material.

I have an object with a perfectly smooth untextured surface that has a color. Nothing I do changes that. I can effect how reflective it is or not, translucency, emission etc, but no texture.

4 Answers

4

This is a fairly normal predicament to run into, so don’t worry. Many people have been unclear on this in the beginning.


First, just to make it clear what’s happening, you don’t directly apply the Texture to anything. You apply the Texture to the Material (for example, generally under the “Albedo” section of the Standard Shader, which you’ll see upon creating a new Material), then you apply that Material to your 3D object.


That may sound a little unintuitive at first, but to understand why it’s done this way, let’s take a quick look at what happens behind the scenes:

In order for the computer to draw the 3D object, it’s sending information to the video card and basically saying “Hey, draw this!” Well, the video card has to make sense of it first. That’s what the Shader is for. The Shader tells the video card “When you’re drawing something, draw it like this” and gives a huge number of instructions to the video card saying how to draw it.

Finally, this is where the Material comes into play. The material is there to take the Shader, which says how to draw something, and and the Texture, the thing to be drawn, and combine them. This way, you can reuse the Shaders without needing a different version for every Texture used with them.


So, in a nutshell, a Material will do what you’re looking to do. You add your Texture to the Material, then put the Material on the 3D object to display it using the Shader.

Further, in your case, the Material already has a Shader applied to it when it’s created, so you only need to add the Texture at that point.

(Assuming you are using the “standard shader” for your material)
Click the dot-in-a-circle-button next to “Albedo” to select the texture image.
100735-materialimage.png

This should set the texture of the material. I used to the builtin “background” image in this example. Here is what the material preview looks like after selecting it:

100736-materialimagesample.png

I see the texture in the material preview when applied to Albedo, but it is not reflected in the scene edit or game preview windows?

I see the texture in the material preview when applied to Albedo, but it is not reflected in the scene edit or game preview windows?

Hi, actually I can have a look tomorrow. It is night here :D, you have used many animations as well, I need to check them first. Then there are many " if else " which should be cleaned up. I donot say your code is wrong but its a bit complicated due to tight coupling.

If you try add a video to object!
1-add comopenent >video>replace your video
2-create>RenderTexture
3-your object >videoplayer>render mode>change to render texture.
4-your object >videoplayer>target texture> replace your render texture(you made in step2)
5-your object >shader>place your render texture(you made in step2) in Albedo
6-your object >shader>place your render texture(you made in step2) in Emission color.
7- tick &choose emission .

Okey Sir i will wait for tomorrow thank you so mush !!