BlenderProc icon indicating copy to clipboard operation
BlenderProc copied to clipboard

[QUESTION] How add decals to textures

Open ggand0 opened this issue 2 years ago • 5 comments

Hello,

Thanks for developing this awesome tool. I was wondering how to add decals to textures in BlenderProc. If there's no way to perform this, I'd like to request this feature.

What I want to achieve is to randomly place dirt or damage decals (also randomly generated) on a model texture to simulate imperfect objects. I'm aware of MaterialUtility.infuse_texture method, but this rather "blends" two textures together. I'm looking for a method that overlays one or multiple small textures over another texture.

I'd appreciate if you could share any insights on this topic. Thanks in advance!

VideoScreenshot - YouTube - 2’20”

ggand0 avatar Oct 13 '22 03:10 ggand0

Hey,

a great question. I thought about it a bit.

You should use the multiple UV map feature for this, allowing you to position multiple textures on one object. These can then be selected via the UV Map shader node, and then you just have to fuse them as you have seen in the infuse_texture method.

Does this help?

PS: We are always looking for contributions ;)

Best, Max

themasterlink avatar Oct 13 '22 06:10 themasterlink

Hi Max,

Thank you for your reply and suggestion! I feel that using multiple UV maps and the infuse_texture method with 'overlay' option would work. I'll play around with the codes and see how it goes.

On the other hand, I was imagining another method where we project decal textures onto model geometry. An example this would be bullet hole decals on objects in shooter games. I also found a three.js demo doing something close to this. Is this possible to do in blenderpy / BlenderProc? Would love to hear your thoughts on this approach too :)

ggand0 avatar Oct 13 '22 08:10 ggand0

Hey,

That sounds like a plan.

To do it interactive in the blender GUI? Or to do it automatically in the code with bpy and bproc? In the code should work as you described.

Best, Max

themasterlink avatar Oct 13 '22 09:10 themasterlink

I meant doing it automatically in bpy & bproc. Thanks for your feedback, I'll also dig into the second approach.

ggand0 avatar Oct 13 '22 09:10 ggand0

Looking forward to your results ;)

themasterlink avatar Oct 13 '22 09:10 themasterlink