D
D
dkrylov2017-04-18 20:20:10
css
dkrylov, 2017-04-18 20:20:10

How to make a texture overlay on a transparent image (png) or on a dom element?

Hello, dear programmers....and designers...and typesetters :D
I came across a non-trivial task. There is a door frame (the structure and design of the door may vary). There is a texture for such a door. How to apply texture?!?
The screenshot shows approximately how it should look before and after applying the texture.
39a975f5b2cd4ad2a0dbbc7721580e55.png
Work with DOM tree? Or Canvas? If possible, answer not just yes or no, but more detailed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolai Chuprik, 2017-04-19
@dkrylov

My version. Should be done in SVG. Prepare 4 files:
1-2. Two textures the size of the entire image field: with the horizontal direction of the wood and with the vertical.
3-4. From the drawing of the door, make two masks: one for areas with a horizontal texture direction, the other for vertical ones.
Well, put it all together. Just keep in mind that you showed a rendered image on the right, there are shadows there. Those. It's not just about texture mapping, it's also about lighting and rendering. Therefore, do not expect that due to the textures you will get such a picture as shown.
To improve, I can advise you to overlay the drawing itself on top of all this so that the edges are additionally drawn, because otherwise they will not be visible (it will just be the border of the two textures, not selected in any way).

I
IsaevDev, 2017-04-19
@IsaevDev

don't you think that in the example there is just a separate transparent picture with a drawing and a separate picture with a textured door? more like a render, to be honest, than a regular texture

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question