- Home /
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.
Answer by Eno-Khaon · Aug 26, 2017 at 07:50 PM
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.
great answer! One thing I would rephrase/expand on:
The shader defines how to COLOR each pixel of your 3d object. It is a process/function/routine/algorithim (not data). The $$anonymous$$aterial defines some of the shader function parameter's data, which is passed on to the shader. This includes the texture, along with things like reflectivity and stuff.
(During rendering, the data that defines the 3d shape/position/orientation of the object is also passed to the shader.)
Each material specifies what shader it uses to render; changing the shader used by the material, will/may also change the material's options you see in the editor.
You probably don't need to mess with what shader is being used, for your situation (you CAN program your own shaders): but it's important to understand how they fit in the pipeline.
Answer by Glurth · Aug 26, 2017 at 07:52 PM
(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.
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:
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?
If you DO see it in the texture preview window, that implies the reason you don't see the texture in the scene, has to do with the way your scene is configured. What happens if you create a default-new scene, add a cube, and apply the material to the cube? If that fails, try again, but with a brand new project; it might due to some project-wide graphics or lighting setting.
Sure enough, the texture from the material is being displayed on the cube in the new test scene.
However when I place the hallway section I am working with into the scene, none of the objects making up the hallway show the texture, but the test cube still shows the texture from any of the materials applied to it.
Answer by kami1339 · Feb 08, 2019 at 12:23 PM
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 .