Each texture mapping has different decal mods. In this part we will use 5 different decal mods.
Replace diffuse component
Replace normal
Replace background
Replace All
Blend diffuse component
Bump normal
Lets start with Replace diffuse component option. For this decal mod I will use wall texture. In this example we have simple cube and we will use texture colors for diffuse component.
![]() |
cube_wall |
We can use textures to change colors of the objects. Also, we can use them as normals. When we use normal maps, we can perceive height because normals change the light calculations. When some points.
This is our first normal maps. RGB values specify normal directions. When we apply this texture to the standard cube we will get this result.
![]() |
cushion |
Another example is cube waves.
You can feel like there is height in the cube but it is not. the only difference is the normals.
Now we can combine normal maps and image texture. For this purpose we can use wall texture. Also, we have normal maps of walls.
We have similar examples on the sphere.
When we map textures uv mapping. It is from (0,0) to (1,1) and our textures have height and width.
Suppose that, we need texture color at (0,37,0.54) and our texture is 512x512. Texture color equals to (189.44,276,48) at this pixel. However, our pixel coordinates should be integer. Thus, we use to technique to interpolate the pixel coordinates. Techniques are nearest and bilinear interpolations. In nearest, we simple round the coordinates and get the texture color. In bilinear interpolation, we calculate nearest 4 pixel color and we get their weighted sums.
In this example you can focus to edge of the squares and you can see the difference.
Now we can talk about bump mapping. This is another technique similar to normal mapping. In this technique, we will manipulate normals. By using this technique we can feel the heights more.
On the left side we see world without heights. On the right side there is only heights. If we combine them we will get:
This picture looks more realistic.
Let's talk about procedural textures. These pictures are not real pictures. They are generated by codes. They have functions and seeds. If you change the seeds you will get different textures. In this part we will use perlin texture. Perlin is a noise that is a little bit different from noise. Perlin noise doesn't have constant changes. Therefore, it is easier to detect what it has

On the left side we see normal noise. On the right side we see perlin noise. On the left side we can not distinguish black part and white part. However, in perlin noise, we see that there are big and entire black and white parts. This help us to get significant textures.
Let's look at examples.
Last thing we didn't mention is replace background. When our ray hits nothing, we uses background color. However, in this technique, we replace it with a picture. Here we have galatica example
I have another examples which are combination of the features.
In this part I encountered with a problem. When I apply affine transformation, texture mapping doesn't work well. I will fix it and I will share in next parts.
Lastly, What happened in the backstage is here.
Yorumlar
Yorum Gönder